Commit d7fcb5b6 authored by Matt Arsenault's avatar Matt Arsenault
Browse files

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
3ac4299d aren't doing anything since
it wasn't really using FileCheck.
parent 42c6e420
Loading
Loading
Loading
Loading
+11 −5
Original line number Diff line number Diff line
// 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")));
@@ -25,8 +33,6 @@ int Y __attribute__((annotate(
  (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")));