diff options
Diffstat (limited to 'gcc/testsuite')
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/ipa/pr56988.c | 38 |
2 files changed, 43 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 4c7a5b3..1f345ff 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2013-05-02 Martin Jambor <mjambor@suse.cz> + + PR middle-end/56988 + * gcc.dg/ipa/pr56988.c: New test. + 2013-05-02 Ian Bolton <ian.bolton@arm.com> * gcc.target/aarch64/bics_1.c: New test. diff --git a/gcc/testsuite/gcc.dg/ipa/pr56988.c b/gcc/testsuite/gcc.dg/ipa/pr56988.c new file mode 100644 index 0000000..ab20159 --- /dev/null +++ b/gcc/testsuite/gcc.dg/ipa/pr56988.c @@ -0,0 +1,38 @@ +/* { dg-do run } */ +/* { dg-options "-O3" } */ +/* { dg-add-options bind_pic_locally } */ + +struct S +{ + int a, b, c; +}; + +volatile int g; + +static void __attribute__ ((noinline, noclone)) +bar (struct S **p) +{ + g = 5; +}; + +static void __attribute__ ((noinline)) +foo (struct S *p) +{ + int i = p->a; + if (i != 1) + __builtin_abort (); + bar (&p); +} + +int +main (int argc, char *argv[]) +{ + struct S s; + s.a = 1; + s.b = 64; + s.c = 32; + foo (&s); + + return 0; +} + |