Skip to content

Commit d7fcb5b

Browse files
committed
clang: Don't use grep in a test
Issue #10894 seems to claim this wasn't working. The test does seem to work as intended, except the CHECKs added in 3ac4299 aren't doing anything since it wasn't really using FileCheck.
1 parent 42c6e42 commit d7fcb5b

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

clang/test/CodeGen/2007-06-15-AnnotateAttribute.c

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
1-
// RUN: %clang_cc1 -emit-llvm %s -o - | grep llvm.global.annotations
2-
// RUN: %clang_cc1 -emit-llvm %s -o - | grep llvm.var.annotation | count 3
1+
// RUN: %clang_cc1 -emit-llvm %s -o - | FileCheck %s
2+
3+
// CHECK: @.str.3 = private unnamed_addr constant [28 x i8] c"GlobalValAnnotationWithArgs\00", section "llvm.metadata"
4+
// CHECK-NEXT: @.args = private unnamed_addr constant { i32, %struct.TestStruct } { i32 42, %struct.TestStruct { i32 1, i32 2 } }, section "llvm.metadata"
5+
6+
// CHECK: llvm.global.annotations
7+
8+
// CHECK: llvm.var.annotation
9+
// CHECK: llvm.var.annotation
10+
// CHECK: llvm.var.annotation
311

412
/* Global variable with attribute */
513
int X __attribute__((annotate("GlobalValAnnotation")));
@@ -20,13 +28,11 @@ struct TestStruct {
2028
int b;
2129
};
2230
int Y __attribute__((annotate(
23-
"GlobalValAnnotationWithArgs",
31+
"GlobalValAnnotationWithArgs",
2432
42,
2533
(struct TestStruct) { .a = 1, .b = 2 }
2634
)));
2735

28-
// CHECK: @.str.3 = private unnamed_addr constant [28 x i8] c"GlobalValAnnotationWithArgs\00", section "llvm.metadata"
29-
// CHECK-NEXT: @.args = private unnamed_addr constant { i32, %struct.TestStruct } { i32 42, %struct.TestStruct { i32 1, i32 2 } }, section "llvm.metadata"
3036

3137
int main(void) {
3238
static int a __attribute__((annotate("GlobalValAnnotation")));

0 commit comments

Comments
 (0)