Index: c-c++-common/asan/asan-interface-1.c =================================================================== --- c-c++-common/asan/asan-interface-1.c (revision 231047) +++ c-c++-common/asan/asan-interface-1.c (working copy) @@ -1,6 +1,6 @@ /* Check that interface headers work. */ -/* { dg-do run { target { *-*-linux* } } } */ +/* { dg-do run { target { *-*-linux* *-*-freebsd* } } } */ #include Index: c-c++-common/asan/no-asan-stack.c =================================================================== --- c-c++-common/asan/no-asan-stack.c (revision 231047) +++ c-c++-common/asan/no-asan-stack.c (working copy) @@ -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 Index: c-c++-common/asan/pr59063-1.c =================================================================== --- c-c++-common/asan/pr59063-1.c (revision 231047) +++ c-c++-common/asan/pr59063-1.c (working copy) @@ -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) Index: c-c++-common/asan/pr59063-2.c =================================================================== --- c-c++-common/asan/pr59063-2.c (revision 231047) +++ c-c++-common/asan/pr59063-2.c (working copy) @@ -1,4 +1,4 @@ -/* { dg-do run { target { *-*-linux* } } } */ +/* { dg-do run { target { *-*-linux* *-*-freebsd* } } } */ /* { dg-options "-static-libasan" } */ #include Index: g++.dg/asan/asan_test.C =================================================================== --- g++.dg/asan/asan_test.C (revision 231047) +++ g++.dg/asan/asan_test.C (working copy) @@ -1,13 +1,14 @@ -// { dg-do run { target { { i?86-*-linux* x86_64-*-linux* } && sse2_runtime } } } +// { dg-do run { target { { 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 -Wno-format -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 -Wno-format -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 "-D__NO_INLINE__" { target { *-*-linux-gnu } } } +// { 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 *-*-freebsd* } } } // { dg-final { asan-gtest } } #include "asan_test.cc" Index: g++.dg/asan/asan_test_utils.h =================================================================== --- g++.dg/asan/asan_test_utils.h (revision 231047) +++ g++.dg/asan/asan_test_utils.h (working copy) @@ -40,6 +40,9 @@ # include # include # include +#endif + +#if defined(__linux__) || defined(__FreeBSD__) #include #endif Index: g++.dg/asan/interception-failure-test-1.C =================================================================== --- g++.dg/asan/interception-failure-test-1.C (revision 231047) +++ g++.dg/asan/interception-failure-test-1.C (working copy) @@ -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 Index: g++.dg/asan/interception-malloc-test-1.C =================================================================== --- g++.dg/asan/interception-malloc-test-1.C (revision 231047) +++ g++.dg/asan/interception-malloc-test-1.C (working copy) @@ -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 Index: g++.dg/asan/interception-test-1.C =================================================================== --- g++.dg/asan/interception-test-1.C (revision 231047) +++ g++.dg/asan/interception-test-1.C (working copy) @@ -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* } }