forked from OSchip/llvm-project
[ASan] lit tests: use nm instead of llvm-nm, until llvm-nm becomes usable on Mac. Port output test change in r161948 to lit
llvm-svn: 161951
This commit is contained in:
parent
4b5ec3145a
commit
5b2c6ea38f
|
@ -15,7 +15,7 @@ if("${CMAKE_HOST_SYSTEM}" STREQUAL "${CMAKE_SYSTEM}")
|
|||
# Run ASan output tests only if we're not cross-compiling,
|
||||
# and can be sure that clang would produce working binaries.
|
||||
set(ASAN_TEST_DEPS
|
||||
clang clang-headers FileCheck count not
|
||||
clang clang-headers FileCheck count not llvm-nm
|
||||
${ASAN_RUNTIME_LIBRARIES}
|
||||
)
|
||||
if(LLVM_INCLUDE_TESTS)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// Check the presense of interface symbols in compiled file.
|
||||
|
||||
// RUN: %clang -faddress-sanitizer -dead_strip -O2 %s -o %t.exe
|
||||
// RUN: llvm-nm %t.exe | egrep " [TW] " | sed "s/.* T //" | sed "s/.* W //" \
|
||||
// RUN: nm %t.exe | egrep " [TW] " | sed "s/.* T //" | sed "s/.* W //" \
|
||||
// RUN: | grep "__asan_" | sed "s/___asan_/__asan_/" > %t.symbols
|
||||
// RUN: cat %p/../asan_interface.h | sed "s/\/\/.*//" | grep "__asan_.*(" \
|
||||
// RUN: | sed "s/.* __asan_/__asan_/;s/(.*//" > %t.interface
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
// Sanity checking a test in pure C.
|
||||
// RUN: %clang -g -faddress-sanitizer -O2 %s -o %t
|
||||
// RUN: %t 2>&1 | FileCheck %s
|
||||
// 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: %t 2>&1 | FileCheck %s
|
||||
// RUN: %t 2>&1 | %symbolize | FileCheck %s
|
||||
|
||||
#include <stdlib.h>
|
||||
int main() {
|
||||
|
@ -12,4 +12,8 @@ int main() {
|
|||
free(x);
|
||||
return x[5];
|
||||
// CHECK: heap-use-after-free
|
||||
// CHECK: free
|
||||
// CHECK: main{{.*}}sanity_check_pure_c.c:12
|
||||
// CHECK: malloc
|
||||
// CHECK: main{{.*}}sanity_check_pure_c.c:11
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue