summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/torture/ipa-pta-2.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/torture/ipa-pta-2.c')
-rw-r--r--gcc/testsuite/gcc.dg/torture/ipa-pta-2.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/torture/ipa-pta-2.c b/gcc/testsuite/gcc.dg/torture/ipa-pta-2.c
new file mode 100644
index 000000000..768c99e82
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/ipa-pta-2.c
@@ -0,0 +1,24 @@
+/* { dg-do run } */
+/* { dg-options "-fipa-pta" } */
+
+int **x;
+
+static int __attribute__((noinline,noclone))
+foo (int **p)
+{
+ int a = 1;
+ **p = 0;
+ *x = &a;
+ return **p;
+}
+
+extern void abort (void);
+int main()
+{
+ int b;
+ int *p = &b;
+ x = &p;
+ if (foo (&p) != 1)
+ abort ();
+ return 0;
+}