[committed] testsuite: Use sync_long_long instead of sync_int_long for atomic-29.c test

Message ID 20210914084229.GT304296@tucnak
State New
Headers show
Series
  • [committed] testsuite: Use sync_long_long instead of sync_int_long for atomic-29.c test
Related show

Commit Message

Martin Sebor via Gcc-patches Sept. 14, 2021, 8:42 a.m.
Hi!

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.

Regtested on x86_64-linux and i686-linux, committed to trunk.

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.


	Jakub

Patch

--- gcc/testsuite/c-c++-common/gomp/atomic-29.c.jj	2021-09-11 09:33:37.897331795 +0200
+++ gcc/testsuite/c-c++-common/gomp/atomic-29.c	2021-09-13 16:52:39.212099370 +0200
@@ -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;
 
--- gcc/testsuite/lib/target-supports.exp.jj	2021-09-08 11:23:44.380036173 +0200
+++ gcc/testsuite/lib/target-supports.exp	2021-09-14 09:56:11.240510238 +0200
@@ -8074,7 +8074,7 @@  proc check_effective_target_sync_int_128
 # 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*-*-*]