Skip to content

Commit eba4a76

Browse files
authored
[CFI] Expand test to include minimal runtime (llvm#183646)
`ubsan_minimal` contains some CFI tests, but it would be nice have one on CFI side.
1 parent da8929b commit eba4a76

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

compiler-rt/test/cfi/icall/bad-signature.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
// RUN: %clang_cfi_diag -g -o %t3 %s
88
// RUN: %t3 2>&1 | FileCheck --check-prefix=CFI-DIAG %s
99

10+
// RUN: %clang_cfi -fno-sanitize-trap=cfi -fsanitize-recover=cfi -fsanitize-minimal-runtime -o %t4 %s
11+
// RUN: %t4 2>&1 | FileCheck --check-prefix=CFI-MINIMAL %s
12+
1013
#include <stdio.h>
1114

1215
void f() {
@@ -15,13 +18,16 @@ void f() {
1518
int main() {
1619
// CFI: 1
1720
// NCFI: 1
21+
// CFI-MINIMAL: 1
1822
fprintf(stderr, "1\n");
1923

2024
// CFI-DIAG: runtime error: control flow integrity check for type 'void (int)' failed during indirect function call
2125
// CFI-DIAG: f defined here
26+
// CFI-MINIMAL: ubsan: cfi-check-fail by 0x
2227
((void (*)(int))f)(42); // UB here
2328

2429
// CFI-NOT: 2
2530
// NCFI: 2
31+
// CFI-MINIMAL: 2
2632
fprintf(stderr, "2\n");
2733
}

0 commit comments

Comments
 (0)