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
3ac4299d37 aren't doing anything since
it wasn't really using FileCheck.
This commit is contained in:
Matt Arsenault 2023-08-12 18:59:36 -04:00
parent 42c6e4209c
commit d7fcb5b6b5

View File

@ -1,5 +1,13 @@
// RUN: %clang_cc1 -emit-llvm %s -o - | grep llvm.global.annotations
// RUN: %clang_cc1 -emit-llvm %s -o - | grep llvm.var.annotation | count 3
// RUN: %clang_cc1 -emit-llvm %s -o - | FileCheck %s
// CHECK: @.str.3 = private unnamed_addr constant [28 x i8] c"GlobalValAnnotationWithArgs\00", section "llvm.metadata"
// CHECK-NEXT: @.args = private unnamed_addr constant { i32, %struct.TestStruct } { i32 42, %struct.TestStruct { i32 1, i32 2 } }, section "llvm.metadata"
// CHECK: llvm.global.annotations
// CHECK: llvm.var.annotation
// CHECK: llvm.var.annotation
// CHECK: llvm.var.annotation
/* Global variable with attribute */
int X __attribute__((annotate("GlobalValAnnotation")));
@ -20,13 +28,11 @@ struct TestStruct {
int b;
};
int Y __attribute__((annotate(
"GlobalValAnnotationWithArgs",
"GlobalValAnnotationWithArgs",
42,
(struct TestStruct) { .a = 1, .b = 2 }
)));
// CHECK: @.str.3 = private unnamed_addr constant [28 x i8] c"GlobalValAnnotationWithArgs\00", section "llvm.metadata"
// CHECK-NEXT: @.args = private unnamed_addr constant { i32, %struct.TestStruct } { i32 42, %struct.TestStruct { i32 1, i32 2 } }, section "llvm.metadata"
int main(void) {
static int a __attribute__((annotate("GlobalValAnnotation")));