-
-
Notifications
You must be signed in to change notification settings - Fork 609
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix bugzilla 24884 - backend generates wrong 32-bit code after inlini…
…ng math with double[4]
- Loading branch information
Showing
2 changed files
with
35 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* | ||
REQUIRED_ARGS: -inline | ||
*/ | ||
|
||
// https://issues.dlang.org/show_bug.cgi?id=24884 | ||
|
||
pragma(inline, false) | ||
bool norm(int a) => 0; | ||
|
||
pragma(inline, false) | ||
void inlinebug(ref double[4] point1, ref double[4] point2, ref double[4] point3, ref double[4] abcd) | ||
{ | ||
double[4] v1 = 0.0; | ||
double[4] v2 = 0.0; | ||
|
||
v1[0] = point1[0] - point2[0]; | ||
v1[1] = point1[1] - point2[1]; | ||
v1[2] = point1[2] - point2[2]; | ||
v1[3] = point1[3]; | ||
v2[0] = point2[0] - point3[0]; | ||
v2[1] = point2[1] - point3[1]; | ||
v2[2] = point2[2] - point3[2]; | ||
|
||
int p = cast(int) &abcd; | ||
int q = cast(int) &point1; | ||
abcd[0] = norm(7) + p; | ||
abcd[1] = q + p; | ||
} | ||
|
||
extern(C) void main() | ||
{ | ||
double[4] a = 0.0; | ||
inlinebug(a, a, a, a); | ||
} |