testsuite: Enable asan tests on FreeBSD x86_64
authorAndreas Tobler <andreast@gcc.gnu.org>
Tue, 21 Jan 2020 21:16:02 +0000 (22:16 +0100)
committerAndreas Tobler <andreast@gcc.gnu.org>
Fri, 1 May 2020 18:31:41 +0000 (20:31 +0200)
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.

12 files changed:
gcc/testsuite/ChangeLog
gcc/testsuite/c-c++-common/asan/asan-interface-1.c
gcc/testsuite/c-c++-common/asan/clone-test-1.c
gcc/testsuite/c-c++-common/asan/no-asan-stack.c
gcc/testsuite/c-c++-common/asan/pr59063-1.c
gcc/testsuite/c-c++-common/asan/pr59063-2.c
gcc/testsuite/g++.dg/asan/asan_test.C
gcc/testsuite/g++.dg/asan/asan_test_utils.h
gcc/testsuite/g++.dg/asan/interception-failure-test-1.C
gcc/testsuite/g++.dg/asan/interception-malloc-test-1.C
gcc/testsuite/g++.dg/asan/interception-test-1.C
gcc/testsuite/gcc.dg/asan/pr87930.c

index dbd464633f2fd4596102569dd09285643a695f1c..949b81a4392c93533acd98edb43fc6713df746db 100644 (file)
@@ -1,3 +1,16 @@
+2020-05-01  Andreas Tobler  <andreast@gcc.gnu.org>
+
+       * 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  <bergner@linux.ibm.com>
 
        PR rtl-optimization/94740
index 33ed1b0e84591c32f8ad1180dd4d678ac1d47fb6..2bf1fae857fa6c333b369f80807e77691f76fb26 100644 (file)
@@ -1,6 +1,6 @@
 /* Check that interface headers work. */
 
-/* { dg-do run { target { *-*-linux* } } } */
+/* { dg-do run { target { *-*-linux* *-*-freebsd* } } } */
 
 #include <sanitizer/asan_interface.h>
 
index c58c376f5dfe43cd1acdd166c86c4e8570b91628..b95ec32f9ef986f75dddfb5da6e7314a7fda0d1f 100644 (file)
@@ -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" } */
index 59ae55b0b00e02ca2296303dd19fa274fac4ebac..9d1d37cb6c4a359aa5d544cd67cf3ed80a6b0f2e 100644 (file)
@@ -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 <string.h>
 
index a22db6a0d8288809dd811151c957e44c49a7af84..1cc7f6f942863e433acbfa59d0e94c9e18287e22 100644 (file)
@@ -1,4 +1,4 @@
-/* { dg-do run { target { *-*-linux* } } } */
+/* { dg-do run { target { *-*-linux* *-*-freebsd* } } } */
 
 #include <time.h>
 static int weak_gettime (clockid_t clk_id, struct timespec *tp)
index 759b7f24d09b39829c4bbc4d7557a4251216630e..63a547f033f255204452d5f49c91e4a3d5b33068 100644 (file)
@@ -1,4 +1,4 @@
-/* { dg-do run { target { *-*-linux* } } } */
+/* { dg-do run { target { *-*-linux* *-*-freebsd* } } } */
 /* { dg-options "-static-libasan" } */
 
 #include <time.h>
index a151979946ac6d60268d3168af99b7b3836712a0..ca989a36bbd88e4fc8a24014012becd61d9578e0 100644 (file)
@@ -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 } }
index f5281a6a9e3c999311cd028c8c4f12228f49e482..ecde254166d94f362b804aed7b82f99c7ee295d3 100644 (file)
@@ -40,6 +40,9 @@
 # include <sys/types.h>
 # include <sys/stat.h>
 # include <fcntl.h>
+#endif
+
+#if defined(__linux__) || defined(__FreeBSD__)
 #include <unistd.h>
 #endif
 
index d326e56cf932e2d253c52d8267652da33541dfe4..8802870f70ca989c29c28cfa964f8d4ae733ffef 100644 (file)
@@ -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 <stdlib.h>
 #include <stdio.h>
index e64c184a48a760b1537c5041c23c0639f17bc153..0798c39c50def6fbf13e9187ffaaecd7e7119529 100644 (file)
@@ -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 <stdlib.h>
index 79248e06df69a4b93aae8b92aa84d1e5f3be18b8..69fa5a3e33f928a2e6f14798998aa814edd0d493 100644 (file)
@@ -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* } }
 
index 5a65d3fb03097943c659b062bd5db59ad02f601d..caf9208e1b0c84a309f561d63ed1a1578ee6cd70 100644 (file)
@@ -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;