From: Andreas Tobler Date: Tue, 21 Jan 2020 21:16:02 +0000 (+0100) Subject: testsuite: Enable asan tests on FreeBSD x86_64 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=56017225eede47f94d0d81e3f1d0496d6b155963;p=gcc.git testsuite: Enable asan tests on FreeBSD x86_64 Enable asan tests on FreeBSD x86_64. 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 dbd464633f2..949b81a4392 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,16 @@ +2020-05-01 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-04-30 Peter Bergner PR rtl-optimization/94740 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 a151979946a..ca989a36bbd 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 -Wno-alloc-size-larger-than -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 -Wno-alloc-size-larger-than -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;