Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions clang/test/Driver/sanitizer-ld.c
Original file line number Diff line number Diff line change
Expand Up @@ -840,7 +840,8 @@
// CHECK-CFI-PREREQ-LINUX: '-fsanitize=cfi' only allowed with '-fvisibility='

// CFI by itself does not link runtime libraries.
// RUN: not %clang -fsanitize=cfi \
// RUN: %clang -fsanitize=cfi \
// RUN: -flto -fvisibility=hidden \
// RUN: --target=x86_64-unknown-linux -fuse-ld=ld -rtlib=platform \
// RUN: -resource-dir=%S/Inputs/resource_dir \
// RUN: --sysroot=%S/Inputs/basic_linux_tree \
Expand All @@ -849,7 +850,8 @@
// CHECK-CFI-LINUX: "{{.*}}ld{{(.exe)?}}"

// CFI with diagnostics links the UBSan runtime.
// RUN: not %clang -fsanitize=cfi -fno-sanitize-trap=cfi -fsanitize-recover=cfi \
// RUN: %clang -fsanitize=cfi -fno-sanitize-trap=cfi -fsanitize-recover=cfi \
// RUN: -flto -fvisibility=hidden \
// RUN: --target=x86_64-unknown-linux -fuse-ld=ld \
// RUN: -resource-dir=%S/Inputs/resource_dir \
// RUN: --sysroot=%S/Inputs/basic_linux_tree \
Expand All @@ -859,7 +861,8 @@
// CHECK-CFI-DIAG-LINUX: "--whole-archive" "{{[^"]*}}libclang_rt.ubsan_standalone.a" "--no-whole-archive"

// Cross-DSO CFI links the CFI runtime.
// RUN: not %clang -fsanitize=cfi -fsanitize-cfi-cross-dso \
// RUN: %clang -fsanitize=cfi -fsanitize-cfi-cross-dso \
// RUN: -flto -fvisibility=hidden \
// RUN: --target=x86_64-unknown-linux -fuse-ld=ld \
// RUN: -resource-dir=%S/Inputs/resource_dir \
// RUN: --sysroot=%S/Inputs/basic_linux_tree \
Expand All @@ -870,7 +873,8 @@
// CHECK-CFI-CROSS-DSO-LINUX: -export-dynamic

// Cross-DSO CFI with diagnostics links just the CFI runtime.
// RUN: not %clang -fsanitize=cfi -fsanitize-cfi-cross-dso \
// RUN: %clang -fsanitize=cfi -fsanitize-cfi-cross-dso \
// RUN: -flto -fvisibility=hidden \
// RUN: -fno-sanitize-trap=cfi -fsanitize-recover=cfi \
// RUN: --target=x86_64-unknown-linux -fuse-ld=ld \
// RUN: -resource-dir=%S/Inputs/resource_dir \
Expand All @@ -882,7 +886,8 @@
// CHECK-CFI-CROSS-DSO-DIAG-LINUX: -export-dynamic

// Cross-DSO CFI on Android does not link runtime libraries.
// RUN: not %clang -fsanitize=cfi -fsanitize-cfi-cross-dso \
// RUN: %clang -fsanitize=cfi -fsanitize-cfi-cross-dso \
// RUN: -flto -fvisibility=hidden \
// RUN: --target=aarch64-linux-android -fuse-ld=ld \
// RUN: -resource-dir=%S/Inputs/resource_dir \
// RUN: --sysroot=%S/Inputs/basic_android_tree \
Expand All @@ -891,7 +896,8 @@
// CHECK-CFI-CROSS-DSO-ANDROID: "{{.*}}ld{{(.exe)?}}"

// Cross-DSO CFI with diagnostics on Android links just the UBSAN runtime.
// RUN: not %clang -fsanitize=cfi -fsanitize-cfi-cross-dso \
// RUN: %clang -fsanitize=cfi -fsanitize-cfi-cross-dso \
// RUN: -flto -fvisibility=hidden \
// RUN: -fno-sanitize-trap=cfi -fsanitize-recover=cfi \
// RUN: --target=aarch64-linux-android -fuse-ld=ld \
// RUN: -resource-dir=%S/Inputs/resource_dir \
Expand Down
Loading