From cd50f910f4d1a6bb54fd8968f067febbc7320f28 Mon Sep 17 00:00:00 2001 From: Sameer Sahasrabuddhe Date: Tue, 13 Dec 2022 11:15:15 +0530 Subject: [PATCH] [Clang][NFC] Prevent lit tests from matching substrings in current path --- .../2004-01-11-DynamicInitializedConstant.cpp | 6 ++++++ clang/test/CodeGenCXX/ignored-bitfield-conditional.cpp | 10 +++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/clang/test/CodeGenCXX/2004-01-11-DynamicInitializedConstant.cpp b/clang/test/CodeGenCXX/2004-01-11-DynamicInitializedConstant.cpp index 0c9333fb6d7a..0cd8419185ae 100644 --- a/clang/test/CodeGenCXX/2004-01-11-DynamicInitializedConstant.cpp +++ b/clang/test/CodeGenCXX/2004-01-11-DynamicInitializedConstant.cpp @@ -1,6 +1,12 @@ // RUN: %clang_cc1 -emit-llvm -o - %s | FileCheck %s +// Catch the beginning and the end of the IR. This prevents the CHECK-NOT from +// matching a spurious "constant" string in file paths printed in the output. +// +// CHECK-LABEL: target triple // CHECK-NOT: constant +// CHECK-LABEL: attributes + extern int X; const int Y = X; const int* foo() { return &Y; } diff --git a/clang/test/CodeGenCXX/ignored-bitfield-conditional.cpp b/clang/test/CodeGenCXX/ignored-bitfield-conditional.cpp index 7700e97ae9d5..d5763f49f954 100644 --- a/clang/test/CodeGenCXX/ignored-bitfield-conditional.cpp +++ b/clang/test/CodeGenCXX/ignored-bitfield-conditional.cpp @@ -7,7 +7,7 @@ struct S { }; void use(bool cond, struct S s1, struct S s2, int val1, int val2) { - // CHECK: define {{.*}}use{{.*}}( + // CHECK-LABEL: define {{.*}}use{{.*}}( // CHECK: %[[S1:.+]] = alloca %struct.S // CHECK: %[[S2:.+]] = alloca %struct.S // CHECK: %[[COND:.+]] = alloca i8 @@ -86,7 +86,7 @@ void use(bool cond, struct S s1, struct S s2, int val1, int val2) { void use2(bool cond1, bool cond2, struct S s1, int val1, int val2, int val3) { - // CHECK: define {{.*}}use2{{.*}}( + // CHECK-LABEL: define {{.*}}use2{{.*}}( // CHECK: %[[S1:.+]] = alloca %struct.S // CHECK: %[[COND1:.+]] = alloca i8 // CHECK: %[[COND2:.+]] = alloca i8 @@ -141,7 +141,11 @@ void use2(bool cond1, bool cond2, struct S s1, int val1, int val2, int val3) { // CHECK: store i16 %[[BF_SET]], ptr %[[S1]] // CHECK: br label %[[END:.+]] - // CHECK[[END]]: + // CHECK: [[END]]: // CHECK-NOT: phi // Nothing left to do here. } + +// Catch the end of the IR. This prevents the CHECK-NOT above from matching a +// spurious "phi" in file paths printed in the output. +// CHECK-LABEL: attributes