Patchwork [Revised] PR55679: skip invalid tests from r194458 on darwin

login
register
mail settings
Submitter Jack Howarth
Date Dec. 14, 2012, 3:13 p.m.
Message ID <20121214151347.GA6550@bromo.med.uc.edu>
Download mbox | patch
Permalink /patch/206515/
State New
Headers show

Comments

Jack Howarth - Dec. 14, 2012, 3:13 p.m.
The attached revised patch disables two asan tests introduced in r194458 which are invalid
on darwin. The g++.dg/asan/interception-test-1.C test should be dg-skip-if'd  on darwin since 
mac function interposition is used instead of interception. The c-c++-common/asan/swapcontext-test-1.c
test is invalid as ucontext support was deprecated in darwin10 and removed completely
in darwin11. The current implementation of check_effective_target_swapcontext in
lib/target-supports.exp doesn't catch the deprecation of ucontext support on darwin
because it doesn't try to parse the ucontext.h include file. The attached patch
changes the check_effective_target_swapcontext to use check_no_compiler_messages
with compilation of ucontext.h. Tested without regression on both x86_64-apple-darwin10
and x86_64-unknown-linux-gnu. Okay for gcc trunk?
         Jack
gcc/testsuite/

2012-12-14  Jack Howarth <howarth@bromo.med.uc.edu>

	PR sanitizer/55679
	* g++.dg/asan/interception-test-1.C: Skip on darwin.
	* lib/target-supports.exp (check_effective_target_swapcontext): Use
	check_no_compiler_messages to test support in ucontext.h.
Jakub Jelinek - Dec. 14, 2012, 3:20 p.m.
On Fri, Dec 14, 2012 at 10:13:47AM -0500, Jack Howarth wrote:
> 2012-12-14  Jack Howarth <howarth@bromo.med.uc.edu>
> 
> 	PR sanitizer/55679
> 	* g++.dg/asan/interception-test-1.C: Skip on darwin.
> 	* lib/target-supports.exp (check_effective_target_swapcontext): Use
> 	check_no_compiler_messages to test support in ucontext.h.

Ok with:

> --- gcc/testsuite/lib/target-supports.exp	(revision 194495)
> +++ gcc/testsuite/lib/target-supports.exp	(working copy)
> @@ -736,7 +736,14 @@ proc check_effective_target_setrlimit {}
>  
>  # Return 1 if the target supports swapcontext, 0 otherwise.
>  proc check_effective_target_swapcontext {} {
> -    return [check_function_available "swapcontext"]
> +    return [check_no_compiler_messages swapcontext object {

This should be executable instead of object.

	Jakub

Patch

Index: gcc/testsuite/g++.dg/asan/interception-test-1.C
===================================================================
--- gcc/testsuite/g++.dg/asan/interception-test-1.C	(revision 194483)
+++ gcc/testsuite/g++.dg/asan/interception-test-1.C	(working copy)
@@ -3,6 +3,7 @@ 
 // { dg-do run }
 // { dg-options "-fno-builtin-malloc -fno-builtin-free" }
 // { dg-shouldfail "asan" }
+// { dg-skip-if "Darwin uses mac function interposition" { *-*-darwin* } }
 
 #include <stdlib.h>
 #include <stdio.h>
Index: gcc/testsuite/lib/target-supports.exp
===================================================================
--- gcc/testsuite/lib/target-supports.exp	(revision 194495)
+++ gcc/testsuite/lib/target-supports.exp	(working copy)
@@ -736,7 +736,14 @@  proc check_effective_target_setrlimit {}
 
 # Return 1 if the target supports swapcontext, 0 otherwise.
 proc check_effective_target_swapcontext {} {
-    return [check_function_available "swapcontext"]
+    return [check_no_compiler_messages swapcontext object {
+	#include <ucontext.h>
+	int main (void)
+	{
+	  ucontext_t orig_context,child_context;
+	  if (swapcontext(&child_context, &orig_context) < 0) { }
+	}
+    }]
 }
 
 # Return 1 if compilation with -pthread is error-free for trivial