[llvm-commits] CVS: llvm/test/CFrontend/2007-06-15-AnnotateAttribute.c
Tanya Lattner
tonic at nondot.org
Fri Jun 15 13:53:09 PDT 2007
Changes in directory llvm/test/CFrontend:
2007-06-15-AnnotateAttribute.c added (r1.1)
---
Log message:
test case for annotate attribute
---
Diffs of the changes: (+25 -0)
2007-06-15-AnnotateAttribute.c | 25 +++++++++++++++++++++++++
1 files changed, 25 insertions(+)
Index: llvm/test/CFrontend/2007-06-15-AnnotateAttribute.c
diff -c /dev/null llvm/test/CFrontend/2007-06-15-AnnotateAttribute.c:1.1
*** /dev/null Fri Jun 15 15:52:57 2007
--- llvm/test/CFrontend/2007-06-15-AnnotateAttribute.c Fri Jun 15 15:52:47 2007
***************
*** 0 ****
--- 1,25 ----
+ // RUN: %llvmgxx -c -emit-llvm %s -o - | llvm-dis | grep llvm.global.annotations | grep foo \
+ // RUN: | grep @X | grep @a
+ // RUN: %llvmgxx -c -emit-llvm %s -o - | llvm-dis | grep -c llvm.var.annotation | grep 3
+
+ #include <stdio.h>
+
+ /* Global variable with attribute */
+ int X __attribute__((annotate("GlobalValAnnotation")));
+
+ /* Function with attribute */
+ int foo(int y) __attribute__((annotate("GlobalValAnnotation")))
+ __attribute__((noinline));
+
+ int foo(int y __attribute__((annotate("LocalValAnnotation")))) {
+ int x __attribute__((annotate("LocalValAnnotation")));
+ x = 34;
+ return y + x;
+ }
+
+ int main() {
+ static int a __attribute__((annotate("GlobalValAnnotation")));
+ a = foo(2);
+ printf("hello world%d\n", a);
+ return 0;
+ }
More information about the llvm-commits
mailing list