aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.target/s390
diff options
context:
space:
mode:
authorBen Cheng <bccheng@google.com>2014-04-22 20:33:12 (GMT)
committerBen Cheng <bccheng@google.com>2014-04-22 20:33:12 (GMT)
commite3cc64dec20832769406aa38cde83c7dd4194bf4 (patch)
treeef8e39be37cfe0cb69d850043b7924389ff17164 /gcc-4.9/gcc/testsuite/gcc.target/s390
parentf33c7b3122b1d7950efa88067c9a156229ba647b (diff)
downloadtoolchain_gcc-e3cc64dec20832769406aa38cde83c7dd4194bf4.zip
toolchain_gcc-e3cc64dec20832769406aa38cde83c7dd4194bf4.tar.gz
toolchain_gcc-e3cc64dec20832769406aa38cde83c7dd4194bf4.tar.bz2
[4.9] GCC 4.9.0 official release refresh
Change-Id: Ic99a7da8b44b789a48aeec93b33e93944d6e6767
Diffstat (limited to 'gcc-4.9/gcc/testsuite/gcc.target/s390')
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.target/s390/20140327-1.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.target/s390/htm-builtins-compile-1.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.target/s390/htm-nofloat-1.c54
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.target/s390/htm-nofloat-compile-1.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.target/s390/s390.exp10
5 files changed, 81 insertions, 21 deletions
diff --git a/gcc-4.9/gcc/testsuite/gcc.target/s390/20140327-1.c b/gcc-4.9/gcc/testsuite/gcc.target/s390/20140327-1.c
new file mode 100644
index 0000000..f71c38f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.target/s390/20140327-1.c
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -m31 -mzarch" } */
+
+void
+foo ()
+{
+ asm ("" ::: "%f4");
+}
+
+/* { dg-final { scan-assembler "ld" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.target/s390/htm-builtins-compile-1.c b/gcc-4.9/gcc/testsuite/gcc.target/s390/htm-builtins-compile-1.c
index c1b98e2..982a748 100644
--- a/gcc-4.9/gcc/testsuite/gcc.target/s390/htm-builtins-compile-1.c
+++ b/gcc-4.9/gcc/testsuite/gcc.target/s390/htm-builtins-compile-1.c
@@ -27,8 +27,8 @@ foo (struct __htm_tdb* tdb, int reg, int *mem, uint64_t *mem64)
cc = __builtin_tbegin ((void *)0x12345678);
cc = __builtin_tbegin (tdb);
cc = __builtin_tbegin (&global_tdb);
- cc = __builtin_tbegin ((void *)(long long)(reg + 0x12345678));
- cc = __builtin_tbegin ((void *)(long long)(reg));
+ cc = __builtin_tbegin ((void *)(long)(reg + 0x12345678));
+ cc = __builtin_tbegin ((void *)(long)(reg));
__builtin_tbegin_nofloat ((void *)0);
__builtin_tbegin_nofloat ((void *)-99999);
@@ -36,8 +36,8 @@ foo (struct __htm_tdb* tdb, int reg, int *mem, uint64_t *mem64)
cc = __builtin_tbegin_nofloat ((void *)0x12345678);
cc = __builtin_tbegin_nofloat (tdb);
cc = __builtin_tbegin_nofloat (&global_tdb);
- cc = __builtin_tbegin_nofloat ((void *)(long long)(reg + 0x12345678));
- cc = __builtin_tbegin_nofloat ((void *)(long long)(reg));
+ cc = __builtin_tbegin_nofloat ((void *)(long)(reg + 0x12345678));
+ cc = __builtin_tbegin_nofloat ((void *)(long)(reg));
__builtin_tbegin_retry ((void *)0, 0);
cc = __builtin_tbegin_retry ((void *)0, 1);
@@ -50,9 +50,9 @@ foo (struct __htm_tdb* tdb, int reg, int *mem, uint64_t *mem64)
cc = __builtin_tbegin_retry (&global_tdb, 42);
cc = __builtin_tbegin_retry ((void *)0x12345678, global);
cc = __builtin_tbegin_retry (
- (void *)(long long) (reg + 0x12345678), global + 1);
+ (void *)(long) (reg + 0x12345678), global + 1);
cc = __builtin_tbegin_retry (
- (void *)(long long)(reg), global - 1);
+ (void *)(long)(reg), global - 1);
__builtin_tbegin_retry_nofloat ((void *)0, 0);
cc = __builtin_tbegin_retry_nofloat ((void *)0, 1);
@@ -65,9 +65,9 @@ foo (struct __htm_tdb* tdb, int reg, int *mem, uint64_t *mem64)
cc = __builtin_tbegin_retry_nofloat (&global_tdb, 42);
cc = __builtin_tbegin_retry_nofloat ((void *)0x12345678, global);
cc = __builtin_tbegin_retry_nofloat (
- (void *)(long long) (reg + 0x12345678), global + 1);
+ (void *)(long) (reg + 0x12345678), global + 1);
cc = __builtin_tbegin_retry_nofloat (
- (void *)(long long)(reg), global - 1);
+ (void *)(long)(reg), global - 1);
__builtin_tbeginc ();
diff --git a/gcc-4.9/gcc/testsuite/gcc.target/s390/htm-nofloat-1.c b/gcc-4.9/gcc/testsuite/gcc.target/s390/htm-nofloat-1.c
index df7e2ba..6022efb 100644
--- a/gcc-4.9/gcc/testsuite/gcc.target/s390/htm-nofloat-1.c
+++ b/gcc-4.9/gcc/testsuite/gcc.target/s390/htm-nofloat-1.c
@@ -1,12 +1,50 @@
-/* { dg-do compile } */
-/* { dg-options "-O3 -march=zEC12 -mzarch" } */
+/* { dg-do run } */
+/* { dg-require-effective-target htm } */
+/* { dg-options "-O3 -march=zEC12 -mzarch --save-temps" } */
-int
-foo ()
+/* __builtin_tbegin has to emit clobbers for all FPRs since the tbegin
+ instruction does not automatically preserves them. If the
+ transaction body is fully contained in a function the backend tries
+ after reload to get rid of the FPR save/restore operations
+ triggered by the clobbers. This testcase failed since the backend
+ was able to get rid of all FPR saves/restores and since these were
+ the only stack operations also of the entire stack space. So even
+ the save/restore of the stack pointer was omitted in the end.
+ However, since the frame layout has been fixed before, the prologue
+ still generated the stack pointer decrement making foo return with
+ a modified stack pointer. */
+
+void abort(void);
+
+void __attribute__((noinline))
+foo (int a)
+{
+ if (__builtin_tbegin (0) == 0)
+ __builtin_tend ();
+}
+
+#ifdef __s390x__
+#define GET_STACK_POINTER(SP) \
+ asm volatile ("stg %%r15, %0" : "=QRST" (SP));
+#else
+#define GET_STACK_POINTER(SP) \
+ asm volatile ("st %%r15, %0" : "=QR" (SP));
+#endif
+
+int main(void)
{
- __builtin_tbegin_nofloat (0);
- __builtin_tbegin_retry_nofloat (0, 42);
+ unsigned long new_sp, old_sp;
+
+ GET_STACK_POINTER (old_sp);
+ foo(42);
+ GET_STACK_POINTER (new_sp);
+
+ if (old_sp != new_sp)
+ abort ();
+
+ return 0;
}
+
/* Make sure no FPR saves/restores are emitted. */
-/* { dg-final { scan-assembler-not "std" } } */
-/* { dg-final { scan-assembler-not "ld" } } */
+/* { dg-final { scan-assembler-not "\tstd\t" } } */
+/* { dg-final { scan-assembler-not "\tld\t" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.target/s390/htm-nofloat-compile-1.c b/gcc-4.9/gcc/testsuite/gcc.target/s390/htm-nofloat-compile-1.c
new file mode 100644
index 0000000..df7e2ba
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.target/s390/htm-nofloat-compile-1.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -march=zEC12 -mzarch" } */
+
+int
+foo ()
+{
+ __builtin_tbegin_nofloat (0);
+ __builtin_tbegin_retry_nofloat (0, 42);
+}
+/* Make sure no FPR saves/restores are emitted. */
+/* { dg-final { scan-assembler-not "std" } } */
+/* { dg-final { scan-assembler-not "ld" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.target/s390/s390.exp b/gcc-4.9/gcc/testsuite/gcc.target/s390/s390.exp
index 1b6d94a..f2ba929 100644
--- a/gcc-4.9/gcc/testsuite/gcc.target/s390/s390.exp
+++ b/gcc-4.9/gcc/testsuite/gcc.target/s390/s390.exp
@@ -24,17 +24,17 @@ if ![istarget s390*-*-*] then {
# Load support procs.
load_lib gcc-dg.exp
-# Return 1 if htm (etnd - extract nesting depth) instructions can be
-# compiled.
+# Return 1 if htm (etnd - extract nesting depth) instructions are
+# understood by the assembler and can be executed.
proc check_effective_target_htm { } {
if { ![check_runtime s390_check_htm [subst {
int main (void)
{
- unsigned int nd = 77;
- asm (".insn rre,0xb2ec0000,%0,0" : "=d" (nd));
+ unsigned int nd;
+ asm ("etnd %0" : "=d" (nd));
return nd;
}
- }]] } { return 0 } else { return 1 }
+ }] "-march=zEC12 -mzarch" ] } { return 0 } else { return 1 }
}
# If a testcase doesn't have special options, use these.