]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
testsuite: Use sync_long_long instead of sync_int_long for atomic-29.c test
authorJakub Jelinek <jakub@redhat.com>
Tue, 14 Sep 2021 09:32:46 +0000 (11:32 +0200)
committerTobias Burnus <tobias@codesourcery.com>
Tue, 14 Sep 2021 09:32:46 +0000 (11:32 +0200)
As discussed, the test tests atomics on doubles which are 64-bit and so we
should use sync_long_long effective target instead of sync_int_long that
covers 64-bit atomics only on 64-bit arches.  I've added -march=pentium
to follow what is documented for sync_long_long, I guess -march=zarch should
be added for s390* too, but haven't tested that.

And using sync_long_long found a syntax error in that effective target
implementation, so I've fixed that too.

2021-09-14  Jakub Jelinek  <jakub@redhat.com>

* c-c++-common/gomp/atomic-29.c: Add -march=pentium
dg-additional-options for ia32.  Use sync_long_long effective target
instead of sync_int_long.
* lib/target-supports.exp (check_effective_target_sync_long_long): Fix
a syntax error.

(cherry picked from commit b29fc21482c0e203136eb5d44bdc1495de3918c6)

gcc/testsuite/ChangeLog.omp
gcc/testsuite/c-c++-common/gomp/atomic-29.c
gcc/testsuite/lib/target-supports.exp

index 78e5ef10408cb539f3b16c1986e490cbb3de8cef..24c41e7b0931faaa23cea6079894479954be7401 100644 (file)
@@ -1,3 +1,14 @@
+2021-09-14  Tobias Burnus  <tobias@codesourcery.com>
+
+       Backported from master:
+       2021-09-14  Jakub Jelinek  <jakub@redhat.com>
+
+       * c-c++-common/gomp/atomic-29.c: Add -march=pentium
+       dg-additional-options for ia32.  Use sync_long_long effective target
+       instead of sync_int_long.
+       * lib/target-supports.exp (check_effective_target_sync_long_long): Fix
+       a syntax error.
+
 2021-09-13  Tobias Burnus  <tobias@codesourcery.com>
 
        Backported from master:
index e574c48fd55494fcbc353828752100630d8ec1aa..97fe33b392753b12ddd0a35f65a5a2f0b3d073a8 100644 (file)
@@ -1,10 +1,11 @@
 /* { dg-do compile { target c } } */
 /* { dg-additional-options "-O2 -fdump-tree-ompexp" } */
-/* { dg-final { scan-tree-dump-times "\.ATOMIC_COMPARE_EXCHANGE \\\(\[^\n\r]*, 8, 5, 5\\\);" 1 "ompexp" { target sync_int_long } } } */
-/* { dg-final { scan-tree-dump-times "\.ATOMIC_COMPARE_EXCHANGE \\\(\[^\n\r]*, 8, 4, 2\\\);" 1 "ompexp" { target sync_int_long } } } */
-/* { dg-final { scan-tree-dump-times "\.ATOMIC_COMPARE_EXCHANGE \\\(\[^\n\r]*, 264, 5, 0\\\);" 1 "ompexp" { target sync_int_long } } } */
-/* { dg-final { scan-tree-dump-times "\.ATOMIC_COMPARE_EXCHANGE \\\(\[^\n\r]*, 8, 0, 0\\\);" 1 "ompexp" { target sync_int_long } } } */
-/* { dg-final { scan-tree-dump-not "__atomic_load_8 \\\(" "ompexp" { target sync_int_long } } } */
+/* { dg-additional-options "-march=pentium" { target ia32 } } */
+/* { dg-final { scan-tree-dump-times "\.ATOMIC_COMPARE_EXCHANGE \\\(\[^\n\r]*, 8, 5, 5\\\);" 1 "ompexp" { target sync_long_long } } } */
+/* { dg-final { scan-tree-dump-times "\.ATOMIC_COMPARE_EXCHANGE \\\(\[^\n\r]*, 8, 4, 2\\\);" 1 "ompexp" { target sync_long_long } } } */
+/* { dg-final { scan-tree-dump-times "\.ATOMIC_COMPARE_EXCHANGE \\\(\[^\n\r]*, 264, 5, 0\\\);" 1 "ompexp" { target sync_long_long } } } */
+/* { dg-final { scan-tree-dump-times "\.ATOMIC_COMPARE_EXCHANGE \\\(\[^\n\r]*, 8, 0, 0\\\);" 1 "ompexp" { target sync_long_long } } } */
+/* { dg-final { scan-tree-dump-not "__atomic_load_8 \\\(" "ompexp" { target sync_long_long } } } */
 
 double x;
 
index 45d34e1a58ef43d2391973e1bb00032e5b99bb59..723c8eadbd9d0eb6a2e417631860c89775e5b4e4 100644 (file)
@@ -7972,7 +7972,7 @@ proc check_effective_target_sync_int_128_runtime { } {
 # Note: 32bit s390 targets require -mzarch in dg-options.
 
 proc check_effective_target_sync_long_long { } {
-    if { [istarget i?86-*-*] || [istarget x86_64-*-*])
+    if { [istarget i?86-*-*] || [istarget x86_64-*-*]
         || [istarget aarch64*-*-*]
         || [istarget arm*-*-*]
         || [istarget alpha*-*-*]