diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-11-06 02:31:42 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-11-06 02:31:42 +0000 |
commit | f10a79a21002a38e6ebc4ed01dec31872f39aed6 (patch) | |
tree | 0ac2911e20b66a347aa763839cd02df72f6086dd | |
parent | 84d57b4ce545d6c19effac01124749a9df0fd0a5 (diff) | |
download | compiler-rt-f10a79a21002a38e6ebc4ed01dec31872f39aed6.tar.gz |
Update compiler-rt tests to match flag renaming/deprecation in Clang.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@167434 91177308-0d34-0410-b5e6-96231b3b80d8
23 files changed, 45 insertions, 45 deletions
diff --git a/lib/asan/lit_tests/interface_symbols.c b/lib/asan/lit_tests/interface_symbols.c index 03998d5c2..5cbceebd4 100644 --- a/lib/asan/lit_tests/interface_symbols.c +++ b/lib/asan/lit_tests/interface_symbols.c @@ -1,6 +1,6 @@ // Check the presense of interface symbols in compiled file. -// RUN: %clang -faddress-sanitizer -dead_strip -O2 %s -o %t.exe +// RUN: %clang -fsanitize=address -dead_strip -O2 %s -o %t.exe // RUN: nm %t.exe | egrep " [TW] " | sed "s/.* T //" | sed "s/.* W //" \ // RUN: | grep "__asan_" | sed "s/___asan_/__asan_/" > %t.symbols // RUN: cat %p/../../../include/sanitizer/asan_interface.h \ diff --git a/lib/asan/lit_tests/lit.cfg b/lib/asan/lit_tests/lit.cfg index 14ae142a3..c98ec2618 100644 --- a/lib/asan/lit_tests/lit.cfg +++ b/lib/asan/lit_tests/lit.cfg @@ -56,10 +56,10 @@ if (not compiler_rt_lit_cfg) or (not os.path.exists(compiler_rt_lit_cfg)): % compiler_rt_lit_cfg) lit.load_config(config, compiler_rt_lit_cfg) -# Setup default compiler flags used with -faddress-sanitizer option. +# Setup default compiler flags used with -fsanitize=address option. # FIXME: Review the set of required flags and check if it can be reduced. clang_asan_cxxflags = ("-ccc-cxx " - + "-faddress-sanitizer " + + "-fsanitize=address " + "-mno-omit-leaf-frame-pointer " + "-fno-omit-frame-pointer " + "-fno-optimize-sibling-calls " diff --git a/lib/asan/lit_tests/sanity_check_pure_c.c b/lib/asan/lit_tests/sanity_check_pure_c.c index b0bd1f091..2b5090b09 100644 --- a/lib/asan/lit_tests/sanity_check_pure_c.c +++ b/lib/asan/lit_tests/sanity_check_pure_c.c @@ -1,9 +1,9 @@ // Sanity checking a test in pure C. -// RUN: %clang -g -faddress-sanitizer -O2 %s -o %t +// RUN: %clang -g -fsanitize=address -O2 %s -o %t // RUN: %t 2>&1 | %symbolize | FileCheck %s // Sanity checking a test in pure C with -pie. -// RUN: %clang -g -faddress-sanitizer -O2 %s -pie -o %t +// RUN: %clang -g -fsanitize=address -O2 %s -pie -o %t // RUN: %t 2>&1 | %symbolize | FileCheck %s #include <stdlib.h> diff --git a/lib/asan/lit_tests/sleep_before_dying.c b/lib/asan/lit_tests/sleep_before_dying.c index 5fcb86361..df9eba276 100644 --- a/lib/asan/lit_tests/sleep_before_dying.c +++ b/lib/asan/lit_tests/sleep_before_dying.c @@ -1,4 +1,4 @@ -// RUN: %clang -g -faddress-sanitizer -O2 %s -o %t +// RUN: %clang -g -fsanitize=address -O2 %s -o %t // RUN: ASAN_OPTIONS="sleep_before_dying=1" %t 2>&1 | FileCheck %s #include <stdlib.h> diff --git a/lib/asan/lit_tests/strip_path_prefix.c b/lib/asan/lit_tests/strip_path_prefix.c index 01c3b70a1..ef7bf98ab 100644 --- a/lib/asan/lit_tests/strip_path_prefix.c +++ b/lib/asan/lit_tests/strip_path_prefix.c @@ -1,4 +1,4 @@ -// RUN: %clang -g -faddress-sanitizer -O2 %s -o %t +// RUN: %clang -g -fsanitize=address -O2 %s -o %t // RUN: ASAN_OPTIONS="strip_path_prefix='/'" %t 2>&1 | FileCheck %s #include <stdlib.h> diff --git a/lib/asan/tests/CMakeLists.txt b/lib/asan/tests/CMakeLists.txt index af69579d9..819596253 100644 --- a/lib/asan/tests/CMakeLists.txt +++ b/lib/asan/tests/CMakeLists.txt @@ -66,7 +66,7 @@ set(ASAN_BLACKLIST_FILE "${CMAKE_CURRENT_SOURCE_DIR}/asan_test.ignore") set(ASAN_UNITTEST_INSTRUMENTED_CFLAGS ${ASAN_UNITTEST_COMMON_CFLAGS} ${ASAN_GTEST_INCLUDE_CFLAGS} - -faddress-sanitizer + -fsanitize=address -mllvm "-asan-blacklist=${ASAN_BLACKLIST_FILE}" -mllvm -asan-stack=1 -mllvm -asan-globals=1 diff --git a/lib/tsan/lit_tests/lit.cfg b/lib/tsan/lit_tests/lit.cfg index acfc74473..3a29edc51 100644 --- a/lib/tsan/lit_tests/lit.cfg +++ b/lib/tsan/lit_tests/lit.cfg @@ -59,9 +59,9 @@ lit.load_config(config, compiler_rt_lit_cfg) # Setup environment variables for running ThreadSanitizer. config.environment['TSAN_OPTIONS'] = "atexit_sleep_ms=0" -# Setup default compiler flags used with -faddress-sanitizer option. +# Setup default compiler flags used with -fsanitize=thread option. # FIXME: Review the set of required flags and check if it can be reduced. -clang_tsan_cflags = ("-fthread-sanitizer " +clang_tsan_cflags = ("-fsanitize=thread " + "-fPIE " + "-fno-builtin " + "-g " diff --git a/lib/tsan/lit_tests/test_output.sh b/lib/tsan/lit_tests/test_output.sh index bd8573e41..3798ff000 100755 --- a/lib/tsan/lit_tests/test_output.sh +++ b/lib/tsan/lit_tests/test_output.sh @@ -10,7 +10,7 @@ CC=clang CXX=clang++ # TODO: add testing for all of -O0...-O3 -CFLAGS="-fthread-sanitizer -fPIE -O1 -g -fno-builtin -Wall" +CFLAGS="-fsanitize=thread -fPIE -O1 -g -fno-builtin -Wall" LDFLAGS="-pie -lpthread -ldl $ROOTDIR/rtl/libtsan.a" test_file() { diff --git a/lib/ubsan/lit_tests/Float/cast-overflow.cpp b/lib/ubsan/lit_tests/Float/cast-overflow.cpp index d04f38c4c..b9c5d38c0 100644 --- a/lib/ubsan/lit_tests/Float/cast-overflow.cpp +++ b/lib/ubsan/lit_tests/Float/cast-overflow.cpp @@ -1,4 +1,4 @@ -// RUN: %clang -fcatch-undefined-behavior %s -o %t +// RUN: %clang -fsanitize=float-cast-overflow %s -o %t // RUN: %t _ // RUN: %t 0 2>&1 | FileCheck %s --check-prefix=CHECK-0 // RUN: %t 1 2>&1 | FileCheck %s --check-prefix=CHECK-1 diff --git a/lib/ubsan/lit_tests/Integer/add-overflow.cpp b/lib/ubsan/lit_tests/Integer/add-overflow.cpp index 781ccf3a6..1b0a6d9c0 100644 --- a/lib/ubsan/lit_tests/Integer/add-overflow.cpp +++ b/lib/ubsan/lit_tests/Integer/add-overflow.cpp @@ -1,6 +1,6 @@ -// RUN: %clang -DADD_I32 -fcatch-undefined-behavior %s -o %t && %t 2>&1 | FileCheck %s --check-prefix=ADD_I32 -// RUN: %clang -DADD_I64 -fcatch-undefined-behavior %s -o %t && %t 2>&1 | FileCheck %s --check-prefix=ADD_I64 -// RUN: %clang -DADD_I128 -fcatch-undefined-behavior %s -o %t && %t 2>&1 | FileCheck %s --check-prefix=ADD_I128 +// RUN: %clang -DADD_I32 -fsanitize=signed-integer-overflow %s -o %t && %t 2>&1 | FileCheck %s --check-prefix=ADD_I32 +// RUN: %clang -DADD_I64 -fsanitize=signed-integer-overflow %s -o %t && %t 2>&1 | FileCheck %s --check-prefix=ADD_I64 +// RUN: %clang -DADD_I128 -fsanitize=signed-integer-overflow %s -o %t && %t 2>&1 | FileCheck %s --check-prefix=ADD_I128 #include <stdint.h> diff --git a/lib/ubsan/lit_tests/Integer/div-overflow.cpp b/lib/ubsan/lit_tests/Integer/div-overflow.cpp index fb0e7d1ce..43205fd3e 100644 --- a/lib/ubsan/lit_tests/Integer/div-overflow.cpp +++ b/lib/ubsan/lit_tests/Integer/div-overflow.cpp @@ -1,4 +1,4 @@ -// RUN: %clang -fcatch-undefined-behavior %s -o %t && %t 2>&1 | FileCheck %s +// RUN: %clang -fsanitize=signed-integer-overflow %s -o %t && %t 2>&1 | FileCheck %s #include <stdint.h> diff --git a/lib/ubsan/lit_tests/Integer/div-zero.cpp b/lib/ubsan/lit_tests/Integer/div-zero.cpp index 0c1c3f886..7d7171135 100644 --- a/lib/ubsan/lit_tests/Integer/div-zero.cpp +++ b/lib/ubsan/lit_tests/Integer/div-zero.cpp @@ -1,7 +1,7 @@ -// RUN: %clang -fcatch-undefined-behavior -DDIVIDEND=0 %s -o %t && %t 2>&1 | FileCheck %s -// RUN: %clang -fcatch-undefined-behavior -DDIVIDEND=1U %s -o %t && %t 2>&1 | FileCheck %s -// RUN: %clang -fcatch-undefined-behavior -DDIVIDEND=1.5 %s -o %t && %t 2>&1 | FileCheck %s -// RUN: %clang -fcatch-undefined-behavior -DDIVIDEND='__int128(123)' %s -o %t && %t 2>&1 | FileCheck %s +// RUN: %clang -fsanitize=divide-by-zero -DDIVIDEND=0 %s -o %t && %t 2>&1 | FileCheck %s +// RUN: %clang -fsanitize=divide-by-zero -DDIVIDEND=1U %s -o %t && %t 2>&1 | FileCheck %s +// RUN: %clang -fsanitize=divide-by-zero -DDIVIDEND=1.5 %s -o %t && %t 2>&1 | FileCheck %s +// RUN: %clang -fsanitize=divide-by-zero -DDIVIDEND='__int128(123)' %s -o %t && %t 2>&1 | FileCheck %s int main() { // CHECK: div-zero.cpp:8:12: fatal error: division by zero diff --git a/lib/ubsan/lit_tests/Integer/incdec-overflow.cpp b/lib/ubsan/lit_tests/Integer/incdec-overflow.cpp index 8c8800b5b..28ee9fb98 100644 --- a/lib/ubsan/lit_tests/Integer/incdec-overflow.cpp +++ b/lib/ubsan/lit_tests/Integer/incdec-overflow.cpp @@ -1,7 +1,7 @@ -// RUN: %clang -DOP=n++ -fcatch-undefined-behavior %s -o %t && %t 2>&1 | FileCheck %s -// RUN: %clang -DOP=++n -fcatch-undefined-behavior %s -o %t && %t 2>&1 | FileCheck %s -// RUN: %clang -DOP=m-- -fcatch-undefined-behavior %s -o %t && %t 2>&1 | FileCheck %s -// RUN: %clang -DOP=--m -fcatch-undefined-behavior %s -o %t && %t 2>&1 | FileCheck %s +// RUN: %clang -DOP=n++ -fsanitize=signed-integer-overflow %s -o %t && %t 2>&1 | FileCheck %s +// RUN: %clang -DOP=++n -fsanitize=signed-integer-overflow %s -o %t && %t 2>&1 | FileCheck %s +// RUN: %clang -DOP=m-- -fsanitize=signed-integer-overflow %s -o %t && %t 2>&1 | FileCheck %s +// RUN: %clang -DOP=--m -fsanitize=signed-integer-overflow %s -o %t && %t 2>&1 | FileCheck %s #include <stdint.h> diff --git a/lib/ubsan/lit_tests/Integer/mul-overflow.cpp b/lib/ubsan/lit_tests/Integer/mul-overflow.cpp index 1ba968da5..ef5c00464 100644 --- a/lib/ubsan/lit_tests/Integer/mul-overflow.cpp +++ b/lib/ubsan/lit_tests/Integer/mul-overflow.cpp @@ -1,4 +1,4 @@ -// RUN: %clang -fcatch-undefined-behavior %s -o %t && %t 2>&1 | FileCheck %s +// RUN: %clang -fsanitize=signed-integer-overflow %s -o %t && %t 2>&1 | FileCheck %s #include <stdint.h> diff --git a/lib/ubsan/lit_tests/Integer/negate-overflow.cpp b/lib/ubsan/lit_tests/Integer/negate-overflow.cpp index 58f1b4870..9a97fad16 100644 --- a/lib/ubsan/lit_tests/Integer/negate-overflow.cpp +++ b/lib/ubsan/lit_tests/Integer/negate-overflow.cpp @@ -1,4 +1,4 @@ -// RUN: %clang -fcatch-undefined-behavior %s -o %t && %t 2>&1 | FileCheck %s +// RUN: %clang -fsanitize=signed-integer-overflow %s -o %t && %t 2>&1 | FileCheck %s int main() { -unsigned(-0x7fffffff - 1); // ok diff --git a/lib/ubsan/lit_tests/Integer/shift.cpp b/lib/ubsan/lit_tests/Integer/shift.cpp index 33a15313f..8c06a8259 100644 --- a/lib/ubsan/lit_tests/Integer/shift.cpp +++ b/lib/ubsan/lit_tests/Integer/shift.cpp @@ -1,13 +1,13 @@ -// RUN: %clang -DLSH_OVERFLOW -DOP='<<' -fcatch-undefined-behavior %s -o %t && %t 2>&1 | FileCheck %s --check-prefix=LSH_OVERFLOW -// RUN: %clang -DLSH_OVERFLOW -DOP='<<=' -fcatch-undefined-behavior %s -o %t && %t 2>&1 | FileCheck %s --check-prefix=LSH_OVERFLOW -// RUN: %clang -DTOO_LOW -DOP='<<' -fcatch-undefined-behavior %s -o %t && %t 2>&1 | FileCheck %s --check-prefix=TOO_LOW -// RUN: %clang -DTOO_LOW -DOP='>>' -fcatch-undefined-behavior %s -o %t && %t 2>&1 | FileCheck %s --check-prefix=TOO_LOW -// RUN: %clang -DTOO_LOW -DOP='<<=' -fcatch-undefined-behavior %s -o %t && %t 2>&1 | FileCheck %s --check-prefix=TOO_LOW -// RUN: %clang -DTOO_LOW -DOP='>>=' -fcatch-undefined-behavior %s -o %t && %t 2>&1 | FileCheck %s --check-prefix=TOO_LOW -// RUN: %clang -DTOO_HIGH -DOP='<<' -fcatch-undefined-behavior %s -o %t && %t 2>&1 | FileCheck %s --check-prefix=TOO_HIGH -// RUN: %clang -DTOO_HIGH -DOP='>>' -fcatch-undefined-behavior %s -o %t && %t 2>&1 | FileCheck %s --check-prefix=TOO_HIGH -// RUN: %clang -DTOO_HIGH -DOP='<<=' -fcatch-undefined-behavior %s -o %t && %t 2>&1 | FileCheck %s --check-prefix=TOO_HIGH -// RUN: %clang -DTOO_HIGH -DOP='>>=' -fcatch-undefined-behavior %s -o %t && %t 2>&1 | FileCheck %s --check-prefix=TOO_HIGH +// RUN: %clang -DLSH_OVERFLOW -DOP='<<' -fsanitize=shift %s -o %t && %t 2>&1 | FileCheck %s --check-prefix=LSH_OVERFLOW +// RUN: %clang -DLSH_OVERFLOW -DOP='<<=' -fsanitize=shift %s -o %t && %t 2>&1 | FileCheck %s --check-prefix=LSH_OVERFLOW +// RUN: %clang -DTOO_LOW -DOP='<<' -fsanitize=shift %s -o %t && %t 2>&1 | FileCheck %s --check-prefix=TOO_LOW +// RUN: %clang -DTOO_LOW -DOP='>>' -fsanitize=shift %s -o %t && %t 2>&1 | FileCheck %s --check-prefix=TOO_LOW +// RUN: %clang -DTOO_LOW -DOP='<<=' -fsanitize=shift %s -o %t && %t 2>&1 | FileCheck %s --check-prefix=TOO_LOW +// RUN: %clang -DTOO_LOW -DOP='>>=' -fsanitize=shift %s -o %t && %t 2>&1 | FileCheck %s --check-prefix=TOO_LOW +// RUN: %clang -DTOO_HIGH -DOP='<<' -fsanitize=shift %s -o %t && %t 2>&1 | FileCheck %s --check-prefix=TOO_HIGH +// RUN: %clang -DTOO_HIGH -DOP='>>' -fsanitize=shift %s -o %t && %t 2>&1 | FileCheck %s --check-prefix=TOO_HIGH +// RUN: %clang -DTOO_HIGH -DOP='<<=' -fsanitize=shift %s -o %t && %t 2>&1 | FileCheck %s --check-prefix=TOO_HIGH +// RUN: %clang -DTOO_HIGH -DOP='>>=' -fsanitize=shift %s -o %t && %t 2>&1 | FileCheck %s --check-prefix=TOO_HIGH #include <stdint.h> diff --git a/lib/ubsan/lit_tests/Integer/sub-overflow.cpp b/lib/ubsan/lit_tests/Integer/sub-overflow.cpp index 71925c9bd..38fc7b055 100644 --- a/lib/ubsan/lit_tests/Integer/sub-overflow.cpp +++ b/lib/ubsan/lit_tests/Integer/sub-overflow.cpp @@ -1,6 +1,6 @@ -// RUN: %clang -DSUB_I32 -fcatch-undefined-behavior %s -o %t && %t 2>&1 | FileCheck %s --check-prefix=SUB_I32 -// RUN: %clang -DSUB_I64 -fcatch-undefined-behavior %s -o %t && %t 2>&1 | FileCheck %s --check-prefix=SUB_I64 -// RUN: %clang -DSUB_I128 -fcatch-undefined-behavior %s -o %t && %t 2>&1 | FileCheck %s --check-prefix=SUB_I128 +// RUN: %clang -DSUB_I32 -fsanitize=signed-integer-overflow %s -o %t && %t 2>&1 | FileCheck %s --check-prefix=SUB_I32 +// RUN: %clang -DSUB_I64 -fsanitize=signed-integer-overflow %s -o %t && %t 2>&1 | FileCheck %s --check-prefix=SUB_I64 +// RUN: %clang -DSUB_I128 -fsanitize=signed-integer-overflow %s -o %t && %t 2>&1 | FileCheck %s --check-prefix=SUB_I128 #include <stdint.h> diff --git a/lib/ubsan/lit_tests/Misc/missing_return.cpp b/lib/ubsan/lit_tests/Misc/missing_return.cpp index 73febea46..820448c1e 100644 --- a/lib/ubsan/lit_tests/Misc/missing_return.cpp +++ b/lib/ubsan/lit_tests/Misc/missing_return.cpp @@ -1,4 +1,4 @@ -// RUN: %clang -fcatch-undefined-behavior %s -O3 -o %t && %t 2>&1 | FileCheck %s +// RUN: %clang -fsanitize=return %s -O3 -o %t && %t 2>&1 | FileCheck %s // CHECK: missing_return.cpp:4:5: fatal error: execution reached the end of a value-returning function without returning a value int f() { diff --git a/lib/ubsan/lit_tests/Misc/unreachable.cpp b/lib/ubsan/lit_tests/Misc/unreachable.cpp index ded1de63a..6e0a03d5f 100644 --- a/lib/ubsan/lit_tests/Misc/unreachable.cpp +++ b/lib/ubsan/lit_tests/Misc/unreachable.cpp @@ -1,4 +1,4 @@ -// RUN: %clang -fcatch-undefined-behavior %s -O3 -o %t && %t 2>&1 | FileCheck %s +// RUN: %clang -fsanitize=unreachable %s -O3 -o %t && %t 2>&1 | FileCheck %s int main(int, char **argv) { // CHECK: unreachable.cpp:5:3: fatal error: execution reached a __builtin_unreachable() call diff --git a/lib/ubsan/lit_tests/Misc/vla.c b/lib/ubsan/lit_tests/Misc/vla.c index 4137e804e..c7600e3b1 100644 --- a/lib/ubsan/lit_tests/Misc/vla.c +++ b/lib/ubsan/lit_tests/Misc/vla.c @@ -1,4 +1,4 @@ -// RUN: %clang -fcatch-undefined-behavior %s -O3 -o %t +// RUN: %clang -fsanitize=vla-bound %s -O3 -o %t // RUN: %t 2>&1 | FileCheck %s --check-prefix=CHECK-MINUS-ONE // RUN: %t a 2>&1 | FileCheck %s --check-prefix=CHECK-ZERO // RUN: %t a b diff --git a/lib/ubsan/lit_tests/TypeCheck/misaligned.cpp b/lib/ubsan/lit_tests/TypeCheck/misaligned.cpp index acc73e0ff..817781bbb 100644 --- a/lib/ubsan/lit_tests/TypeCheck/misaligned.cpp +++ b/lib/ubsan/lit_tests/TypeCheck/misaligned.cpp @@ -1,4 +1,4 @@ -// RUN: %clang -fcatch-undefined-behavior %s -O3 -o %t +// RUN: %clang -fsanitize=alignment %s -O3 -o %t // RUN: %t l0 && %t s0 && %t r0 && %t m0 && %t f0 // RUN: %t l1 2>&1 | FileCheck %s --check-prefix=CHECK-LOAD // RUN: %t s1 2>&1 | FileCheck %s --check-prefix=CHECK-STORE diff --git a/lib/ubsan/lit_tests/TypeCheck/null.cpp b/lib/ubsan/lit_tests/TypeCheck/null.cpp index 8e17388fb..ae92493f6 100644 --- a/lib/ubsan/lit_tests/TypeCheck/null.cpp +++ b/lib/ubsan/lit_tests/TypeCheck/null.cpp @@ -1,4 +1,4 @@ -// RUN: %clang -fcatch-undefined-behavior %s -O3 -o %t +// RUN: %clang -fsanitize=null %s -O3 -o %t // RUN: %t l 2>&1 | FileCheck %s --check-prefix=CHECK-LOAD // RUN: %t s 2>&1 | FileCheck %s --check-prefix=CHECK-STORE // RUN: %t r 2>&1 | FileCheck %s --check-prefix=CHECK-REFERENCE diff --git a/lib/ubsan/lit_tests/TypeCheck/vptr.cpp b/lib/ubsan/lit_tests/TypeCheck/vptr.cpp index c8e2820f1..e9fffd5ae 100644 --- a/lib/ubsan/lit_tests/TypeCheck/vptr.cpp +++ b/lib/ubsan/lit_tests/TypeCheck/vptr.cpp @@ -1,4 +1,4 @@ -// RUN: %clang -ccc-cxx -fcatch-undefined-behavior %s -O3 -o %t +// RUN: %clang -ccc-cxx -fsanitize=vptr %s -O3 -o %t // RUN: %t rT && %t mT && %t fT // RUN: %t rU && %t mU && %t fU // RUN: %t rS 2>&1 | FileCheck %s --check-prefix=CHECK-REFERENCE |