From patchwork Thu Jan 17 20:39:58 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [Revisedx3] PR55679: skip invalid tests from r194458 on darwin X-Patchwork-Submitter: Jack Howarth X-Patchwork-Id: 213360 Message-Id: <20130117203958.GA16710@bromo.med.uc.edu> To: gcc-patches@gcc.gnu.org Cc: dodji@redhat.com, konstantin.s.serebryany@gmail.com, mikestump@comcast.net, iain@codesourcery.com, glider@google.com, jakub@redhat.com Date: Thu, 17 Jan 2013 15:39:58 -0500 From: Jack Howarth List-Id: The attached revised patch disables three 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. The check_effective_target_setrlimit proc is also modified to return 0 on darwin due to the non-posix compliant RLIMIT_AS on that target. Tested without regression on both x86_64-apple-darwin10 and x86_64-unknown-linux-gnu. Okay for gcc trunk? Jack ps This patch leaves the failures in c-c++-common/asan/global-overflow-1.c and c-c++-common/asan/stack-overflow-1.c as the only unresolved parts of PR55679 on darwin. gcc/testsuite/ 2013-01-17 Jack Howarth 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. Index: gcc/testsuite/lib/target-supports.exp =================================================================== --- gcc/testsuite/lib/target-supports.exp (revision 195280) +++ gcc/testsuite/lib/target-supports.exp (working copy) @@ -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 + 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 Index: gcc/testsuite/g++.dg/asan/interception-test-1.C =================================================================== --- gcc/testsuite/g++.dg/asan/interception-test-1.C (revision 195280) +++ 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 #include