-
Notifications
You must be signed in to change notification settings - Fork 13.5k
[NFC][CFI] Fix test from #137245 #137420
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] Fix test from #137245 #137420
Conversation
Created using spr 1.3.4
@llvm/pr-subscribers-compiler-rt-sanitizer Author: Vitaly Buka (vitalybuka) ChangesCheck if arch supports CFI. For #137245 Full diff: https://github.com/llvm/llvm-project/pull/137420.diff 4 Files Affected:
diff --git a/compiler-rt/test/ubsan_minimal/CMakeLists.txt b/compiler-rt/test/ubsan_minimal/CMakeLists.txt
index dea0b4f2c07f4..69521cc3ed885 100644
--- a/compiler-rt/test/ubsan_minimal/CMakeLists.txt
+++ b/compiler-rt/test/ubsan_minimal/CMakeLists.txt
@@ -10,9 +10,13 @@ set(UBSAN_TEST_DEPS ${SANITIZER_COMMON_LIT_TEST_DEPS})
list(APPEND UBSAN_TEST_DEPS ubsan-minimal)
foreach(arch ${UBSAN_TEST_ARCH})
+ set(CONFIG_NAME ${arch})
string(TOLOWER "-${arch}-${OS_NAME}" UBSAN_TEST_CONFIG_SUFFIX)
get_test_cc_for_arch(${arch} UBSAN_TEST_TARGET_CC UBSAN_TEST_TARGET_CFLAGS)
- set(CONFIG_NAME ${arch})
+
+ set(UBSAN_TEST_HAS_CFI ${arch} IN_LIST CFI_SUPPORTED_ARCH)
+ pythonize_bool(UBSAN_TEST_HAS_CFI)
+
configure_lit_site_cfg(
${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.py.in
${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME}/lit.site.cfg.py)
diff --git a/compiler-rt/test/ubsan_minimal/TestCases/icall.c b/compiler-rt/test/ubsan_minimal/TestCases/icall.c
index 25ef3180bf4bd..6948057663a20 100644
--- a/compiler-rt/test/ubsan_minimal/TestCases/icall.c
+++ b/compiler-rt/test/ubsan_minimal/TestCases/icall.c
@@ -1,7 +1,7 @@
// RUN: %clang -fsanitize=cfi-icall -fno-sanitize-trap=cfi-icall -fuse-ld=lld -flto -fvisibility=hidden %s -o %t && not --crash %run %t 2>&1 | FileCheck %s
// RUN: %clang -fsanitize=cfi-icall -fno-sanitize-trap=cfi-icall -fsanitize-recover=cfi-icall -fuse-ld=lld -flto -fvisibility=hidden %s -o %t && %run %t 2>&1 | FileCheck %s
-// REQUIRES: lld-available
+// REQUIRES: lld-available, cfi
void f() {}
diff --git a/compiler-rt/test/ubsan_minimal/lit.common.cfg.py b/compiler-rt/test/ubsan_minimal/lit.common.cfg.py
index 115bd244b1dd8..714241a580f9d 100644
--- a/compiler-rt/test/ubsan_minimal/lit.common.cfg.py
+++ b/compiler-rt/test/ubsan_minimal/lit.common.cfg.py
@@ -45,6 +45,9 @@ def build_invocation(compile_flags):
]: # TODO: Windows
config.unsupported = True
+if config.test_cfi:
+ config.available_features.add("cfi")
+
# Don't target x86_64h if the test machine can't execute x86_64h binaries.
if "-arch x86_64h" in target_cflags and "x86_64h" not in config.available_features:
config.unsupported = True
diff --git a/compiler-rt/test/ubsan_minimal/lit.site.cfg.py.in b/compiler-rt/test/ubsan_minimal/lit.site.cfg.py.in
index 83a28246d75af..457ddff867b84 100644
--- a/compiler-rt/test/ubsan_minimal/lit.site.cfg.py.in
+++ b/compiler-rt/test/ubsan_minimal/lit.site.cfg.py.in
@@ -5,6 +5,7 @@ config.name_suffix = "@UBSAN_TEST_CONFIG_SUFFIX@"
# Tool-specific config options.
config.target_cflags = "@UBSAN_TEST_TARGET_CFLAGS@"
config.target_arch = "@UBSAN_TEST_TARGET_ARCH@"
+config.test_cfi = "@UBSAN_TEST_HAS_CFI_PYBOOL@"
# Load common config for all compiler-rt lit tests.
lit_config.load_config(config, "@COMPILER_RT_BINARY_DIR@/test/lit.common.configured")
|
Created using spr 1.3.4
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/186/builds/8518 Here is the relevant piece of the build log for the reference
|
Check if arch supports CFI. For llvm#137245
Check if arch supports CFI. For llvm#137245
Check if arch supports CFI. For llvm#137245
Check if arch supports CFI. For llvm#137245
Check if arch supports CFI. For llvm#137245
Check if arch supports CFI.
For #137245