gcc/testsuite/gdc.dg/torture/pr114171.d
raw| 1 | // { dg-do run } |
| 2 | // { dg-additional-options "-mavx" { target avx_runtime } } |
| 3 | // { dg-skip-if "needs gcc/config.d" { ! d_runtime } } |
| 4 | import gcc.builtins; |
| 5 | |
| 6 | struct S1 |
| 7 | { |
| 8 | string label; |
| 9 | } |
| 10 | |
| 11 | struct S2 |
| 12 | { |
| 13 | ulong pad; |
| 14 | S1 label; |
| 15 | } |
| 16 | |
| 17 | pragma(inline, false) |
| 18 | auto newitem() |
| 19 | { |
| 20 | void *p = __builtin_malloc(S2.sizeof); |
| 21 | __builtin_memset(p, 0, S2.sizeof); |
| 22 | return cast(S2*) p; |
| 23 | } |
| 24 | |
| 25 | int main() |
| 26 | { |
| 27 | auto bn = newitem(); |
| 28 | return bn.label is S1.init ? 0 : 1; |
| 29 | } |