Skip to content

Commit b73e541

Browse files
authored
[NFC][CFI] Don't mix CFI and non-CFI flags on the same line (#135890)
1 parent d131351 commit b73e541

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

clang/test/Driver/sanitizer-ld.c

+11-6
Original file line numberDiff line numberDiff line change
@@ -830,58 +830,63 @@
830830
// CHECK-NSAN-UBSAN: "--whole-archive" "{{[^"]*}}libclang_rt.nsan.a" "--no-whole-archive"
831831

832832
// CFI by itself does not link runtime libraries.
833-
// RUN: not %clang -fsanitize=cfi -### %s 2>&1 \
833+
// RUN: not %clang -fsanitize=cfi \
834834
// RUN: --target=x86_64-unknown-linux -fuse-ld=ld -rtlib=platform \
835835
// RUN: -resource-dir=%S/Inputs/resource_dir \
836836
// RUN: --sysroot=%S/Inputs/basic_linux_tree \
837+
// RUN: -### %s 2>&1 \
837838
// RUN: | %{filecheck} --check-prefix=CHECK-CFI-LINUX
838839
// CHECK-CFI-LINUX: "{{.*}}ld{{(.exe)?}}"
839840

840841
// CFI with diagnostics links the UBSan runtime.
841842
// RUN: not %clang -fsanitize=cfi -fno-sanitize-trap=cfi -fsanitize-recover=cfi \
842-
// RUN: -### %s 2>&1\
843843
// RUN: --target=x86_64-unknown-linux -fuse-ld=ld \
844844
// RUN: -resource-dir=%S/Inputs/resource_dir \
845845
// RUN: --sysroot=%S/Inputs/basic_linux_tree \
846+
// RUN: -### %s 2>&1 \
846847
// RUN: | %{filecheck} --check-prefix=CHECK-CFI-DIAG-LINUX
847848
// CHECK-CFI-DIAG-LINUX: "{{.*}}ld{{(.exe)?}}"
848849
// CHECK-CFI-DIAG-LINUX: "--whole-archive" "{{[^"]*}}libclang_rt.ubsan_standalone.a" "--no-whole-archive"
849850

850851
// Cross-DSO CFI links the CFI runtime.
851-
// RUN: not %clang -fsanitize=cfi -fsanitize-cfi-cross-dso -### %s 2>&1 \
852+
// RUN: not %clang -fsanitize=cfi -fsanitize-cfi-cross-dso \
852853
// RUN: --target=x86_64-unknown-linux -fuse-ld=ld \
853854
// RUN: -resource-dir=%S/Inputs/resource_dir \
854855
// RUN: --sysroot=%S/Inputs/basic_linux_tree \
856+
// RUN: -### %s 2>&1 \
855857
// RUN: | %{filecheck} --check-prefix=CHECK-CFI-CROSS-DSO-LINUX
856858
// CHECK-CFI-CROSS-DSO-LINUX: "{{.*}}ld{{(.exe)?}}"
857859
// CHECK-CFI-CROSS-DSO-LINUX: "--whole-archive" "{{[^"]*}}libclang_rt.cfi.a" "--no-whole-archive"
858860
// CHECK-CFI-CROSS-DSO-LINUX: -export-dynamic
859861

860862
// Cross-DSO CFI with diagnostics links just the CFI runtime.
861-
// RUN: not %clang -fsanitize=cfi -fsanitize-cfi-cross-dso -### %s 2>&1 \
863+
// RUN: not %clang -fsanitize=cfi -fsanitize-cfi-cross-dso \
862864
// RUN: -fno-sanitize-trap=cfi -fsanitize-recover=cfi \
863865
// RUN: --target=x86_64-unknown-linux -fuse-ld=ld \
864866
// RUN: -resource-dir=%S/Inputs/resource_dir \
865867
// RUN: --sysroot=%S/Inputs/basic_linux_tree \
868+
// RUN: -### %s 2>&1 \
866869
// RUN: | %{filecheck} --check-prefix=CHECK-CFI-CROSS-DSO-DIAG-LINUX
867870
// CHECK-CFI-CROSS-DSO-DIAG-LINUX: "{{.*}}ld{{(.exe)?}}"
868871
// CHECK-CFI-CROSS-DSO-DIAG-LINUX: "--whole-archive" "{{[^"]*}}libclang_rt.cfi_diag.a" "--no-whole-archive"
869872
// CHECK-CFI-CROSS-DSO-DIAG-LINUX: -export-dynamic
870873

871874
// Cross-DSO CFI on Android does not link runtime libraries.
872-
// RUN: not %clang -fsanitize=cfi -fsanitize-cfi-cross-dso -### %s 2>&1 \
875+
// RUN: not %clang -fsanitize=cfi -fsanitize-cfi-cross-dso \
873876
// RUN: --target=aarch64-linux-android -fuse-ld=ld \
874877
// RUN: -resource-dir=%S/Inputs/resource_dir \
875878
// RUN: --sysroot=%S/Inputs/basic_android_tree \
879+
// RUN: -### %s 2>&1 \
876880
// RUN: | %{filecheck} --check-prefix=CHECK-CFI-CROSS-DSO-ANDROID
877881
// CHECK-CFI-CROSS-DSO-ANDROID: "{{.*}}ld{{(.exe)?}}"
878882

879883
// Cross-DSO CFI with diagnostics on Android links just the UBSAN runtime.
880-
// RUN: not %clang -fsanitize=cfi -fsanitize-cfi-cross-dso -### %s 2>&1 \
884+
// RUN: not %clang -fsanitize=cfi -fsanitize-cfi-cross-dso \
881885
// RUN: -fno-sanitize-trap=cfi -fsanitize-recover=cfi \
882886
// RUN: --target=aarch64-linux-android -fuse-ld=ld \
883887
// RUN: -resource-dir=%S/Inputs/resource_dir \
884888
// RUN: --sysroot=%S/Inputs/basic_android_tree \
889+
// RUN: -### %s 2>&1 \
885890
// RUN: | %{filecheck} --check-prefix=CHECK-CFI-CROSS-DSO-DIAG-ANDROID
886891
// CHECK-CFI-CROSS-DSO-DIAG-ANDROID: "{{.*}}ld{{(.exe)?}}"
887892
// CHECK-CFI-CROSS-DSO-DIAG-ANDROID: "{{[^"]*}}libclang_rt.ubsan_standalone.so"

0 commit comments

Comments
 (0)