gcc/testsuite/gcc.c-torture/execute/pr123978.c
raw| 1 | /* PR middle-end/123978 */ |
| 2 | |
| 3 | struct A { unsigned b, c, *d; }; |
| 4 | |
| 5 | [[gnu::noipa]] int |
| 6 | foo (struct A *a) |
| 7 | { |
| 8 | __builtin_memset (a->d, 0, ((long long) sizeof (unsigned)) * a->b * a->c); |
| 9 | return 0; |
| 10 | } |
| 11 | |
| 12 | int |
| 13 | main () |
| 14 | { |
| 15 | struct A a; |
| 16 | unsigned b[256]; |
| 17 | __builtin_memset (b, 0x55, sizeof (b)); |
| 18 | a.b = 15; |
| 19 | a.c = 15; |
| 20 | a.d = b; |
| 21 | foo (&a); |
| 22 | for (int i = 0; i < 225; ++i) |
| 23 | if (b[i] != 0) |
| 24 | __builtin_abort (); |
| 25 | } |