gcc/testsuite/gdc.test/compilable/test18936.d
raw| 1 | // REQUIRED_ARGS: -fPIC -O -release -inline -m64 -betterC |
| 2 | // DISABLED: win32 win64 |
| 3 | |
| 4 | // https://issues.dlang.org/show_bug.cgi?id=18936 |
| 5 | // produces assert failure cgxmm.c line 684 |
| 6 | |
| 7 | import core.stdc.math; |
| 8 | |
| 9 | struct S |
| 10 | { |
| 11 | double re, im; |
| 12 | |
| 13 | |
| 14 | static S sqrtcx(S* z) |
| 15 | { |
| 16 | S c; |
| 17 | real x,y,w,r; |
| 18 | |
| 19 | { |
| 20 | x = fabs(z.re); |
| 21 | y = fabs(z.im); |
| 22 | if (z.re >= 0) |
| 23 | { |
| 24 | c.im = (z.im >= 0) ? w : -w; |
| 25 | c.re = z.im / (c.im + c.im); |
| 26 | } |
| 27 | } |
| 28 | return c; |
| 29 | } |
| 30 | } |