summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/torture/pr78218.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/torture/pr78218.c')
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr78218.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/torture/pr78218.c b/gcc/testsuite/gcc.dg/torture/pr78218.c
new file mode 100644
index 00000000000..b3e2892429d
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr78218.c
@@ -0,0 +1,24 @@
+/* { dg-do run } */
+
+struct
+{
+ int v;
+} a[2];
+
+int b;
+
+void __attribute__((noinline,noclone))
+check ()
+{
+ if (a[0].v != 1)
+ __builtin_abort ();
+}
+
+int main ()
+{
+ a[1].v = 1;
+ a[0] = a[1];
+ a[1].v = 0;
+ check (a);
+ return 0;
+}