diff options
Diffstat (limited to 'gcc/testsuite/gcc.dg/torture/pr49651.c')
-rw-r--r-- | gcc/testsuite/gcc.dg/torture/pr49651.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/torture/pr49651.c b/gcc/testsuite/gcc.dg/torture/pr49651.c new file mode 100644 index 000000000..c58fe943c --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr49651.c @@ -0,0 +1,31 @@ +/* { dg-do run } */ + +extern void abort (void); + +struct X { + int *p; + int *q; +}; + +void __attribute__((noinline, noclone)) +foo (struct X x) { *x.q = 0; } + +volatile int what; +struct X y; + +int main() +{ + int i, j; + struct X x, *p; + x.p = &i; + x.q = &j; + if (what) + p = &y; + else + p = &x; + j = 1; + foo (*p); + if (j != 0) + abort (); + return 0; +} |