From ab89706ee870304eae8177b1f29c147efc6a0e22 Mon Sep 17 00:00:00 2001 From: Yvan Roux Date: Fri, 1 Jun 2018 06:23:36 +0000 Subject: [ASAN] Sanitize testsuite for ARM. Address failures exhibited by ARMv8 bot in Thumb mode: - Fix logic for fast unwinding support (i.e feature is not available for Thumb) - Fix Unsupported and Requires rules to handle armv8 as well as soft and hard float targets - Un-xfail passing tests Differential Revision: https://reviews.llvm.org/D47575 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@333729 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/asan/TestCases/Linux/activation-options.cc | 1 - test/asan/TestCases/Linux/allocator_oom_test.cc | 2 +- test/asan/TestCases/Linux/clang_gcc_abi.cc | 3 +-- test/asan/TestCases/Linux/clone_test.cc | 1 - test/asan/TestCases/Posix/glob.cc | 1 - test/asan/TestCases/Posix/mmap_limit_mb.cc | 2 +- test/asan/TestCases/Posix/shared-lib-test.cc | 1 - test/asan/TestCases/Posix/stack-use-after-return.cc | 4 ++-- test/asan/TestCases/Posix/start-deactivated.cc | 1 - test/asan/TestCases/Posix/strndup_oob_test.cc | 2 +- test/asan/TestCases/Posix/strndup_oob_test2.cc | 4 ++-- test/asan/TestCases/heavy_uar_test.cc | 6 +++--- test/asan/TestCases/strdup_oob_test.cc | 2 +- test/asan/lit.cfg | 2 +- 14 files changed, 13 insertions(+), 19 deletions(-) (limited to 'test') diff --git a/test/asan/TestCases/Linux/activation-options.cc b/test/asan/TestCases/Linux/activation-options.cc index 1a1ad3f8c..39924c4b1 100644 --- a/test/asan/TestCases/Linux/activation-options.cc +++ b/test/asan/TestCases/Linux/activation-options.cc @@ -28,7 +28,6 @@ // RUN: ASAN_ACTIVATION_OPTIONS=include=%t.asan.options.%b %run %t --fix-name 2>&1 | \ // RUN: FileCheck %s --check-prefix=CHECK-HELP --check-prefix=CHECK-FOUND -// XFAIL: arm-linux-gnueabi // XFAIL: android #if !defined(SHARED_LIB) diff --git a/test/asan/TestCases/Linux/allocator_oom_test.cc b/test/asan/TestCases/Linux/allocator_oom_test.cc index 69ca07d6d..c450ae5bb 100644 --- a/test/asan/TestCases/Linux/allocator_oom_test.cc +++ b/test/asan/TestCases/Linux/allocator_oom_test.cc @@ -32,7 +32,7 @@ // AArch64 bots fail on this test. // TODO(alekseys): Android lit do not run ulimit on device. // REQUIRES: shadow-scale-3 -// UNSUPPORTED: s390,android,arm,aarch64 +// UNSUPPORTED: s390,android,aarch64 #include #include diff --git a/test/asan/TestCases/Linux/clang_gcc_abi.cc b/test/asan/TestCases/Linux/clang_gcc_abi.cc index 79710dc83..e0ae3f1f8 100644 --- a/test/asan/TestCases/Linux/clang_gcc_abi.cc +++ b/test/asan/TestCases/Linux/clang_gcc_abi.cc @@ -3,8 +3,7 @@ // RUN: %clangxx_asan -O2 -x c %s -o %t && not %run %t 2>&1 | FileCheck %s // RUN: %clangxx_asan -O3 -x c %s -o %t && not %run %t 2>&1 | FileCheck %s -// REQUIRES: arm-target-arch, fast-unwinder-works -// XFAIL: armv7l-unknown-linux-gnueabihf +// REQUIRES: (arm-target-arch || armhf-target-arch), fast-unwinder-works #include diff --git a/test/asan/TestCases/Linux/clone_test.cc b/test/asan/TestCases/Linux/clone_test.cc index f6eb26100..0b86238cc 100644 --- a/test/asan/TestCases/Linux/clone_test.cc +++ b/test/asan/TestCases/Linux/clone_test.cc @@ -5,7 +5,6 @@ // RUN: %clangxx_asan -O1 %s -o %t && %run %t | FileCheck %s // RUN: %clangxx_asan -O2 %s -o %t && %run %t | FileCheck %s // RUN: %clangxx_asan -O3 %s -o %t && %run %t | FileCheck %s -// XFAIL: arm-linux-gnueabi #include #include diff --git a/test/asan/TestCases/Posix/glob.cc b/test/asan/TestCases/Posix/glob.cc index 46d4a0d8d..16b4ace8e 100644 --- a/test/asan/TestCases/Posix/glob.cc +++ b/test/asan/TestCases/Posix/glob.cc @@ -4,7 +4,6 @@ // // RUN: %clangxx_asan -O0 %s -o %t && %run %t %p 2>&1 | FileCheck %s // RUN: %clangxx_asan -O3 %s -o %t && %run %t %p 2>&1 | FileCheck %s -// XFAIL: arm-linux-gnueabi #include #include diff --git a/test/asan/TestCases/Posix/mmap_limit_mb.cc b/test/asan/TestCases/Posix/mmap_limit_mb.cc index 379524121..508c03fbc 100644 --- a/test/asan/TestCases/Posix/mmap_limit_mb.cc +++ b/test/asan/TestCases/Posix/mmap_limit_mb.cc @@ -9,7 +9,7 @@ // RUN: %env_asan_opts=mmap_limit_mb=300 not %run %t 500 1000000 2>&1 | FileCheck %s // // FIXME: Windows doesn't implement mmap_limit_mb. -// XFAIL: arm-linux-gnueabi,win32 +// XFAIL: win32 #include #include diff --git a/test/asan/TestCases/Posix/shared-lib-test.cc b/test/asan/TestCases/Posix/shared-lib-test.cc index 305942a07..6de6d9fdf 100644 --- a/test/asan/TestCases/Posix/shared-lib-test.cc +++ b/test/asan/TestCases/Posix/shared-lib-test.cc @@ -6,7 +6,6 @@ // RUN: %clangxx_asan -O2 %s %libdl -o %t && not %run %t 2>&1 | FileCheck %s // RUN: %clangxx_asan -O3 -DSHARED_LIB %s -fPIC -shared -o %t-so.so // RUN: %clangxx_asan -O3 %s %libdl -o %t && not %run %t 2>&1 | FileCheck %s -// XFAIL: arm-linux-gnueabi #if !defined(SHARED_LIB) #include diff --git a/test/asan/TestCases/Posix/stack-use-after-return.cc b/test/asan/TestCases/Posix/stack-use-after-return.cc index 2da1a0590..2b9f1d474 100644 --- a/test/asan/TestCases/Posix/stack-use-after-return.cc +++ b/test/asan/TestCases/Posix/stack-use-after-return.cc @@ -17,8 +17,8 @@ // This test runs out of stack on AArch64. // UNSUPPORTED: aarch64 -// FIXME: Fix this test for dynamic runtime on armhf-linux. -// UNSUPPORTED: armhf-linux && asan-dynamic-runtime +// FIXME: Fix this test for dynamic runtime on arm linux. +// UNSUPPORTED: (arm-linux || armhf-linux) && asan-dynamic-runtime #include #include diff --git a/test/asan/TestCases/Posix/start-deactivated.cc b/test/asan/TestCases/Posix/start-deactivated.cc index 2870ffb2f..736d7f698 100644 --- a/test/asan/TestCases/Posix/start-deactivated.cc +++ b/test/asan/TestCases/Posix/start-deactivated.cc @@ -18,7 +18,6 @@ // RUN: %env_asan_opts=start_deactivated=1 \ // RUN: ASAN_ACTIVATION_OPTIONS=help=1,handle_segv=0,verbosity=1 not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-UNSUPPORTED -// XFAIL: arm-linux-gnueabi // UNSUPPORTED: ios // END. diff --git a/test/asan/TestCases/Posix/strndup_oob_test.cc b/test/asan/TestCases/Posix/strndup_oob_test.cc index 7ea0b7a33..326ddcfd6 100644 --- a/test/asan/TestCases/Posix/strndup_oob_test.cc +++ b/test/asan/TestCases/Posix/strndup_oob_test.cc @@ -7,7 +7,7 @@ // RUN: %clangxx_asan -O3 -xc %s -o %t && not %run %t 2>&1 | FileCheck %s // Unwind problem on arm: "main" is missing from the allocation stack trace. -// UNSUPPORTED: win32,s390,armv7l-unknown-linux-gnueabihf +// UNSUPPORTED: win32,s390,arm && !fast-unwinder-works #include diff --git a/test/asan/TestCases/Posix/strndup_oob_test2.cc b/test/asan/TestCases/Posix/strndup_oob_test2.cc index 0a1afe285..71f3fc5d7 100644 --- a/test/asan/TestCases/Posix/strndup_oob_test2.cc +++ b/test/asan/TestCases/Posix/strndup_oob_test2.cc @@ -7,7 +7,7 @@ // RUN: %clang_asan -O3 -xc %s -o %t && not %run %t 2>&1 | FileCheck %s // Unwind problem on arm: "main" is missing from the allocation stack trace. -// UNSUPPORTED: win32,s390,armv7l-unknown-linux-gnueabihf +// UNSUPPORTED: win32,s390,arm && !fast-unwinder-works #include @@ -19,4 +19,4 @@ int main(int argc, char **argv) { // CHECK: AddressSanitizer: global-buffer-overflow // CHECK: {{.*}}main {{.*}}.cc:[[@LINE-2]] return *copy; -} \ No newline at end of file +} diff --git a/test/asan/TestCases/heavy_uar_test.cc b/test/asan/TestCases/heavy_uar_test.cc index 9ad29f079..94df0cefc 100644 --- a/test/asan/TestCases/heavy_uar_test.cc +++ b/test/asan/TestCases/heavy_uar_test.cc @@ -1,12 +1,12 @@ // RUN: %clangxx_asan -O0 %s -o %t && %env_asan_opts=detect_stack_use_after_return=1 not %run %t 2>&1 | FileCheck %s // RUN: %clangxx_asan -O2 %s -o %t && %env_asan_opts=detect_stack_use_after_return=1 not %run %t 2>&1 | FileCheck %s -// XFAIL: arm-linux-gnueabi,win32 +// XFAIL: win32 // FIXME: Fix this test under GCC. // REQUIRES: Clang -// FIXME: Fix this test for dynamic runtime on armhf-linux. -// UNSUPPORTED: armhf-linux && asan-dynamic-runtime +// FIXME: Fix this test for dynamic runtime on arm linux. +// UNSUPPORTED: (arm-linux || armhf-linux) && asan-dynamic-runtime // UNSUPPORTED: ios diff --git a/test/asan/TestCases/strdup_oob_test.cc b/test/asan/TestCases/strdup_oob_test.cc index 60c5ef12a..e251dfcb4 100644 --- a/test/asan/TestCases/strdup_oob_test.cc +++ b/test/asan/TestCases/strdup_oob_test.cc @@ -7,7 +7,7 @@ // RUN: %clangxx_asan -O3 -xc %s -o %t && not %run %t 2>&1 | FileCheck %s // Unwind problem on arm: "main" is missing from the allocation stack trace. -// UNSUPPORTED: armv7l-unknown-linux-gnueabihf +// REQUIRES: (arm-target-arch || armhf-target-arch), fast-unwinder-works // FIXME: We fail to intercept strdup with the dynamic WinASan RTL, so it's not // in the stack trace. diff --git a/test/asan/lit.cfg b/test/asan/lit.cfg index e84abc5d2..6b6595e8d 100644 --- a/test/asan/lit.cfg +++ b/test/asan/lit.cfg @@ -168,7 +168,7 @@ config.substitutions.append( ("%libdl", libdl_flag) ) config.available_features.add("asan-" + config.bits + "-bits") # Fast unwinder doesn't work with Thumb -if re.search('mthumb', config.target_cflags) is not None: +if re.search('mthumb', config.target_cflags) is None: config.available_features.add('fast-unwinder-works') # Turn on leak detection on 64-bit Linux. -- cgit v1.2.3