]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
testsuite: Fix up pr84508* tests [PR84508]
authorJakub Jelinek <jakub@redhat.com>
Thu, 9 May 2024 18:59:05 +0000 (20:59 +0200)
committerJakub Jelinek <jakub@redhat.com>
Thu, 9 May 2024 18:59:05 +0000 (20:59 +0200)
The tests FAIL on x86_64-linux with
/usr/bin/ld: cannot find -lubsan
collect2: error: ld returned 1 exit status
compiler exited with status 1
FAIL: gcc.target/i386/pr84508-1.c (test for excess errors)
Excess errors:
/usr/bin/ld: cannot find -lubsan

The problem is that only *.dg/ubsan/ubsan.exp calls ubsan_init
which adds the needed search paths to libubsan library.
So, link/run tests for -fsanitize=undefined need to go into
gcc.dg/ubsan/ or g++.dg/ubsan/, even when they are target specific.

2024-05-09  Jakub Jelinek  <jakub@redhat.com>

PR target/84508
* gcc.target/i386/pr84508-1.c: Move to ...
* gcc.dg/ubsan/pr84508-1.c: ... here.  Restrict to i?86/x86_64
non-ia32 targets.
* gcc.target/i386/pr84508-2.c: Move to ...
* gcc.dg/ubsan/pr84508-2.c: ... here.  Restrict to i?86/x86_64
non-ia32 targets.

gcc/testsuite/gcc.dg/ubsan/pr84508-1.c [moved from gcc/testsuite/gcc.target/i386/pr84508-1.c with 74% similarity]
gcc/testsuite/gcc.dg/ubsan/pr84508-2.c [moved from gcc/testsuite/gcc.target/i386/pr84508-2.c with 73% similarity]

similarity index 74%
rename from gcc/testsuite/gcc.target/i386/pr84508-1.c
rename to gcc/testsuite/gcc.dg/ubsan/pr84508-1.c
index bb3e28d017e99aa0ec1a42a9ed1ac0ba690db581..d78dddd1e01cafd4e2f933b9b79786cc3ef7028e 100644 (file)
@@ -1,5 +1,6 @@
-/* { dg-do run { target { ! ia32 } } } */
+/* { dg-do run { target { { i?86-*-* x86_64-*-* } && { ! ia32 } } } } */
 /* { dg-options "-fsanitize=undefined" } */
+
 #include <emmintrin.h>
 
 int main()
similarity index 73%
rename from gcc/testsuite/gcc.target/i386/pr84508-2.c
rename to gcc/testsuite/gcc.dg/ubsan/pr84508-2.c
index 32a8f20a53646f5a6b9625111db3850254e9bfae..cf9c7db1d1594eddbb32aea0a22ff11b99b86b2b 100644 (file)
@@ -1,5 +1,6 @@
-/* { dg-do run { target { ! ia32 } } } */
+/* { dg-do run { target { { i?86-*-* x86_64-*-* } && { ! ia32 } } } } */
 /* { dg-options "-fsanitize=undefined" } */
+
 #include <emmintrin.h>
 
 int main()