aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.dg/torture/pta-callused-1.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/gcc.dg/torture/pta-callused-1.c')
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pta-callused-1.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pta-callused-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pta-callused-1.c
new file mode 100644
index 000000000..5ca71c2a0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pta-callused-1.c
@@ -0,0 +1,25 @@
+/* { dg-do run } */
+/* { dg-options "-fdump-tree-alias" } */
+/* { dg-skip-if "" { *-*-* } { "-O0" "-fno-fat-lto-objects" } { "" } } */
+
+volatile int i;
+int ** __attribute__((noinline,pure)) foo(int **p) { i; return p; }
+int bar(void)
+{
+ int i = 0, j = 1;
+ int *p, **q;
+ p = &i;
+ q = foo(&p);
+ *q = &j;
+ return *p;
+}
+extern void abort (void);
+int main()
+{
+ if (bar() != 1)
+ abort ();
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump "p.._. = { i j }" "alias" } } */
+/* { dg-final { cleanup-tree-dump "alias" } } */