From patchwork Wed Jan 22 21:30:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Tobler X-Patchwork-Id: 1227436 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-518077-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=fgznet.ch Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha1 header.s=default header.b=OfIA4kmA; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 482z8m4jGcz9s1x for ; Thu, 23 Jan 2020 08:30:31 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to :from:subject:message-id:date:mime-version:content-type; q=dns; s=default; b=Ed20B3yCLN6jep46asCllczbqZBL54VqOV6S14VqvW2hwzL9Jh C2HsV1GvxWHA6npbtCLj23cC1t5HzAdUl2zoE63QMP5TgQz9+Uxk3/R0IqAhe+qK z+E49zXCKnqif3h1FTtLOohsseRlp0kR15W3T4q+Ir3Zvr9le4v89aQMc= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to :from:subject:message-id:date:mime-version:content-type; s= default; bh=x1QnGr8DcBsiFMDRMm0y4ij3s34=; b=OfIA4kmAHt9/7oY9kMcI LBjOsH8NPwOhfpv7Q6yzKZwPZ9AP0yKBv8VJvl8iCd+vSsaBqmANeakW0kJLUqrT HcMl/GM5f2XeNj58X97FPJS6wIyQFBEW6Xx3srfHN7tvNDXW3sptMIFDoPcjoDwp bs3J0U+vgydSQyk8fJ30a4M= Received: (qmail 24204 invoked by alias); 22 Jan 2020 21:30:23 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 24167 invoked by uid 89); 22 Jan 2020 21:30:20 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-14.3 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_NUMSUBJECT, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: smtp.fgznet.ch Received: from smtp.fgznet.ch (HELO smtp.fgznet.ch) (157.161.14.52) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 22 Jan 2020 21:30:17 +0000 Received: from [192.168.225.14] (dhclient-91-190-10-49.flashcable.ch [91.190.10.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by fgznet.ch (Postfix) with ESMTPSA id 9DE57C12F1 for ; Wed, 22 Jan 2020 22:30:14 +0100 (CET) To: GCC Patches From: Andreas Tobler Subject: [PATCH] testsuite: Enable asan tests on FreeBSD x86_64 Message-ID: <7ff44353-67bd-f9a7-adae-f5e1ae055c94@fgznet.ch> Date: Wed, 22 Jan 2020 22:30:14 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:68.0) Gecko/20100101 Thunderbird/68.3.0 MIME-Version: 1.0 X-IsSubscribed: yes Hi all, and here the tests which should succeed now. Ok for trunk (as usual if open...) TIA, Andreas testsuite: * gcc.dg/asan/pr87930.c: Enable on x86_64 FreeBSD. * c-c++-common/asan/asan-interface-1.c: Likewise. * c-c++-common/asan/clone-test-1.c: Likewise. * c-c++-common/asan/no-asan-stack.c: Likewise. * c-c++-common/asan/pr59063-1.c: Likewise. * c-c++-common/asan/pr59063-2.c: Likewise. * g++.dg/asan/asan_test.C: Likewise. * g++.dg/asan/asan_test_utils.h: Likewise. * g++.dg/asan/interception-failure-test-1.C: Likewise. * g++.dg/asan/interception-malloc-test-1.C: Likewise diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 70d7e8869e1..7e3534f84de 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,16 @@ +2020-01-22 Andreas Tobler + + * gcc.dg/asan/pr87930.c: Enable on x86_64 FreeBSD. + * c-c++-common/asan/asan-interface-1.c: Likewise. + * c-c++-common/asan/clone-test-1.c: Likewise. + * c-c++-common/asan/no-asan-stack.c: Likewise. + * c-c++-common/asan/pr59063-1.c: Likewise. + * c-c++-common/asan/pr59063-2.c: Likewise. + * g++.dg/asan/asan_test.C: Likewise. + * g++.dg/asan/asan_test_utils.h: Likewise. + * g++.dg/asan/interception-failure-test-1.C: Likewise. + * g++.dg/asan/interception-malloc-test-1.C: Likewise. + 2020-01-22 Marek Polacek PR c++/93324 - ICE with -Wall on constexpr if. diff --git a/gcc/testsuite/c-c++-common/asan/asan-interface-1.c b/gcc/testsuite/c-c++-common/asan/asan-interface-1.c index 33ed1b0e845..2bf1fae857f 100644 --- a/gcc/testsuite/c-c++-common/asan/asan-interface-1.c +++ b/gcc/testsuite/c-c++-common/asan/asan-interface-1.c @@ -1,6 +1,6 @@ /* Check that interface headers work. */ -/* { dg-do run { target { *-*-linux* } } } */ +/* { dg-do run { target { *-*-linux* *-*-freebsd* } } } */ #include diff --git a/gcc/testsuite/c-c++-common/asan/clone-test-1.c b/gcc/testsuite/c-c++-common/asan/clone-test-1.c index c58c376f5df..b95ec32f9ef 100644 --- a/gcc/testsuite/c-c++-common/asan/clone-test-1.c +++ b/gcc/testsuite/c-c++-common/asan/clone-test-1.c @@ -1,7 +1,7 @@ /* Regression test for: http://code.google.com/p/address-sanitizer/issues/detail?id=37 */ -/* { dg-do run { target { *-*-linux* } } } */ +/* { dg-do run { target { *-*-linux* x86_64-*-freebsd* } } } */ /* { dg-require-effective-target clone } */ /* { dg-require-effective-target hw } */ /* { dg-options "-D_GNU_SOURCE" } */ diff --git a/gcc/testsuite/c-c++-common/asan/no-asan-stack.c b/gcc/testsuite/c-c++-common/asan/no-asan-stack.c index 59ae55b0b00..9d1d37cb6c4 100644 --- a/gcc/testsuite/c-c++-common/asan/no-asan-stack.c +++ b/gcc/testsuite/c-c++-common/asan/no-asan-stack.c @@ -1,4 +1,4 @@ -/* { dg-do compile { target { { i?86-*-linux* x86_64-*-linux* } && lp64 } } } */ +/* { dg-do compile { target { { i?86-*-linux* x86_64-*-linux* x86_64-*-freebsd* } && lp64 } } } */ /* { dg-options "--param asan-stack=0" } */ #include diff --git a/gcc/testsuite/c-c++-common/asan/pr59063-1.c b/gcc/testsuite/c-c++-common/asan/pr59063-1.c index a22db6a0d82..1cc7f6f9428 100644 --- a/gcc/testsuite/c-c++-common/asan/pr59063-1.c +++ b/gcc/testsuite/c-c++-common/asan/pr59063-1.c @@ -1,4 +1,4 @@ -/* { dg-do run { target { *-*-linux* } } } */ +/* { dg-do run { target { *-*-linux* *-*-freebsd* } } } */ #include static int weak_gettime (clockid_t clk_id, struct timespec *tp) diff --git a/gcc/testsuite/c-c++-common/asan/pr59063-2.c b/gcc/testsuite/c-c++-common/asan/pr59063-2.c index 759b7f24d09..63a547f033f 100644 --- a/gcc/testsuite/c-c++-common/asan/pr59063-2.c +++ b/gcc/testsuite/c-c++-common/asan/pr59063-2.c @@ -1,4 +1,4 @@ -/* { dg-do run { target { *-*-linux* } } } */ +/* { dg-do run { target { *-*-linux* *-*-freebsd* } } } */ /* { dg-options "-static-libasan" } */ #include diff --git a/gcc/testsuite/g++.dg/asan/asan_test.C b/gcc/testsuite/g++.dg/asan/asan_test.C index f3f7626ef3b..6db37411caf 100644 --- a/gcc/testsuite/g++.dg/asan/asan_test.C +++ b/gcc/testsuite/g++.dg/asan/asan_test.C @@ -1,12 +1,13 @@ -// { dg-do run { target { { *-*-linux* } && { { ! { i?86-*-linux* x86_64-*-linux* } } || sse2_runtime } } } } +// { dg-do run { target { { *-*-linux* i?86-*-freebsd* x86_64-*-freebsd* } && { { ! { i?86-*-linux* x86_64-*-linux* i?86-*-freebsd* x86_64-*-freebsd* } } || sse2_runtime } } } } // { dg-skip-if "" { *-*-* } { "*" } { "-O2" } } // { dg-skip-if "" { *-*-* } { "-flto" } { "" } } // { dg-additional-sources "asan_globals_test-wrapper.cc" } -// { dg-options "-std=c++11 -fsanitize=address -fno-builtin -Wall -Werror -g -DASAN_UAR=0 -DASAN_HAS_EXCEPTIONS=1 -DASAN_HAS_BLACKLIST=0 -DSANITIZER_USE_DEJAGNU_GTEST=1 -lasan -lpthread -ldl" } +// { dg-options "-std=c++11 -fsanitize=address -fno-builtin -Wall -Werror -g -DASAN_UAR=0 -DASAN_HAS_EXCEPTIONS=1 -DASAN_HAS_BLACKLIST=0 -DSANITIZER_USE_DEJAGNU_GTEST=1 -lasan -lpthread" } +// { dg-additional-options "-ldl" { target { ! *-*-freebsd* } } } // { dg-additional-options "-DASAN_NEEDS_SEGV=1" { target { ! arm*-*-* } } } // { dg-additional-options "-DASAN_LOW_MEMORY=1 -DASAN_NEEDS_SEGV=0" { target arm*-*-* } } // { dg-additional-options "-DASAN_AVOID_EXPENSIVE_TESTS=1" { target { ! run_expensive_tests } } } -// { dg-additional-options "-msse2" { target { i?86-*-linux* x86_64-*-linux* } } } +// { dg-additional-options "-msse2" { target { i?86-*-linux* x86_64-*-linux* i?86-*-freebsd* x86_64-*-freebsd*} } } // { dg-additional-options "-D__NO_INLINE__" { target { *-*-linux-gnu } } } // { dg-set-target-env-var ASAN_OPTIONS "handle_segv=2" } // { dg-final { asan-gtest } } diff --git a/gcc/testsuite/g++.dg/asan/asan_test_utils.h b/gcc/testsuite/g++.dg/asan/asan_test_utils.h index f5281a6a9e3..ecde254166d 100644 --- a/gcc/testsuite/g++.dg/asan/asan_test_utils.h +++ b/gcc/testsuite/g++.dg/asan/asan_test_utils.h @@ -40,6 +40,9 @@ # include # include # include +#endif + +#if defined(__linux__) || defined(__FreeBSD__) #include #endif diff --git a/gcc/testsuite/g++.dg/asan/interception-failure-test-1.C b/gcc/testsuite/g++.dg/asan/interception-failure-test-1.C index d326e56cf93..8802870f70c 100644 --- a/gcc/testsuite/g++.dg/asan/interception-failure-test-1.C +++ b/gcc/testsuite/g++.dg/asan/interception-failure-test-1.C @@ -3,7 +3,7 @@ // { dg-do run } // { dg-options "-fno-builtin-malloc -fno-builtin-free" } -// { dg-additional-options "-D__NO_INLINE__" { target { *-*-linux-gnu } } } +// { dg-additional-options "-D__NO_INLINE__" { target { *-*-linux-gnu *-*-freebsd* } } } #include #include diff --git a/gcc/testsuite/g++.dg/asan/interception-malloc-test-1.C b/gcc/testsuite/g++.dg/asan/interception-malloc-test-1.C index e64c184a48a..0798c39c50d 100644 --- a/gcc/testsuite/g++.dg/asan/interception-malloc-test-1.C +++ b/gcc/testsuite/g++.dg/asan/interception-malloc-test-1.C @@ -1,8 +1,8 @@ // ASan interceptor can be accessed with __interceptor_ prefix. -// { dg-do run { target *-*-linux* } } +// { dg-do run { target *-*-linux* *-*-freebsd* } } // { dg-options "-fno-builtin-free" } -// { dg-additional-options "-D__NO_INLINE__" { target { *-*-linux-gnu } } } +// { dg-additional-options "-D__NO_INLINE__" { target { *-*-linux-gnu *-*-freebsd* } } } // { dg-shouldfail "asan" } #include diff --git a/gcc/testsuite/g++.dg/asan/interception-test-1.C b/gcc/testsuite/g++.dg/asan/interception-test-1.C index 79248e06df6..69fa5a3e33f 100644 --- a/gcc/testsuite/g++.dg/asan/interception-test-1.C +++ b/gcc/testsuite/g++.dg/asan/interception-test-1.C @@ -2,7 +2,7 @@ // { dg-do run } // { dg-options "-fno-builtin-malloc -fno-builtin-free" } -// { dg-additional-options "-D__NO_INLINE__" { target { *-*-linux-gnu } } } +// { dg-additional-options "-D__NO_INLINE__" { target { *-*-linux-gnu *-*-freebsd* } } } // { dg-shouldfail "asan" } // { dg-skip-if "Darwin uses mac function interposition" { *-*-darwin* } } diff --git a/gcc/testsuite/gcc.dg/asan/pr87930.c b/gcc/testsuite/gcc.dg/asan/pr87930.c index 5a65d3fb030..caf9208e1b0 100644 --- a/gcc/testsuite/gcc.dg/asan/pr87930.c +++ b/gcc/testsuite/gcc.dg/asan/pr87930.c @@ -1,4 +1,4 @@ -/* { dg-do compile { target { { i?86-*-linux* i?86-*-gnu* x86_64-*-linux* } && lp64 } } } */ +/* { dg-do compile { target { { i?86-*-linux* i?86-*-gnu* x86_64-*-linux* x86_64-*-freebsd* } && lp64 } } } */ /* { dg-options "-fsanitize=address -mabi=ms" } */ int i;