[compiler-rt] eba4a76 - [CFI] Expand test to include minimal runtime (#183646)
via llvm-commits
llvm-commits at lists.llvm.org
Mon Mar 2 21:07:23 PST 2026
Author: Vitaly Buka
Date: 2026-03-02T21:07:19-08:00
New Revision: eba4a76597dd1d655794cb5732ace534b58bd97d
URL: https://github.com/llvm/llvm-project/commit/eba4a76597dd1d655794cb5732ace534b58bd97d
DIFF: https://github.com/llvm/llvm-project/commit/eba4a76597dd1d655794cb5732ace534b58bd97d.diff
LOG: [CFI] Expand test to include minimal runtime (#183646)
`ubsan_minimal` contains some CFI tests, but it would be nice have one
on CFI side.
Added:
Modified:
compiler-rt/test/cfi/icall/bad-signature.c
Removed:
################################################################################
diff --git a/compiler-rt/test/cfi/icall/bad-signature.c b/compiler-rt/test/cfi/icall/bad-signature.c
index 183e62738bb26..ed02bccb2b5d6 100644
--- a/compiler-rt/test/cfi/icall/bad-signature.c
+++ b/compiler-rt/test/cfi/icall/bad-signature.c
@@ -7,6 +7,9 @@
// RUN: %clang_cfi_diag -g -o %t3 %s
// RUN: %t3 2>&1 | FileCheck --check-prefix=CFI-DIAG %s
+// RUN: %clang_cfi -fno-sanitize-trap=cfi -fsanitize-recover=cfi -fsanitize-minimal-runtime -o %t4 %s
+// RUN: %t4 2>&1 | FileCheck --check-prefix=CFI-MINIMAL %s
+
#include <stdio.h>
void f() {
@@ -15,13 +18,16 @@ void f() {
int main() {
// CFI: 1
// NCFI: 1
+ // CFI-MINIMAL: 1
fprintf(stderr, "1\n");
// CFI-DIAG: runtime error: control flow integrity check for type 'void (int)' failed during indirect function call
// CFI-DIAG: f defined here
+ // CFI-MINIMAL: ubsan: cfi-check-fail by 0x
((void (*)(int))f)(42); // UB here
// CFI-NOT: 2
// NCFI: 2
+ // CFI-MINIMAL: 2
fprintf(stderr, "2\n");
}
More information about the llvm-commits
mailing list