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.
+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
/* Check that interface headers work. */
-/* { dg-do run { target { *-*-linux* } } } */
+/* { dg-do run { target { *-*-linux* *-*-freebsd* } } } */
#include <sanitizer/asan_interface.h>
/* 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" } */
-/* { 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>
-/* { 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)
-/* { dg-do run { target { *-*-linux* } } } */
+/* { dg-do run { target { *-*-linux* *-*-freebsd* } } } */
/* { dg-options "-static-libasan" } */
#include <time.h>
-// { 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 } }
# include <sys/types.h>
# include <sys/stat.h>
# include <fcntl.h>
+#endif
+
+#if defined(__linux__) || defined(__FreeBSD__)
#include <unistd.h>
#endif
// { 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>
// 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>
// { 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* } }
-/* { 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;