Skip to content

Commit

Permalink
[Clang] Fix path-sensitivity in ubsan-bool.m test (NFC)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
nikic authored and kstoimenov committed Aug 15, 2024
1 parent 8efaaba commit 6a5bb30
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions clang/test/CodeGenObjC/ubsan-bool.m
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// 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
// 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
// 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
// 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
// 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
// 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

typedef signed char BOOL;

// SHARED-LABEL: f1
// SHARED-LABEL: define{{.*}}f1
BOOL f1(void) {
// OBJC: call void @__ubsan_handle_load_invalid_value
// C-NOT: call void @__ubsan_handle_load_invalid_value
Expand All @@ -17,7 +17,7 @@ BOOL f1(void) {
BOOL b1 : 1;
};

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

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

0 comments on commit 6a5bb30

Please sign in to comment.