[clang] 5131f44 - Simplify clang/test/CodeGen/annotations-global.c CHECK lines

Alex Richardson via cfe-commits cfe-commits at lists.llvm.org
Thu Dec 8 12:52:08 PST 2022


Author: Alex Richardson
Date: 2022-12-08T20:44:40Z
New Revision: 5131f444ee7045d58f72fc99e2ac69792e8b7158

URL: https://github.com/llvm/llvm-project/commit/5131f444ee7045d58f72fc99e2ac69792e8b7158
DIFF: https://github.com/llvm/llvm-project/commit/5131f444ee7045d58f72fc99e2ac69792e8b7158.diff

LOG: Simplify clang/test/CodeGen/annotations-global.c CHECK lines

There is no need to run FileCheck 5 times, we can use CHECK-DAG instead.

Added: 
    

Modified: 
    clang/test/CodeGen/annotations-global.c

Removed: 
    


################################################################################
diff  --git a/clang/test/CodeGen/annotations-global.c b/clang/test/CodeGen/annotations-global.c
index 49791094a76d..d6e6f7de8a95 100644
--- a/clang/test/CodeGen/annotations-global.c
+++ b/clang/test/CodeGen/annotations-global.c
@@ -1,10 +1,4 @@
-// RUN: %clang_cc1 %s -emit-llvm -o -
-// RUN: %clang_cc1 %s -emit-llvm -o %t1
-// RUN: FileCheck --check-prefix=FOO %s < %t1
-// RUN: FileCheck --check-prefix=A %s < %t1
-// RUN: FileCheck --check-prefix=BAR %s < %t1
-// RUN: FileCheck --check-prefix=FOOS %s < %t1
-// RUN: FileCheck --check-prefix=ADDRSPACE %s < %t1
+// RUN: %clang_cc1 %s -emit-llvm -o - | FileCheck %s --implicit-check-not='section "llvm.metadata"'
 // RUN: %clang_cc1 %s -triple r600 -emit-llvm -o - | FileCheck %s --check-prefix AS1-GLOBALS
 // END.
 
@@ -19,34 +13,36 @@ void __attribute((annotate("ann_a_0"))) __attribute((annotate("ann_a_1"))) a(cha
 
 __attribute((address_space(1))) __attribute__((annotate("addrspace1_ann"))) char addrspace1_var;
 
-// FOOS: target triple
-// FOOS: private unnamed_addr constant [7 x i8] c"sfoo_{{.}}\00", section "llvm.metadata"
-// FOOS: private unnamed_addr constant [7 x i8] c"sfoo_{{.}}\00", section "llvm.metadata"
-// FOOS-NOT: sfoo_
-// FOOS: @llvm.global.annotations = appending global [11 x { ptr, ptr, ptr, i32, ptr }] {{.*}}ptr @sfoo{{.*}}ptr @sfoo{{.*}}, section "llvm.metadata"
-
-// FOO: target triple
-// FOO: private unnamed_addr constant [6 x i8] c"foo_{{.}}\00", section "llvm.metadata"
-// FOO: private unnamed_addr constant [6 x i8] c"foo_{{.}}\00", section "llvm.metadata"
-// FOO-NOT: foo_
-// FOO: @llvm.global.annotations = appending global [11 x { ptr, ptr, ptr, i32, ptr }] {{.*}}ptr @foo{{.*}}ptr @foo{{.*}}, section "llvm.metadata"
-
-// A: target triple
-// A: private unnamed_addr constant [8 x i8] c"ann_a_{{.}}\00", section "llvm.metadata"
-// A: private unnamed_addr constant [8 x i8] c"ann_a_{{.}}\00", section "llvm.metadata"
-// A: private unnamed_addr constant [8 x i8] c"ann_a_{{.}}\00", section "llvm.metadata"
-// A: private unnamed_addr constant [8 x i8] c"ann_a_{{.}}\00", section "llvm.metadata"
-// A-NOT: ann_a_
-// A: @llvm.global.annotations = appending global [11 x { ptr, ptr, ptr, i32, ptr }] {{.*}}ptr @a{{.*}}ptr @a{{.*}}ptr @a{{.*}}ptr @a{{.*}}, section "llvm.metadata"
-
-// BAR: target triple
-// BAR: private unnamed_addr constant [6 x i8] c"bar_{{.}}\00", section "llvm.metadata"
-// BAR: private unnamed_addr constant [6 x i8] c"bar_{{.}}\00", section "llvm.metadata"
-// BAR-NOT: bar_
-// BAR: @llvm.global.annotations = appending global [11 x { ptr, ptr, ptr, i32, ptr }] {{.*}}ptr @a.bar{{.*}}ptr @a.bar{{.*}}, section "llvm.metadata"
-
-// ADDRSPACE: target triple
-// ADDRSPACE: @llvm.global.annotations = appending global {{.*}} addrspacecast (ptr addrspace(1) @addrspace1_var to ptr), {{.*}}
+// CHECK: target triple
+// CHECK-DAG: private unnamed_addr constant [7 x i8] c"sfoo_0\00", section "llvm.metadata"
+// CHECK-DAG: private unnamed_addr constant [7 x i8] c"sfoo_1\00", section "llvm.metadata"
+
+// CHECK-DAG: private unnamed_addr constant [6 x i8] c"foo_0\00", section "llvm.metadata"
+// CHECK-DAG: private unnamed_addr constant [6 x i8] c"foo_1\00", section "llvm.metadata"
+
+// CHECK-DAG: private unnamed_addr constant [8 x i8] c"ann_a_0\00", section "llvm.metadata"
+// CHECK-DAG: private unnamed_addr constant [8 x i8] c"ann_a_1\00", section "llvm.metadata"
+// CHECK-DAG: private unnamed_addr constant [8 x i8] c"ann_a_2\00", section "llvm.metadata"
+// CHECK-DAG: private unnamed_addr constant [8 x i8] c"ann_a_3\00", section "llvm.metadata"
+
+// CHECK-DAG: private unnamed_addr constant [6 x i8] c"bar_0\00", section "llvm.metadata"
+// CHECK-DAG: private unnamed_addr constant [6 x i8] c"bar_1\00", section "llvm.metadata"
+
+// CHECK-DAG: private unnamed_addr constant [15 x i8] c"addrspace1_ann\00", section "llvm.metadata"
+
+// CHECK: @llvm.global.annotations = appending global [11 x { ptr, ptr, ptr, i32, ptr }] [{
+// CHECK-SAME: { ptr @a.bar,
+// CHECK-SAME: { ptr @a.bar,
+// CHECK-SAME: { ptr @a,
+// CHECK-SAME: { ptr @a,
+// CHECK-SAME: { ptr @a,
+// CHECK-SAME: { ptr @a,
+// CHECK-SAME: { ptr @sfoo,
+// CHECK-SAME: { ptr @sfoo,
+// CHECK-SAME: { ptr @foo,
+// CHECK-SAME: { ptr @foo,
+// CHECK-SAME: { ptr addrspacecast (ptr addrspace(1) @addrspace1_var to ptr),
+// CHECK-SAME: }], section "llvm.metadata"
 
 // AS1-GLOBALS: target datalayout = "{{.+}}-A5-G1"
 // AS1-GLOBALS: @llvm.global.annotations = appending addrspace(1) global [11 x { ptr addrspace(1), ptr addrspace(4), ptr addrspace(4), i32, ptr addrspace(4) }]


        


More information about the cfe-commits mailing list