-
Notifications
You must be signed in to change notification settings - Fork 13.2k
[NFC][CFI] Add test to check for '-flto' and '-fvisibility=' flags #135892
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[NFC][CFI] Add test to check for '-flto' and '-fvisibility=' flags #135892
Conversation
Created using spr 1.3.4 [skip ci]
Created using spr 1.3.4
@llvm/pr-subscribers-clang Author: Vitaly Buka (vitalybuka) ChangesFull diff: https://github.com/llvm/llvm-project/pull/135892.diff 1 Files Affected:
diff --git a/clang/test/Driver/sanitizer-ld.c b/clang/test/Driver/sanitizer-ld.c
index 52c1f6bf96242..67ca33d676d20 100644
--- a/clang/test/Driver/sanitizer-ld.c
+++ b/clang/test/Driver/sanitizer-ld.c
@@ -829,6 +829,16 @@
// CHECK-NSAN-UBSAN: "--whole-archive" "{{[^"]*}}libclang_rt.nsan.a" "--no-whole-archive"
+// CFI requirements.
+// RUN: not %clang -fsanitize=cfi \
+// 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 \
+// RUN: -### %s 2>&1 \
+// RUN: | %{filecheck} --check-prefix=CHECK-CFI-PREREQ-LINUX
+// CHECK-CFI-PREREQ-LINUX: '-fsanitize=cfi' only allowed with '-flto'
+// CHECK-CFI-PREREQ-LINUX: '-fsanitize=cfi' only allowed with '-fvisibility='
+
// CFI by itself does not link runtime libraries.
// RUN: not %clang -fsanitize=cfi \
// RUN: --target=x86_64-unknown-linux -fuse-ld=ld -rtlib=platform \
|
@llvm/pr-subscribers-clang-driver Author: Vitaly Buka (vitalybuka) ChangesFull diff: https://github.com/llvm/llvm-project/pull/135892.diff 1 Files Affected:
diff --git a/clang/test/Driver/sanitizer-ld.c b/clang/test/Driver/sanitizer-ld.c
index 52c1f6bf96242..67ca33d676d20 100644
--- a/clang/test/Driver/sanitizer-ld.c
+++ b/clang/test/Driver/sanitizer-ld.c
@@ -829,6 +829,16 @@
// CHECK-NSAN-UBSAN: "--whole-archive" "{{[^"]*}}libclang_rt.nsan.a" "--no-whole-archive"
+// CFI requirements.
+// RUN: not %clang -fsanitize=cfi \
+// 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 \
+// RUN: -### %s 2>&1 \
+// RUN: | %{filecheck} --check-prefix=CHECK-CFI-PREREQ-LINUX
+// CHECK-CFI-PREREQ-LINUX: '-fsanitize=cfi' only allowed with '-flto'
+// CHECK-CFI-PREREQ-LINUX: '-fsanitize=cfi' only allowed with '-fvisibility='
+
// CFI by itself does not link runtime libraries.
// RUN: not %clang -fsanitize=cfi \
// RUN: --target=x86_64-unknown-linux -fuse-ld=ld -rtlib=platform \
|
Created using spr 1.3.4 [skip ci]
Created using spr 1.3.4 [skip ci]
Created using spr 1.3.4 [skip ci]
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/59/builds/16136 Here is the relevant piece of the build log for the reference
|
No description provided.