Skip to content

Commit 77011b0

Browse files
committed
[Clang] Fix path-sensitivity in ubsan-bool.m test (NFC)
This test was failing whenever the path contained the string "f1", e.g. as part of a commit hash. Double-fix the issue by both not embedding the path in the IR at all, and making the CHECK-LABELs more specific.
1 parent 8322035 commit 77011b0

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

clang/test/CodeGenObjC/ubsan-bool.m

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
// RUN: %clang_cc1 -no-enable-noundef-analysis -x objective-c -emit-llvm -triple x86_64-apple-macosx10.10.0 -fsanitize=bool %s -o - -w | FileCheck %s -check-prefixes=SHARED,OBJC
2-
// RUN: %clang_cc1 -no-enable-noundef-analysis -x objective-c++ -emit-llvm -triple x86_64-apple-macosx10.10.0 -fsanitize=bool %s -o - -w | FileCheck %s -check-prefixes=SHARED,OBJC
3-
// RUN: %clang_cc1 -no-enable-noundef-analysis -x c -emit-llvm -triple x86_64-apple-macosx10.10.0 -fsanitize=bool %s -o - | FileCheck %s -check-prefixes=SHARED,C
1+
// RUN: %clang_cc1 -no-enable-noundef-analysis -x objective-c -emit-llvm -triple x86_64-apple-macosx10.10.0 -fsanitize=bool -o - -w < %s | FileCheck %s -check-prefixes=SHARED,OBJC
2+
// RUN: %clang_cc1 -no-enable-noundef-analysis -x objective-c++ -emit-llvm -triple x86_64-apple-macosx10.10.0 -fsanitize=bool -o - -w < %s | FileCheck %s -check-prefixes=SHARED,OBJC
3+
// RUN: %clang_cc1 -no-enable-noundef-analysis -x c -emit-llvm -triple x86_64-apple-macosx10.10.0 -fsanitize=bool -o - < %s | FileCheck %s -check-prefixes=SHARED,C
44

55
typedef signed char BOOL;
66

7-
// SHARED-LABEL: f1
7+
// SHARED-LABEL: define{{.*}}f1
88
BOOL f1(void) {
99
// OBJC: call void @__ubsan_handle_load_invalid_value
1010
// C-NOT: call void @__ubsan_handle_load_invalid_value
@@ -17,7 +17,7 @@ BOOL f1(void) {
1717
BOOL b1 : 1;
1818
};
1919

20-
// SHARED-LABEL: f2
20+
// SHARED-LABEL: define{{.*}}f2
2121
BOOL f2(struct S1 *s) {
2222
// OBJC: [[LOAD:%.*]] = load i8, ptr {{.*}}
2323
// OBJC: [[SHL:%.*]] = shl i8 [[LOAD]], 7
@@ -52,7 +52,7 @@ @implementation I1
5252
// OBJC: call void @__ubsan_handle_load_invalid_value
5353

5454
// Also check direct accesses to the ivar.
55-
// OBJC-LABEL: f3
55+
// OBJC-LABEL: define{{.*}}f3
5656
BOOL f3(I1 *i) {
5757
// OBJC: [[LOAD:%.*]] = load i8, ptr {{.*}}
5858
// OBJC: [[SHL:%.*]] = shl i8 [[LOAD]], 7

0 commit comments

Comments
 (0)