1 // RUN: %clang_cc1 -emit-llvm %s -o - | FileCheck %s
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"
6 // CHECK: llvm.global.annotations
8 // CHECK: llvm.var.annotation
9 // CHECK: llvm.var.annotation
10 // CHECK: llvm.var.annotation
12 /* Global variable with attribute */
13 int X
__attribute__((annotate("GlobalValAnnotation")));
15 /* Function with attribute */
16 int foo(int y
) __attribute__((annotate("GlobalValAnnotation")))
17 __attribute__((noinline
));
19 int foo(int y
__attribute__((annotate("LocalValAnnotation")))) {
20 int x
__attribute__((annotate("LocalValAnnotation")));
25 /* Attribute with struct argument. */
30 int Y
__attribute__((annotate(
31 "GlobalValAnnotationWithArgs",
33 (struct TestStruct
) { .a
= 1, .b
= 2 }
38 static int a
__attribute__((annotate("GlobalValAnnotation")));