diff options
| -rw-r--r-- | compiler-rt/test/asan/lit.cfg | 2 | ||||
| -rw-r--r-- | compiler-rt/test/lit.common.cfg | 3 | ||||
| -rw-r--r-- | compiler-rt/test/ubsan/TestCases/Misc/missing_return.cpp | 11 | ||||
| -rw-r--r-- | compiler-rt/test/ubsan/TestCases/TypeCheck/misaligned.cpp | 8 |
4 files changed, 17 insertions, 7 deletions
diff --git a/compiler-rt/test/asan/lit.cfg b/compiler-rt/test/asan/lit.cfg index eda25bf4e82..0bcc311ca5d 100644 --- a/compiler-rt/test/asan/lit.cfg +++ b/compiler-rt/test/asan/lit.cfg @@ -113,8 +113,6 @@ if config.host_arch.find('64') != -1 and config.android != "TRUE": else: kernel_bits = '32' -# Define CHECK-%os to check for OS-dependent output. -config.substitutions.append( ('CHECK-%os', ("CHECK-" + config.host_os))) config.substitutions.append( ('CHECK-%kernel_bits', ("CHECK-kernel-" + kernel_bits + "-bits"))) config.available_features.add("asan-" + config.bits + "-bits") diff --git a/compiler-rt/test/lit.common.cfg b/compiler-rt/test/lit.common.cfg index adf65eefa49..1613c3b8e03 100644 --- a/compiler-rt/test/lit.common.cfg +++ b/compiler-rt/test/lit.common.cfg @@ -69,6 +69,9 @@ config.substitutions.append( # Allow tests to be executed on a simulator or remotely. config.substitutions.append( ('%run', config.emulator) ) +# Define CHECK-%os to check for OS-dependent output. +config.substitutions.append( ('CHECK-%os', ("CHECK-" + config.host_os))) + # Add supported compiler_rt architectures to a list of available features. compiler_rt_arch = getattr(config, 'compiler_rt_arch', None) if compiler_rt_arch: diff --git a/compiler-rt/test/ubsan/TestCases/Misc/missing_return.cpp b/compiler-rt/test/ubsan/TestCases/Misc/missing_return.cpp index 6e35c5bcfe7..ecbef9c74d7 100644 --- a/compiler-rt/test/ubsan/TestCases/Misc/missing_return.cpp +++ b/compiler-rt/test/ubsan/TestCases/Misc/missing_return.cpp @@ -1,13 +1,18 @@ // RUN: %clangxx -fsanitize=return -g %s -O3 -o %t // RUN: not %run %t 2>&1 | FileCheck %s -// RUN: UBSAN_OPTIONS=print_stacktrace=1 not %run %t 2>&1 | FileCheck %s --check-prefix=STACKTRACE +// RUN: UBSAN_OPTIONS=print_stacktrace=1 not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-%os-STACKTRACE // CHECK: missing_return.cpp:[[@LINE+1]]:5: runtime error: execution reached the end of a value-returning function without returning a value int f() { -// STACKTRACE: #0 {{.*}} in f(){{.*}}missing_return.cpp:[[@LINE-1]] +// Slow stack unwinding is disabled on Darwin for now, see +// https://code.google.com/p/address-sanitizer/issues/detail?id=137 +// CHECK-Linux-STACKTRACE: #0 {{.*}} in f(){{.*}}missing_return.cpp:[[@LINE-1]] +// Check for already checked line to avoid lit error reports. +// CHECK-Darwin-STACKTRACE: missing_return.cpp } int main(int, char **argv) { return f(); -// STACKTRACE: #1 {{.*}} in main{{.*}}missing_return.cpp:[[@LINE-1]] +// Disabled on Darwin, see above. +// CHECK-Linux-STACKTRACE: #1 {{.*}} in main{{.*}}missing_return.cpp:[[@LINE-1]] } diff --git a/compiler-rt/test/ubsan/TestCases/TypeCheck/misaligned.cpp b/compiler-rt/test/ubsan/TestCases/TypeCheck/misaligned.cpp index 7c117621d4f..e319b76e04b 100644 --- a/compiler-rt/test/ubsan/TestCases/TypeCheck/misaligned.cpp +++ b/compiler-rt/test/ubsan/TestCases/TypeCheck/misaligned.cpp @@ -6,7 +6,7 @@ // RUN: %run %t m1 2>&1 | FileCheck %s --check-prefix=CHECK-MEMBER // RUN: %run %t f1 2>&1 | FileCheck %s --check-prefix=CHECK-MEMFUN // RUN: %run %t n1 2>&1 | FileCheck %s --check-prefix=CHECK-NEW -// RUN: UBSAN_OPTIONS=print_stacktrace=1 %run %t l1 2>&1 | FileCheck %s --check-prefix=CHECK-LOAD --check-prefix=CHECK-STACK-LOAD +// RUN: UBSAN_OPTIONS=print_stacktrace=1 %run %t l1 2>&1 | FileCheck %s --check-prefix=CHECK-LOAD --check-prefix=CHECK-%os-STACK-LOAD #include <new> @@ -32,7 +32,11 @@ int main(int, char **argv) { // CHECK-LOAD-NEXT: {{^ 00 00 00 01 02 03 04 05}} // CHECK-LOAD-NEXT: {{^ \^}} return *p && 0; - // CHECK-STACK-LOAD: #0 {{.*}} in main{{.*}}misaligned.cpp + // Slow stack unwinding is disabled on Darwin for now, see + // https://code.google.com/p/address-sanitizer/issues/detail?id=137 + // CHECK-Linux-STACK-LOAD: #0 {{.*}} in main{{.*}}misaligned.cpp + // Check for the already checked line to avoid lit error reports. + // CHECK-Darwin-STACK-LOAD: {{ }} case 's': // CHECK-STORE: misaligned.cpp:[[@LINE+4]]:5: runtime error: store to misaligned address [[PTR:0x[0-9a-f]*]] for type 'int', which requires 4 byte alignment |

