Update compiler-rt tests to match flag renaming/deprecation in Clang.
llvm-svn: 167434
This commit is contained in:
parent
c86a114409
commit
77930919ad
|
|
@ -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 \
|
||||
|
|
|
|||
|
|
@ -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 "
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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 "
|
||||
|
|
|
|||
|
|
@ -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() {
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
||||
|
|
|
|||
|
|
@ -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() {
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue