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