diff options
Diffstat (limited to 'gcc/testsuite')
-rw-r--r-- | gcc/testsuite/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/s390/htm-1.c | 37 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/s390/htm-nofloat-1.c | 12 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/s390/htm-xl-intrin-1.c | 37 |
4 files changed, 92 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index edd60acb40e..f6ab2ba0468 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2013-06-27 Andreas Krebbel <Andreas.Krebbel@de.ibm.com> + + * gcc.target/s390/htm-1.c: New file. + * gcc.target/s390/htm-nofloat-1.c: New file. + * gcc.target/s390/htm-xl-intrin-1.c: New file. + 2013-06-26 Tobias Burnus <burnus@net-b.de> PR fortran/29800 diff --git a/gcc/testsuite/gcc.target/s390/htm-1.c b/gcc/testsuite/gcc.target/s390/htm-1.c new file mode 100644 index 00000000000..e6321de071e --- /dev/null +++ b/gcc/testsuite/gcc.target/s390/htm-1.c @@ -0,0 +1,37 @@ +/* This checks the availability of the low-level builtins introduced + for transactional execution. */ + +/* { dg-do compile } */ +/* { dg-options "-O3 -march=zEC12 -mzarch" } */ + +#include <stdint.h> +#include <htmintrin.h> + +int a = 0; +uint64_t g; + +int +foo (struct __htm_tdb* tdb) +{ + + int cc; + int n; + + cc = __builtin_tbegin (0); + cc = __builtin_tbegin (tdb); + cc = __builtin_tbegin_nofloat (0); + cc = __builtin_tbegin_nofloat (tdb); + cc = __builtin_tbegin_retry (0, 42); + cc = __builtin_tbegin_retry (tdb, 42); + cc = __builtin_tbegin_retry_nofloat (0, 42); + cc = __builtin_tbegin_retry_nofloat (tdb, 42); + __builtin_tbeginc (); + n = __builtin_tx_nesting_depth(); + __builtin_non_tx_store(&g, n); + __builtin_tabort (42 + 255); + __builtin_tend(); + __builtin_tx_assist (23); +} +/* Make sure the tdb NULL argument ends up as immediate value in the + instruction. */ +/* { dg-final { scan-assembler-times "tbegin\t0," 4 } } */ diff --git a/gcc/testsuite/gcc.target/s390/htm-nofloat-1.c b/gcc/testsuite/gcc.target/s390/htm-nofloat-1.c new file mode 100644 index 00000000000..df7e2bac874 --- /dev/null +++ b/gcc/testsuite/gcc.target/s390/htm-nofloat-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/testsuite/gcc.target/s390/htm-xl-intrin-1.c b/gcc/testsuite/gcc.target/s390/htm-xl-intrin-1.c new file mode 100644 index 00000000000..77ceeb7706f --- /dev/null +++ b/gcc/testsuite/gcc.target/s390/htm-xl-intrin-1.c @@ -0,0 +1,37 @@ +/* This checks the availability of the XL compiler intrinsics for + transactional execution with the expected prototypes. */ + +/* { dg-do compile } */ +/* { dg-options "-O3 -march=zEC12 -mzarch" } */ + +#include <htmxlintrin.h> + +int a = 0; +unsigned long g; + +int +foo () +{ + struct __htm_tdb *tdb_struct; + void * const tdb = tdb_struct; + long result; + unsigned char code; + + result = __TM_simple_begin (); + result = __TM_begin (tdb); + result = __TM_end (); + __TM_abort (); + __TM_named_abort (42); + __TM_non_transactional_store (&g, 42); + result = __TM_nesting_depth (tdb); + + result = __TM_is_user_abort (tdb); + result = __TM_is_named_user_abort (tdb, &code); + result = __TM_is_illegal (tdb); + result = __TM_is_footprint_exceeded (tdb); + result = __TM_is_nested_too_deep (tdb); + result = __TM_is_conflict (tdb); + result = __TM_is_failure_persistent (result); + result = __TM_failure_address (tdb); + result = __TM_failure_code (tdb); +} |