aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr45967.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/gcc.dg/torture/pr45967.c')
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr45967.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr45967.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr45967.c
new file mode 100644
index 000000000..0a5b206e5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr45967.c
@@ -0,0 +1,21 @@
+/* { dg-do run } */
+
+extern void abort (void);
+void __attribute__((noinline,noclone))
+foo (void *p_)
+{
+ int *p;
+ int i;
+ for (i = 0; i < sizeof(int *); ++i)
+ ((char *)&p)[i] = ((char *)p_)[i];
+ *p = 1;
+}
+int main()
+{
+ int i = 0;
+ int *p = &i;
+ foo (&p);
+ if (i != 1)
+ abort ();
+ return 0;
+}