On Mon, Dec 7, 2015 at 3:09 PM, Jakub Jelinek <ja...@redhat.com> wrote:
> On Sun, Dec 06, 2015 at 09:56:32AM +0100, Dmitry Vyukov wrote:
>
>> --- gcc.dg/sancov/sancov.exp (revision 231328)
>> +++ gcc.dg/sancov/sancov.exp (working copy)
>> @@ -18,6 +18,7 @@
>>
>>  load_lib gcc-dg.exp
>>  load_lib torture-options.exp
>> +load_lib asan-dg.exp
>>
>>  dg-init
>>  torture-init
>> @@ -31,7 +32,11 @@
>>   { -O2 -g } \
>>   { -O3 -g } ]
>>
>> -gcc-dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.c]] "" ""
>> +gcc-dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/basic*.c]] "" ""
>>
>> +if [check_effective_target_fsanitize_address] {
>> +  gcc-dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/asan*.c]] "" ""
>> +}
>> +
>
> I don't like this, it is bad enough vect.exp works this way, let's not add
> further tests depending on test names.
> So, either just load_lib asan-dg.exp and change
> /* { dg-do compile } */
> to
> /* { dg-do compile { target fsanitize_address } } */
> or avoid the load_lib and add check_effective_target_fsanitize_address
> variant that checks compilation with -fsanitize=address of trivial program
> instead of linking, put it into lib/target-supports.exp and use it
> in dg-do ompile.


Did the first option. Please take another look:


Index: ChangeLog
===================================================================
--- ChangeLog (revision 231362)
+++ ChangeLog (working copy)
@@ -1,3 +1,7 @@
+2015-12-06  Dmitry Vyukov  <dvyu...@google.com>
+
+ * gcc.dg/sancov/asan.c: Don't run when asan is not available.
+
 2015-12-07  Nathan Sidwell  <nat...@acm.org>

  * gcc.target/nvptx/decl-init.c: New.
Index: gcc.dg/sancov/asan.c
===================================================================
--- gcc.dg/sancov/asan.c (revision 231362)
+++ gcc.dg/sancov/asan.c (working copy)
@@ -3,7 +3,7 @@
      - coverage does not instrument asan-emitted basic blocks
      - asan considers coverage callback as "nonfreeing" (thus 1 asan store
        callback.  */
-/* { dg-do compile } */
+/* { dg-do compile { target fsanitize_address } } */
 /* { dg-options "-fsanitize-coverage=trace-pc -fsanitize=address
-fdump-tree-optimized" } */

 void foo(volatile int *a, int *b)
Index: gcc.dg/sancov/sancov.exp
===================================================================
--- gcc.dg/sancov/sancov.exp (revision 231362)
+++ gcc.dg/sancov/sancov.exp (working copy)
@@ -17,6 +17,7 @@
 # <http://www.gnu.org/licenses/>.

 load_lib gcc-dg.exp
+load_lib asan-dg.exp
 load_lib torture-options.exp

 dg-init
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 231362)
+++ ChangeLog	(working copy)
@@ -1,3 +1,7 @@
+2015-12-06  Dmitry Vyukov  <dvyu...@google.com>
+
+	* gcc.dg/sancov/asan.c: Don't run when asan is not available.
+
 2015-12-07  Nathan Sidwell  <nat...@acm.org>
 
 	* gcc.target/nvptx/decl-init.c: New.
Index: gcc.dg/sancov/asan.c
===================================================================
--- gcc.dg/sancov/asan.c	(revision 231362)
+++ gcc.dg/sancov/asan.c	(working copy)
@@ -3,7 +3,7 @@
      - coverage does not instrument asan-emitted basic blocks
      - asan considers coverage callback as "nonfreeing" (thus 1 asan store
        callback.  */
-/* { dg-do compile } */
+/* { dg-do compile { target fsanitize_address } } */
 /* { dg-options "-fsanitize-coverage=trace-pc -fsanitize=address -fdump-tree-optimized" } */
 
 void foo(volatile int *a, int *b)
Index: gcc.dg/sancov/sancov.exp
===================================================================
--- gcc.dg/sancov/sancov.exp	(revision 231362)
+++ gcc.dg/sancov/sancov.exp	(working copy)
@@ -17,6 +17,7 @@
 # <http://www.gnu.org/licenses/>.
 
 load_lib gcc-dg.exp
+load_lib asan-dg.exp
 load_lib torture-options.exp
 
 dg-init

Reply via email to