public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@redhat.com>
To: Hongtao Liu <crazylht@gmail.com>
Cc: "Hu, Lin1" <lin1.hu@intel.com>,
	gcc-patches@gcc.gnu.org, hongtao.liu@intel.com,
	ubizjak@gmail.com
Subject: [committed] testsuite: Fix up pr84508* tests [PR84508]
Date: Thu, 9 May 2024 21:04:01 +0200	[thread overview]
Message-ID: <Zj0eIcO/zXNoGbih@tucnak> (raw)
In-Reply-To: <CAMZc-bxcmH3ABd5isFk08zRGyc7jT-7+oF2N+c71rjkELg1MtQ@mail.gmail.com>

On Thu, May 09, 2024 at 12:45:42PM +0800, Hongtao Liu wrote:
> >         PR target/84508
> >         * gcc.target/i386/pr84508-1.c: New test.
> >         * gcc.target/i386/pr84508-2.c: Ditto.

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.

Tested on x86_64-linux with
make check-gcc RUNTESTFLAGS='--target_board=unix\{-m32,-m64\} i386.exp=pr84508* ubsan.exp=pr84508*'
and committed to trunk as obvious.

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.

diff --git a/gcc/testsuite/gcc.target/i386/pr84508-1.c b/gcc/testsuite/gcc.dg/ubsan/pr84508-1.c
similarity index 74%
rename from gcc/testsuite/gcc.target/i386/pr84508-1.c
rename to gcc/testsuite/gcc.dg/ubsan/pr84508-1.c
index bb3e28d017e..d78dddd1e01 100644
--- a/gcc/testsuite/gcc.target/i386/pr84508-1.c
+++ b/gcc/testsuite/gcc.dg/ubsan/pr84508-1.c
@@ -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()
diff --git a/gcc/testsuite/gcc.target/i386/pr84508-2.c b/gcc/testsuite/gcc.dg/ubsan/pr84508-2.c
similarity index 73%
rename from gcc/testsuite/gcc.target/i386/pr84508-2.c
rename to gcc/testsuite/gcc.dg/ubsan/pr84508-2.c
index 32a8f20a536..cf9c7db1d15 100644
--- a/gcc/testsuite/gcc.target/i386/pr84508-2.c
+++ b/gcc/testsuite/gcc.dg/ubsan/pr84508-2.c
@@ -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()

	Jakub


  reply	other threads:[~2024-05-09 19:04 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-08  2:12 [PATCH] i386: Fix some intrinsics without alignment requirements Hu, Lin1
2024-05-09  4:45 ` Hongtao Liu
2024-05-09 19:04   ` Jakub Jelinek [this message]
2024-05-10  1:24     ` [committed] testsuite: Fix up pr84508* tests [PR84508] Hu, Lin1

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Zj0eIcO/zXNoGbih@tucnak \
    --to=jakub@redhat.com \
    --cc=crazylht@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=hongtao.liu@intel.com \
    --cc=lin1.hu@intel.com \
    --cc=ubizjak@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).