re PR sanitizer/55679 (new asan tests from r194458 fail on x86_64-apple-darwin10)
authorJack Howarth <howarth@bromo.med.uc.edu>
Thu, 17 Jan 2013 21:28:56 +0000 (21:28 +0000)
committerMike Stump <mrs@gcc.gnu.org>
Thu, 17 Jan 2013 21:28:56 +0000 (21:28 +0000)
        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.
(check_effective_target_setrlimit): Return 0 for Darwin's non-posix
compliant RLIMIT_AS.

From-SVN: r195281

gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/asan/interception-test-1.C
gcc/testsuite/lib/target-supports.exp

index 1bd5ca36ded8a17ad1e755ba7b90a97f07cc4c64..21d0f05910a419e0cac0887b7f2d7a1620dbc30c 100644 (file)
@@ -1,3 +1,12 @@
+2013-01-17  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.
+       (check_effective_target_setrlimit): Return 0 for Darwin's non-posix
+       compliant RLIMIT_AS.
+
 2013-01-17  Marek Polacek  <polacek@redhat.com>
 
        PR rtl-optimization/55833
index f12f3b61e82efd058452e01296f99decbc29fa02..04c846a70a0f5d1d23ce1852077b76b863bd40f4 100644 (file)
@@ -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 abc90384d5fd8e8f36e41fb114e958f14850f3e1..0b11817ff61b463a4379b01598879b99cb985060 100644 (file)
@@ -730,12 +730,23 @@ proc check_effective_target_clone {} {
 
 # Return 1 if the target supports setrlimit, 0 otherwise.
 proc check_effective_target_setrlimit {} {
+    # Darwin has non-posix compliant RLIMIT_AS
+    if { [istarget *-*-darwin*] } {
+        return 0
+    }
     return [check_function_available "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 executable {
+       #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