gcc/testsuite/gcc.dg/pr117490.c
raw| 1 | /* { dg-do run } */ |
| 2 | /* { dg-options "-O2 -std=c23" } */ |
| 3 | |
| 4 | typedef struct { |
| 5 | int i1; |
| 6 | } s1; |
| 7 | |
| 8 | typedef struct { |
| 9 | int i1; |
| 10 | } s2_alt; |
| 11 | |
| 12 | [[gnu::noinline,gnu::noipa]] |
| 13 | int f2(s1 *s1p, s2_alt *s2p) { |
| 14 | s1p->i1 = 2; |
| 15 | s2p->i1 = 3; |
| 16 | return s1p->i1 * 3; |
| 17 | } |
| 18 | |
| 19 | int main() |
| 20 | { |
| 21 | s1 a; |
| 22 | if (9 != f2(&a, (void*)&a)) |
| 23 | __builtin_abort(); |
| 24 | } |
| 25 |