aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/ipa/pr56988.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/ipa/pr56988.c')
-rw-r--r--gcc/testsuite/gcc.dg/ipa/pr56988.c38
1 files changed, 38 insertions, 0 deletions
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;
+}
+