gcc/testsuite/gcc.dg/torture/pr92088-1.c
raw| 1 | /* { dg-do run } */ |
| 2 | |
| 3 | int __attribute__((noipa)) |
| 4 | g (char *p) |
| 5 | { |
| 6 | return p[9]; |
| 7 | } |
| 8 | int main (int argc, char **argv) |
| 9 | { |
| 10 | struct S { |
| 11 | char toto[argc + 16]; |
| 12 | }; |
| 13 | int f (struct S arg) { |
| 14 | __builtin_strcpy(arg.toto, "helloworld"); |
| 15 | return g (arg.toto); |
| 16 | } |
| 17 | struct S bob; |
| 18 | __builtin_strcpy(bob.toto, "coucoucoucou"); |
| 19 | if (f(bob) != 'd' || __builtin_strcmp (bob.toto, "coucoucoucou")) |
| 20 | __builtin_abort (); |
| 21 | return 0; |
| 22 | } |