]> git.ipfire.org Git - thirdparty/gcc.git/commit
testsuite: LoongArch: Enable 16B atomic tests if the test machine supports LSX and SCQ
authorXi Ruoyao <xry111@xry111.site>
Tue, 19 Aug 2025 03:01:56 +0000 (11:01 +0800)
committerXi Ruoyao <xry111@xry111.site>
Thu, 11 Sep 2025 10:49:36 +0000 (18:49 +0800)
commit4bed08beba397d53ccd7784efe507b5eb74b3803
tree65abd4012fee26eb837d19ed4392dcb6af668ae1
parent4fcb26a35785c67f35ecceb34632dbf5456d240f
testsuite: LoongArch: Enable 16B atomic tests if the test machine supports LSX and SCQ

Enable those tests so we won't make too stupid mistakes in 16B atomic
implementation anymore.

All these test passed on a Loongson 3C6000/S except
atomic-other-int128.c.  With GDB patched to support sc.q
(https://sourceware.org/pipermail/gdb-patches/2025-August/220034.html)
this test also XPASS.

gcc/testsuite/ChangeLog:

* lib/target-supports.exp
(check_effective_target_loongarch_scq_hw): New.
(check_effective_target_sync_int_128_runtime): Return 1 on
loongarch64-*-* if hardware supports both LSX and SCQ.
* gcc.dg/atomic-compare-exchange-5.c: Pass -mlsx -mscq for
loongarch64-*-*.
* gcc.dg/atomic-exchange-5.c: Likewise.
* gcc.dg/atomic-load-5.c: Likewise.
* gcc.dg/atomic-op-5.c: Likewise.
* gcc.dg/atomic-store-5.c: Likewise.
* gcc.dg/atomic-store-6.c: Likewise.
* gcc.dg/simulate-thread/atomic-load-int128.c: Likewise.
* gcc.dg/simulate-thread/atomic-other-int128.c: Likewise.
(dg-final): xfail on loongarch64-*-* because  gdb does not
handle sc.q properly yet.
gcc/testsuite/gcc.dg/atomic-compare-exchange-5.c
gcc/testsuite/gcc.dg/atomic-exchange-5.c
gcc/testsuite/gcc.dg/atomic-load-5.c
gcc/testsuite/gcc.dg/atomic-op-5.c
gcc/testsuite/gcc.dg/atomic-store-5.c
gcc/testsuite/gcc.dg/atomic-store-6.c
gcc/testsuite/gcc.dg/simulate-thread/atomic-load-int128.c
gcc/testsuite/gcc.dg/simulate-thread/atomic-other-int128.c
gcc/testsuite/lib/target-supports.exp