1 // RUN: %llvmgxx -c -emit-llvm %s -o - | llvm-dis | grep llvm.global.annotations | grep foo \
2 // RUN: | grep @X | grep @a
3 // RUN: %llvmgxx -c -emit-llvm %s -o - | llvm-dis | grep -c llvm.var.annotation | grep 3
7 /* Global variable with attribute */
8 int X __attribute__((annotate("GlobalValAnnotation")));
10 /* Function with attribute */
11 int foo(int y) __attribute__((annotate("GlobalValAnnotation")))
12 __attribute__((noinline));
14 int foo(int y __attribute__((annotate("LocalValAnnotation")))) {
15 int x __attribute__((annotate("LocalValAnnotation")));
21 static int a __attribute__((annotate("GlobalValAnnotation")));
23 printf("hello world%d\n", a);