aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr36728-3.c
diff options
context:
space:
mode:
authorBen Cheng <bccheng@google.com>2014-03-25 22:37:19 -0700
committerBen Cheng <bccheng@google.com>2014-03-25 22:37:19 -0700
commit1bc5aee63eb72b341f506ad058502cd0361f0d10 (patch)
treec607e8252f3405424ff15bc2d00aa38dadbb2518 /gcc-4.9/gcc/testsuite/gcc.dg/guality/pr36728-3.c
parent283a0bf58fcf333c58a2a92c3ebbc41fb9eb1fdb (diff)
downloadtoolchain_gcc-1bc5aee63eb72b341f506ad058502cd0361f0d10.tar.gz
toolchain_gcc-1bc5aee63eb72b341f506ad058502cd0361f0d10.tar.bz2
toolchain_gcc-1bc5aee63eb72b341f506ad058502cd0361f0d10.zip
Initial checkin of GCC 4.9.0 from trunk (r208799).
Change-Id: I48a3c08bb98542aa215912a75f03c0890e497dba
Diffstat (limited to 'gcc-4.9/gcc/testsuite/gcc.dg/guality/pr36728-3.c')
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/guality/pr36728-3.c51
1 files changed, 51 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr36728-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr36728-3.c
new file mode 100644
index 000000000..bb2c0675d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr36728-3.c
@@ -0,0 +1,51 @@
+/* PR debug/36728 */
+/* { dg-do run } */
+/* { dg-options "-g" } */
+
+#include "../nop.h"
+
+int __attribute__((noinline))
+foo (int arg1, int arg2, int arg3, int arg4, int arg5, int arg6, int arg7)
+{
+ char *x = __builtin_alloca (arg7);
+ int __attribute__ ((aligned(32))) y;
+
+ y = 2;
+ asm (NOP : "=m" (y) : "m" (y));
+ x[0] = 25;
+ asm volatile (NOP : "=m" (x[0]) : "m" (x[0]));
+ return y;
+}
+
+/* On s390(x) r2 and r3 are (depending on the optimization level) used
+ when adjusting the addresses in order to meet the alignment
+ requirements above. They usually hold the function arguments arg1
+ and arg2. So it is expected that these values are unavailable in
+ some of these tests. */
+
+/* { dg-final { gdb-test 14 "arg1" "1" { target { ! "s390*-*-*" } } } } */
+/* { dg-final { gdb-test 14 "arg2" "2" { target { ! "s390*-*-*" } } } } */
+/* { dg-final { gdb-test 14 "arg3" "3" } } */
+/* { dg-final { gdb-test 14 "arg4" "4" } } */
+/* { dg-final { gdb-test 14 "arg5" "5" } } */
+/* { dg-final { gdb-test 14 "arg6" "6" } } */
+/* { dg-final { gdb-test 14 "arg7" "30" } } */
+/* { dg-final { gdb-test 14 "y" "2" } } */
+/* { dg-final { gdb-test 16 "arg1" "1" { target { ! "s390*-*-*" } } } } */
+/* { dg-final { gdb-test 16 "arg2" "2" { target { ! "s390*-*-*" } } } } */
+/* { dg-final { gdb-test 16 "arg3" "3" } } */
+/* { dg-final { gdb-test 16 "arg4" "4" } } */
+/* { dg-final { gdb-test 16 "arg5" "5" } } */
+/* { dg-final { gdb-test 16 "arg6" "6" } } */
+/* { dg-final { gdb-test 16 "arg7" "30" } } */
+/* { dg-final { gdb-test 16 "*x" "(char) 25" } } */
+/* { dg-final { gdb-test 16 "y" "2" } } */
+
+int
+main ()
+{
+ int l = 0;
+ asm volatile ("" : "=r" (l) : "0" (l));
+ foo (l + 1, l + 2, l + 3, l + 4, l + 5, l + 6, l + 30);
+ return 0;
+}