gcc/testsuite/g++.dg/debug/pr65678.C
raw| 1 | // PR debug/65678 |
| 2 | // { dg-do compile } |
| 3 | |
| 4 | long long v; |
| 5 | |
| 6 | static int |
| 7 | bar (double x) |
| 8 | { |
| 9 | #if __SIZEOF_DOUBLE__ == __SIZEOF_LONG_LONG__ |
| 10 | __builtin_memmove (&v, &x, sizeof v); |
| 11 | #else |
| 12 | (void) x; |
| 13 | v = 0; |
| 14 | #endif |
| 15 | return v; |
| 16 | } |
| 17 | |
| 18 | struct A |
| 19 | { |
| 20 | A (double x) : a (bar (x)) {} |
| 21 | int m1 (); |
| 22 | int m2 () { int b = a; return b; } |
| 23 | int a; |
| 24 | }; |
| 25 | |
| 26 | void foo (); |
| 27 | |
| 28 | void |
| 29 | baz (double x) |
| 30 | { |
| 31 | int c = A (x).m2 (); |
| 32 | int d = A (x).m1 (); |
| 33 | if (d) |
| 34 | foo (); |
| 35 | } |