public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [committed] Don't run asan.exp tests if libsanitizer/ hasn't been built (PR testsuite/55587)
@ 2012-12-04 13:24 Jakub Jelinek
  0 siblings, 0 replies; only message in thread
From: Jakub Jelinek @ 2012-12-04 13:24 UTC (permalink / raw)
  To: gcc-patches

Hi!

asan.exp tests obviously require libsanitizer, but were only checking for
-fsanitize=address compiler support (plus looking for the libsanitizer
and if found, adding link options as needed).
This patch let's us skip all asan tests if the library isn't available.

Committed as obvious after testing on x86_64-linux with/without
libsanitizer.

2012-12-04  Jakub Jelinek  <jakub@redhat.com>

	PR testsuite/55587
	* lib/asan-dg.exp (asan_init): Return 1 if libasan has been found,
	0 if not.
	* g++.dg/asan/asan.exp: Don't run gcc-dg-runtest if [asan_init]
	returned 0.
	* gcc.dg/asan/asan.exp: Likewise.

--- gcc/testsuite/lib/asan-dg.exp.jj	2012-12-03 12:43:20.000000000 +0100
+++ gcc/testsuite/lib/asan-dg.exp	2012-12-04 12:41:46.184413648 +0100
@@ -91,6 +91,10 @@ proc asan_init { args } {
 	    set TEST_ALWAYS_FLAGS "$link_flags -fsanitize=address -g"
 	}
     }
+    if { $link_flags != "" } {
+	return 1
+    }
+    return 0
 }
 
 #
--- gcc/testsuite/g++.dg/asan/asan.exp.jj	2012-11-14 23:57:07.000000000 +0100
+++ gcc/testsuite/g++.dg/asan/asan.exp	2012-12-04 12:39:01.086372375 +0100
@@ -26,11 +26,13 @@ if ![check_effective_target_faddress_san
 
 # Initialize `dg'.
 dg-init
-asan_init
+if [asan_init] {
 
 # Main loop.
 gcc-dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.C $srcdir/c-c++-common/asan/*.c]] ""
 
+}
+
 # All done.
 asan_finish
 dg-finish
--- gcc/testsuite/gcc.dg/asan/asan.exp.jj	2012-11-14 23:57:07.000000000 +0100
+++ gcc/testsuite/gcc.dg/asan/asan.exp	2012-12-04 12:38:20.000000000 +0100
@@ -28,11 +28,13 @@ if ![check_effective_target_faddress_san
 
 # Initialize `dg'.
 dg-init
-asan_init
+if [asan_init] {
 
 # Main loop.
 gcc-dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.c $srcdir/c-c++-common/asan/*.c]] ""
 
+}
+
 # All done.
 asan_finish
 dg-finish

	Jakub

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2012-12-04 13:24 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-12-04 13:24 [committed] Don't run asan.exp tests if libsanitizer/ hasn't been built (PR testsuite/55587) Jakub Jelinek

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).