Skip to content

Commit b2fd0a7

Browse files
authored
[Driver] Fix implicit-check-not regex (#121221)
We need to exclude more than builtins, but it's tricky with FileCheck regex. So switching to list of libs we want to check.
1 parent 815343e commit b2fd0a7

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

clang/test/Driver/sanitizer-ld.c

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
// Test sanitizers ld flags.
22

3-
// Match all libclang_rt, excluding platform-inconsistent builtins.
3+
// Match all libclang_rt, excluding platform-inconsistent libs, like
4+
// libclang_rt.builtins, libclang_rt.osx etc.
45

5-
// DEFINE: %{filecheck} = FileCheck %s --implicit-check-not="libclang_rt.{{([^b]..|.[^u].|..[^i]).*}}"
6+
// DEFINE: %{filecheck} = FileCheck %s --implicit-check-not="libclang_rt.{{([^.]+san|scudo|cfi|safestack|stats|fuzzer|undefined)}}"
67

78
// RUN: %clang -### %s 2>&1 \
89
// RUN: --target=i386-unknown-linux -fuse-ld=ld -fsanitize=address \
@@ -37,7 +38,6 @@
3738
// RUN: | %{filecheck} --check-prefix=CHECK-ASAN-NO-LINK-RUNTIME-DARWIN
3839
//
3940
// CHECK-ASAN-NO-LINK-RUNTIME-DARWIN: "{{.*}}ld"
40-
// CHECK-ASAN-NO-LINK-RUNTIME-DARWIN: libclang_rt.osx.a"
4141

4242
// RUN: %clang -fsanitize=address -### %s 2>&1 \
4343
// RUN: --target=x86_64-unknown-linux -fuse-ld=ld \
@@ -366,7 +366,6 @@
366366
// RUN: | %{filecheck} --check-prefix=CHECK-TYSAN-DARWIN-CXX
367367
// CHECK-TYSAN-DARWIN-CXX: "{{.*}}ld"
368368
// CHECK-TYSAN-DARWIN-CXX: libclang_rt.tysan_osx_dynamic.dylib
369-
// CHECK-TYSAN-DARWIN-CXX: libclang_rt.osx.a
370369
// CHECK-TYSAN-DARWIN-CXX-NOT: -lc++abi
371370

372371
// RUN: %clangxx -### %s 2>&1 \
@@ -403,7 +402,7 @@
403402
// RUN: --sysroot=%S/Inputs/basic_linux_tree \
404403
// RUN: | %{filecheck} --check-prefix=CHECK-TSAN-NO-LINK-RUNTIME-DARWIN
405404
//
406-
// CHECK-TSAN-NO-LINK-RUNTIME-DARWIN: libclang_rt.ios.a
405+
// CHECK-TSAN-NO-LINK-RUNTIME-DARWIN: "{{(.*[^-.0-9A-Z_a-z])?}}ld"
407406

408407
// RUN: %clangxx -### %s 2>&1 \
409408
// RUN: --target=x86_64-unknown-linux -fuse-ld=ld -stdlib=platform -lstdc++ \
@@ -473,7 +472,6 @@
473472
// RUN: | %{filecheck} --check-prefix=CHECK-UBSAN-NO-LINK-RUNTIME-DARWIN
474473
//
475474
// CHECK-UBSAN-NO-LINK-RUNTIME-DARWIN: "{{.*}}ld"
476-
// CHECK-UBSAN-NO-LINK-RUNTIME-DARWIN: libclang_rt.osx.a
477475

478476
// RUN: %clang -fsanitize=fuzzer -fno-sanitize-link-runtime -### %s 2>&1 \
479477
// RUN: --target=arm64e-apple-watchos -fuse-ld=ld \
@@ -482,7 +480,6 @@
482480
// RUN: | %{filecheck} --check-prefix=CHECK-FUZZER-NO-LINK-RUNTIME-DARWIN
483481
//
484482
// CHECK-FUZZER-NO-LINK-RUNTIME-DARWIN: "{{.*}}ld"
485-
// CHECK-FUZZER-NO-LINK-RUNTIME-DARWIN: libclang_rt.watchos.a
486483

487484
// RUN: %clang -fsanitize=undefined -### %s 2>&1 \
488485
// RUN: --target=i386-unknown-linux -fuse-ld=ld \
@@ -838,7 +835,6 @@
838835
// CHECK-ASAN-DARWIN106-CXX: "{{.*}}ld"
839836
// CHECK-ASAN-DARWIN106-CXX: libclang_rt.asan_osx_dynamic.dylib
840837
// CHECK-ASAN-DARWIN106-CXX-NOT: -lc++abi
841-
// CHECK-ASAN-DARWIN106-CXX: libclang_rt.osx.a
842838

843839
// RUN: %clangxx -fsanitize=leak -### %s 2>&1 \
844840
// RUN: -mmacos-version-min=10.6 \
@@ -849,7 +845,6 @@
849845
// CHECK-LSAN-DARWIN106-CXX: "{{.*}}ld"
850846
// CHECK-LSAN-DARWIN106-CXX: libclang_rt.lsan_osx_dynamic.dylib
851847
// CHECK-LSAN-DARWIN106-CXX-NOT: -lc++abi
852-
// CHECK-LSAN-DARWIN106-CXX: libclang_rt.osx.a
853848

854849
// RUN: %clang -### %s 2>&1 \
855850
// RUN: --target=x86_64-unknown-linux -fuse-ld=ld -fsanitize=safe-stack \

0 commit comments

Comments
 (0)