aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.8/gcc/testsuite/gcc.dg/torture/pr57425-1.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.8/gcc/testsuite/gcc.dg/torture/pr57425-1.c')
-rw-r--r--gcc-4.8/gcc/testsuite/gcc.dg/torture/pr57425-1.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/gcc-4.8/gcc/testsuite/gcc.dg/torture/pr57425-1.c b/gcc-4.8/gcc/testsuite/gcc.dg/torture/pr57425-1.c
new file mode 100644
index 000000000..8ca85cafe
--- /dev/null
+++ b/gcc-4.8/gcc/testsuite/gcc.dg/torture/pr57425-1.c
@@ -0,0 +1,37 @@
+/* { dg-do run } */
+
+extern void abort (void) __attribute__((noreturn));
+
+union setconflict
+{
+ int a[20];
+ long b[10];
+};
+
+int
+main ()
+{
+ int sum = 0;
+ {
+ union setconflict a;
+ int *c;
+ c = a.a;
+ asm ("": "=r" (c):"0" (c));
+ *c = 0;
+ asm ("": "=r" (c):"0" (c));
+ sum += *c;
+ }
+ {
+ union setconflict a;
+ long *c;
+ c = a.b;
+ asm ("": "=r" (c):"0" (c));
+ *c = 1;
+ asm ("": "=r" (c):"0" (c));
+ sum += *c;
+ }
+
+ if (sum != 1)
+ abort();
+ return 0;
+}