aboutsummaryrefslogtreecommitdiff
path: root/SingleSource/Regression/C/gcc-c-torture/execute/pr39120.c
diff options
context:
space:
mode:
Diffstat (limited to 'SingleSource/Regression/C/gcc-c-torture/execute/pr39120.c')
-rw-r--r--SingleSource/Regression/C/gcc-c-torture/execute/pr39120.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/SingleSource/Regression/C/gcc-c-torture/execute/pr39120.c b/SingleSource/Regression/C/gcc-c-torture/execute/pr39120.c
new file mode 100644
index 00000000..88598480
--- /dev/null
+++ b/SingleSource/Regression/C/gcc-c-torture/execute/pr39120.c
@@ -0,0 +1,18 @@
+struct X { int *p; } x;
+
+struct X __attribute__((noinline))
+foo(int *p) { struct X x; x.p = p; return x; }
+
+void __attribute((noinline))
+bar() { *x.p = 1; }
+
+extern void abort (void);
+int main()
+{
+ int i = 0;
+ x = foo(&i);
+ bar();
+ if (i != 1)
+ abort ();
+ return 0;
+}