aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarius Hillenbrand <mhillen@linux.ibm.com>2021-01-15 14:07:44 +0100
committerMarius Hillenbrand <mhillen@linux.ibm.com>2021-01-15 15:20:31 +0100
commitf9a577927eb08a413a1f48139e36850fa86628b3 (patch)
tree5a306c63e4fe9c5274c32c8ad68698e671d757e7
parent63999d751df9bcde4ab9107edb4c635d274b248d (diff)
downloadgcc-f9a577927eb08a413a1f48139e36850fa86628b3.zip
gcc-f9a577927eb08a413a1f48139e36850fa86628b3.tar.gz
gcc-f9a577927eb08a413a1f48139e36850fa86628b3.tar.bz2
IBM Z: Fix linking to libatomic in target test cases
One of the test cases failed to link because of missing paths to libatomic. Reuse procedures in lib/atomic-dg.exp to gather these paths. gcc/testsuite/ChangeLog: 2021-01-15 Marius Hillenbrand <mhillen@linux.ibm.com> * gcc.target/s390/s390.exp: Call lib atomic-dg.exp to link libatomic into testcases in gcc.target/s390/md. * gcc.target/s390/md/atomic_exchange-1.c: Remove no unnecessary -latomic.
-rw-r--r--gcc/testsuite/gcc.target/s390/md/atomic_exchange-1.c2
-rw-r--r--gcc/testsuite/gcc.target/s390/s390.exp4
2 files changed, 5 insertions, 1 deletions
diff --git a/gcc/testsuite/gcc.target/s390/md/atomic_exchange-1.c b/gcc/testsuite/gcc.target/s390/md/atomic_exchange-1.c
index f82b213..54e97d3 100644
--- a/gcc/testsuite/gcc.target/s390/md/atomic_exchange-1.c
+++ b/gcc/testsuite/gcc.target/s390/md/atomic_exchange-1.c
@@ -1,7 +1,7 @@
/* Machine description pattern tests. */
/* { dg-do compile } */
-/* { dg-options "-lpthread -latomic" } */
+/* { dg-options "-lpthread" } */
/* { dg-do run { target { s390_useable_hw } } } */
/**/
diff --git a/gcc/testsuite/gcc.target/s390/s390.exp b/gcc/testsuite/gcc.target/s390/s390.exp
index 57b2690..df46060 100644
--- a/gcc/testsuite/gcc.target/s390/s390.exp
+++ b/gcc/testsuite/gcc.target/s390/s390.exp
@@ -28,6 +28,7 @@ if ![istarget s390*-*-*] then {
load_lib gcc-dg.exp
load_lib target-supports.exp
load_lib gfortran-dg.exp
+load_lib atomic-dg.exp
# Return 1 if the the assembler understands .machine and .machinemode. The
# target attribute needs that feature to work.
@@ -250,6 +251,8 @@ dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/arch13/*.{c,S}]] \
dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/vxe/*.{c,S}]] \
"" "-O3 -march=arch12 -mzarch"
+# Some md tests require libatomic
+atomic_init
dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/md/*.{c,S}]] \
"" $DEFAULT_CFLAGS
@@ -294,4 +297,5 @@ foreach t [list $srcdir/$subdir/pr80080-3.c] {
}
# All done.
+atomic_finish
dg-finish