From 4e796d0c9f404d080548665857f9c569534b239a Mon Sep 17 00:00:00 2001 From: Alexey Samsonov Date: Tue, 23 Feb 2016 01:58:56 +0000 Subject: [PATCH] [tests] Remove "supported-target" in favor of "target-arch" lit features. Test cases definitely should not care about the complete set of architectures supported by compiler-rt - they should only care about current architecture that the test suite was configured for. Introduce new lit feature to reflect this, and convert tests to use it. llvm-svn: 261603 --- .../test/asan/TestCases/Linux/asan-asm-stacktrace-test.cc | 2 +- compiler-rt/test/asan/TestCases/Linux/asan_prelink_test.cc | 2 +- compiler-rt/test/asan/TestCases/Linux/clang_gcc_abi.cc | 2 +- compiler-rt/test/asan/TestCases/Linux/coverage-missing.cc | 2 +- .../test/asan/TestCases/Linux/interface_symbols_linux.c | 2 +- compiler-rt/test/asan/TestCases/Linux/kernel-area.cc | 2 +- compiler-rt/test/asan/TestCases/Linux/malloc-in-qsort.cc | 2 +- compiler-rt/test/asan/TestCases/Linux/nohugepage_test.cc | 2 +- compiler-rt/test/asan/TestCases/Linux/odr_c_test.c | 2 +- compiler-rt/test/asan/TestCases/Linux/overflow-in-qsort.cc | 2 +- compiler-rt/test/asan/TestCases/Linux/scariness_score_test.cc | 2 +- compiler-rt/test/asan/TestCases/Linux/swapcontext_test.cc | 2 +- compiler-rt/test/asan/TestCases/Linux/unpoison_tls.cc | 2 +- compiler-rt/test/asan/TestCases/Posix/dlclose-test.cc | 4 ++-- compiler-rt/test/asan/TestCases/debug_ppc64_mapping.cc | 2 +- compiler-rt/test/asan/TestCases/dump_instruction_bytes.cc | 2 +- compiler-rt/test/lit.common.cfg | 10 +++++----- compiler-rt/test/lit.common.configured.in | 1 - compiler-rt/test/msan/vector_cvt.cc | 2 +- compiler-rt/test/sanitizer_common/TestCases/Linux/fpe.cc | 2 +- compiler-rt/test/sanitizer_common/TestCases/Linux/ill.cc | 2 +- .../test/sanitizer_common/TestCases/Linux/open_memstream.cc | 2 +- 22 files changed, 26 insertions(+), 27 deletions(-) diff --git a/compiler-rt/test/asan/TestCases/Linux/asan-asm-stacktrace-test.cc b/compiler-rt/test/asan/TestCases/Linux/asan-asm-stacktrace-test.cc index 5332c99..cbc900d 100644 --- a/compiler-rt/test/asan/TestCases/Linux/asan-asm-stacktrace-test.cc +++ b/compiler-rt/test/asan/TestCases/Linux/asan-asm-stacktrace-test.cc @@ -1,7 +1,7 @@ // Check that a stack unwinding algorithm works corretly even with the assembly // instrumentation. -// REQUIRES: x86_64-supported-target +// REQUIRES: x86_64-target-arch // RUN: %clangxx_asan -g -O1 %s -fno-inline-functions -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -mllvm -asan-instrument-assembly -o %t && not %run %t 2>&1 | FileCheck %s // RUN: %clangxx_asan -g -O1 %s -fno-inline-functions -fomit-frame-pointer -momit-leaf-frame-pointer -mllvm -asan-instrument-assembly -o %t && not %run %t 2>&1 | FileCheck %s // RUN: %clangxx_asan -g0 -O1 %s -fno-unwind-tables -fno-asynchronous-unwind-tables -fno-exceptions -fno-inline-functions -fomit-frame-pointer -momit-leaf-frame-pointer -mllvm -asan-instrument-assembly -o %t && not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-nounwind diff --git a/compiler-rt/test/asan/TestCases/Linux/asan_prelink_test.cc b/compiler-rt/test/asan/TestCases/Linux/asan_prelink_test.cc index d67d945..a5808ba 100644 --- a/compiler-rt/test/asan/TestCases/Linux/asan_prelink_test.cc +++ b/compiler-rt/test/asan/TestCases/Linux/asan_prelink_test.cc @@ -10,7 +10,7 @@ // RUN: %env_asan_opts=verbosity=1 %run %t 2>&1 | FileCheck %s // GNU driver doesn't handle .so files properly. -// REQUIRES: x86_64-supported-target, asan-64-bits, Clang +// REQUIRES: x86_64-target-arch, Clang #if BUILD_SO int G; int *getG() { diff --git a/compiler-rt/test/asan/TestCases/Linux/clang_gcc_abi.cc b/compiler-rt/test/asan/TestCases/Linux/clang_gcc_abi.cc index 669d152..845f412 100644 --- a/compiler-rt/test/asan/TestCases/Linux/clang_gcc_abi.cc +++ b/compiler-rt/test/asan/TestCases/Linux/clang_gcc_abi.cc @@ -3,7 +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-supported-target +// REQUIRES: arm-target-arch // XFAIL: armv7l-unknown-linux-gnueabihf #include diff --git a/compiler-rt/test/asan/TestCases/Linux/coverage-missing.cc b/compiler-rt/test/asan/TestCases/Linux/coverage-missing.cc index 6cd3201..49487d3 100644 --- a/compiler-rt/test/asan/TestCases/Linux/coverage-missing.cc +++ b/compiler-rt/test/asan/TestCases/Linux/coverage-missing.cc @@ -43,7 +43,7 @@ // RUN: %sancov missing %dynamiclib < foo.txt > foo-missing.txt // RUN: ( diff bar.txt foo-missing.txt || true ) | not grep "^<" -// REQUIRES: x86_64-supported-target, i386-supported-target +// REQUIRES: x86-target-arch // XFAIL: android #include diff --git a/compiler-rt/test/asan/TestCases/Linux/interface_symbols_linux.c b/compiler-rt/test/asan/TestCases/Linux/interface_symbols_linux.c index 971feb5..2e64857 100644 --- a/compiler-rt/test/asan/TestCases/Linux/interface_symbols_linux.c +++ b/compiler-rt/test/asan/TestCases/Linux/interface_symbols_linux.c @@ -56,6 +56,6 @@ // FIXME: nm -D on powerpc somewhy shows ASan interface symbols residing // in "initialized data section". -// REQUIRES: x86_64-supported-target,i386-supported-target,asan-static-runtime +// REQUIRES: x86-target-arch,asan-static-runtime int main() { return 0; } diff --git a/compiler-rt/test/asan/TestCases/Linux/kernel-area.cc b/compiler-rt/test/asan/TestCases/Linux/kernel-area.cc index c0f1727..d7a544f 100644 --- a/compiler-rt/test/asan/TestCases/Linux/kernel-area.cc +++ b/compiler-rt/test/asan/TestCases/Linux/kernel-area.cc @@ -16,7 +16,7 @@ // CHECK-kernel-64-bits: || `[0x28{{0+}}, 0x3{{f+}}]` || HighShadow || // CHECK-kernel-64-bits: || `[0x24{{0+}}, 0x27{{f+}}]` || ShadowGap || // -// REQUIRES: asan-32-bits,i386-supported-target +// REQUIRES: i386-target-arch int main() { return 0; diff --git a/compiler-rt/test/asan/TestCases/Linux/malloc-in-qsort.cc b/compiler-rt/test/asan/TestCases/Linux/malloc-in-qsort.cc index e8c9b74..ea23924 100644 --- a/compiler-rt/test/asan/TestCases/Linux/malloc-in-qsort.cc +++ b/compiler-rt/test/asan/TestCases/Linux/malloc-in-qsort.cc @@ -7,7 +7,7 @@ // https://code.google.com/p/address-sanitizer/issues/detail?id=137 // Fast unwinder is only available on x86_64 and i386. -// REQUIRES: x86_64-supported-target +// REQUIRES: x86-target-arch // REQUIRES: compiler-rt-optimized diff --git a/compiler-rt/test/asan/TestCases/Linux/nohugepage_test.cc b/compiler-rt/test/asan/TestCases/Linux/nohugepage_test.cc index 2758f0a..ce8f17e 100644 --- a/compiler-rt/test/asan/TestCases/Linux/nohugepage_test.cc +++ b/compiler-rt/test/asan/TestCases/Linux/nohugepage_test.cc @@ -9,7 +9,7 @@ // Would be great to run the test with no_huge_pages_for_shadow=0, but // the result will depend on the OS version and settings... // -// REQUIRES: x86_64-supported-target, asan-64-bits +// REQUIRES: x86_64-target-arch // // WARNING: this test is very subtle and may nto work on some systems. // If this is the case we'll need to futher improve it or disable it. diff --git a/compiler-rt/test/asan/TestCases/Linux/odr_c_test.c b/compiler-rt/test/asan/TestCases/Linux/odr_c_test.c index ce824bad..75f46ed 100644 --- a/compiler-rt/test/asan/TestCases/Linux/odr_c_test.c +++ b/compiler-rt/test/asan/TestCases/Linux/odr_c_test.c @@ -6,7 +6,7 @@ // RUN: %clang_asan %s -fPIE %t-1.so %t-2.so -Wl,-R`pwd` -o %t // RUN: not %run %t 2>&1 | FileCheck %s // -// REQUIRES: x86_64-supported-target +// REQUIRES: x86_64-target-arch // // CHECK: The following global variable is not properly aligned. // CHECK: ERROR: AddressSanitizer: odr-violation diff --git a/compiler-rt/test/asan/TestCases/Linux/overflow-in-qsort.cc b/compiler-rt/test/asan/TestCases/Linux/overflow-in-qsort.cc index dc3918e..6990518 100644 --- a/compiler-rt/test/asan/TestCases/Linux/overflow-in-qsort.cc +++ b/compiler-rt/test/asan/TestCases/Linux/overflow-in-qsort.cc @@ -7,7 +7,7 @@ // https://code.google.com/p/address-sanitizer/issues/detail?id=137 // Fast unwinder is only available on x86_64 and i386. -// REQUIRES: x86_64-supported-target +// REQUIRES: x86-target-arch #include #include diff --git a/compiler-rt/test/asan/TestCases/Linux/scariness_score_test.cc b/compiler-rt/test/asan/TestCases/Linux/scariness_score_test.cc index 77d58b7..21f42a5 100644 --- a/compiler-rt/test/asan/TestCases/Linux/scariness_score_test.cc +++ b/compiler-rt/test/asan/TestCases/Linux/scariness_score_test.cc @@ -32,7 +32,7 @@ // RUN: not %run %t 26 2>&1 | FileCheck %s --check-prefix=CHECK26 // RUN: not %run %t 27 2>&1 | FileCheck %s --check-prefix=CHECK27 // Parts of the test are too platform-specific: -// REQUIRES: x86_64-supported-target +// REQUIRES: x86_64-target-arch // REQUIRES: shell #include #include diff --git a/compiler-rt/test/asan/TestCases/Linux/swapcontext_test.cc b/compiler-rt/test/asan/TestCases/Linux/swapcontext_test.cc index 86ed593..210a667 100644 --- a/compiler-rt/test/asan/TestCases/Linux/swapcontext_test.cc +++ b/compiler-rt/test/asan/TestCases/Linux/swapcontext_test.cc @@ -6,7 +6,7 @@ // RUN: %clangxx_asan -O3 %s -o %t && %run %t 2>&1 | FileCheck %s // // This test is too sublte to try on non-x86 arch for now. -// REQUIRES: x86_64-supported-target,i386-supported-target +// REQUIRES: x86-target-arch #include #include diff --git a/compiler-rt/test/asan/TestCases/Linux/unpoison_tls.cc b/compiler-rt/test/asan/TestCases/Linux/unpoison_tls.cc index 9c1d74b..19ebec4 100644 --- a/compiler-rt/test/asan/TestCases/Linux/unpoison_tls.cc +++ b/compiler-rt/test/asan/TestCases/Linux/unpoison_tls.cc @@ -1,5 +1,5 @@ // Test that TLS is unpoisoned on thread death. -// REQUIRES: x86_64-supported-target,i386-supported-target +// REQUIRES: x86-target-arch // RUN: %clangxx_asan -O1 %s -pthread -o %t && %run %t 2>&1 diff --git a/compiler-rt/test/asan/TestCases/Posix/dlclose-test.cc b/compiler-rt/test/asan/TestCases/Posix/dlclose-test.cc index 369abd3..0aafa3e 100644 --- a/compiler-rt/test/asan/TestCases/Posix/dlclose-test.cc +++ b/compiler-rt/test/asan/TestCases/Posix/dlclose-test.cc @@ -11,8 +11,8 @@ // This sublte test assumes that after a foo.so is dlclose-d // we can mmap the region of memory that has been occupied by the library. -// It works on i368/x86_64 Linux, but not necessary anywhere else. -// REQUIRES: x86_64-supported-target,i386-supported-target +// It works on x86 Linux, but not necessary anywhere else. +// REQUIRES: x86-target-arch // RUN: %clangxx_asan -O0 -DSHARED_LIB %s -fPIC -shared -o %t-so.so // RUN: %clangxx_asan -O0 %s %libdl -o %t && %run %t 2>&1 | FileCheck %s diff --git a/compiler-rt/test/asan/TestCases/debug_ppc64_mapping.cc b/compiler-rt/test/asan/TestCases/debug_ppc64_mapping.cc index 753a636..43e1183 100644 --- a/compiler-rt/test/asan/TestCases/debug_ppc64_mapping.cc +++ b/compiler-rt/test/asan/TestCases/debug_ppc64_mapping.cc @@ -1,7 +1,7 @@ // RUN: %clang_asan -O0 %s -o %t // RUN: %env_asan_opts=verbosity=0 %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-PPC64-V0 // RUN: %env_asan_opts=verbosity=2 %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-PPC64 -// REQUIRES: powerpc64-supported-target +// REQUIRES: powerpc64-target-arch #include diff --git a/compiler-rt/test/asan/TestCases/dump_instruction_bytes.cc b/compiler-rt/test/asan/TestCases/dump_instruction_bytes.cc index da86a0f..b5b38ff 100644 --- a/compiler-rt/test/asan/TestCases/dump_instruction_bytes.cc +++ b/compiler-rt/test/asan/TestCases/dump_instruction_bytes.cc @@ -4,7 +4,7 @@ // RUN: %env_asan_opts=dump_instruction_bytes=1 not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-DUMP // RUN: not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-NODUMP // -// REQUIRES: x86_64-supported-target,i386-supported-target +// REQUIRES: x86-target-arch int main() { #if defined(__x86_64__) diff --git a/compiler-rt/test/lit.common.cfg b/compiler-rt/test/lit.common.cfg index d007536..5603dbe 100644 --- a/compiler-rt/test/lit.common.cfg +++ b/compiler-rt/test/lit.common.cfg @@ -96,11 +96,11 @@ if config.host_os == 'Windows': else: config.substitutions.append( ("%expect_crash ", "not --crash ") ) -# Add supported compiler_rt architectures to a list of available features. -compiler_rt_arch = getattr(config, 'compiler_rt_arch', None) -if compiler_rt_arch: - for arch in compiler_rt_arch.split(";"): - config.available_features.add(arch + "-supported-target") +target_arch = getattr(config, 'target_arch', None) +if target_arch: + config.available_features.add(target_arch + '-target-arch') + if target_arch in ['x86_64', 'i386', 'i686']: + config.available_features.add('x86-target-arch') compiler_rt_debug = getattr(config, 'compiler_rt_debug', False) if not compiler_rt_debug: diff --git a/compiler-rt/test/lit.common.configured.in b/compiler-rt/test/lit.common.configured.in index d9e6365..682ac3f 100644 --- a/compiler-rt/test/lit.common.configured.in +++ b/compiler-rt/test/lit.common.configured.in @@ -22,7 +22,6 @@ set_default("llvm_shlib_dir", "@SHLIBDIR@") set_default("gold_executable", "@GOLD_EXECUTABLE@") set_default("clang", "@COMPILER_RT_TEST_COMPILER@") set_default("compiler_id", "@COMPILER_RT_TEST_COMPILER_ID@") -set_default("compiler_rt_arch", "@COMPILER_RT_SUPPORTED_ARCH@") set_default("python_executable", "@PYTHON_EXECUTABLE@") set_default("compiler_rt_debug", @COMPILER_RT_DEBUG_PYBOOL@) set_default("compiler_rt_libdir", "@COMPILER_RT_LIBRARY_OUTPUT_DIR@") diff --git a/compiler-rt/test/msan/vector_cvt.cc b/compiler-rt/test/msan/vector_cvt.cc index 633a8b1..5541436 100644 --- a/compiler-rt/test/msan/vector_cvt.cc +++ b/compiler-rt/test/msan/vector_cvt.cc @@ -1,6 +1,6 @@ // RUN: %clangxx_msan -O0 %s -o %t && %run %t // RUN: %clangxx_msan -DPOSITIVE -O0 %s -o %t && not %run %t 2>&1 | FileCheck %s -// REQUIRES: x86_64-supported-target +// REQUIRES: x86_64-target-arch #include diff --git a/compiler-rt/test/sanitizer_common/TestCases/Linux/fpe.cc b/compiler-rt/test/sanitizer_common/TestCases/Linux/fpe.cc index b4be500..9a6f808 100644 --- a/compiler-rt/test/sanitizer_common/TestCases/Linux/fpe.cc +++ b/compiler-rt/test/sanitizer_common/TestCases/Linux/fpe.cc @@ -9,7 +9,7 @@ // XFAIL: tsan // // FIXME: seems to fail on ARM -// REQUIRES: x86_64-supported-target +// REQUIRES: x86_64-target-arch #include #include #include diff --git a/compiler-rt/test/sanitizer_common/TestCases/Linux/ill.cc b/compiler-rt/test/sanitizer_common/TestCases/Linux/ill.cc index 1edad48..2c69618 100644 --- a/compiler-rt/test/sanitizer_common/TestCases/Linux/ill.cc +++ b/compiler-rt/test/sanitizer_common/TestCases/Linux/ill.cc @@ -9,7 +9,7 @@ // XFAIL: tsan // // FIXME: seems to fail on ARM -// REQUIRES: x86_64-supported-target +// REQUIRES: x86_64-target-arch #include #include #include diff --git a/compiler-rt/test/sanitizer_common/TestCases/Linux/open_memstream.cc b/compiler-rt/test/sanitizer_common/TestCases/Linux/open_memstream.cc index 3bce030..cf31f44 100644 --- a/compiler-rt/test/sanitizer_common/TestCases/Linux/open_memstream.cc +++ b/compiler-rt/test/sanitizer_common/TestCases/Linux/open_memstream.cc @@ -1,6 +1,6 @@ // RUN: %clangxx -m64 -O0 -g -xc++ %s -o %t && %run %t // RUN: %clangxx -m64 -O3 -g -xc++ %s -o %t && %run %t -// REQUIRES: x86_64-supported-target +// REQUIRES: x86_64-target-arch #include #include -- 2.7.4