| 1 |
/* PR middle-end/115527 */ |
| 2 |
/* { dg-do run } */ |
| 3 |
|
| 4 |
struct T { struct S { double a; signed char b; long c; } d[3]; int e; } t1, t2; |
| 5 |
|
| 6 |
__attribute__((noipa)) void |
| 7 |
foo (struct T *t) |
| 8 |
{ |
| 9 |
for (int i = 0; i < 3; ++i) |
| 10 |
{ |
| 11 |
t->d[i].a = 1. + 3 * i; |
| 12 |
t->d[i].b = 2 + 3 * i; |
| 13 |
t->d[i].c = 3 + 3 * i; |
| 14 |
} |
| 15 |
t->e = 10; |
| 16 |
} |
| 17 |
|
| 18 |
int |
| 19 |
main () |
| 20 |
{ |
| 21 |
__builtin_memset (&t2, -1, sizeof (t2)); |
| 22 |
foo (&t1); |
| 23 |
foo (&t2); |
| 24 |
__builtin_clear_padding (&t2); |
| 25 |
if (__builtin_memcmp (&t1, &t2, sizeof (t1))) |
| 26 |
__builtin_abort (); |
| 27 |
return 0; |
| 28 |
} |