summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.c-torture/execute/pr36343.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.c-torture/execute/pr36343.c')
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/pr36343.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr36343.c b/gcc/testsuite/gcc.c-torture/execute/pr36343.c
new file mode 100644
index 000000000..44b9fb340
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/pr36343.c
@@ -0,0 +1,32 @@
+extern void abort (void);
+
+void __attribute__((noinline))
+bar (int **p)
+{
+ float *q = (float *)p;
+ *q = 0.0;
+}
+
+float __attribute__((noinline))
+foo (int b)
+{
+ int *i = 0;
+ float f = 1.0;
+ int **p;
+ if (b)
+ p = &i;
+ else
+ p = (int **)&f;
+ bar (p);
+ if (b)
+ return **p;
+ return f;
+}
+
+int main()
+{
+ if (foo(0) != 0.0)
+ abort ();
+ return 0;
+}
+