summaryrefslogtreecommitdiff
path: root/test/FrontendC/2008-11-11-AnnotateStructFieldAttribute.c
diff options
context:
space:
mode:
authorTanya Lattner <tonic@nondot.org>2008-11-12 16:12:27 +0000
committerTanya Lattner <tonic@nondot.org>2008-11-12 16:12:27 +0000
commit02fa4f4e01ae24ac1507b3c86902a14ee2815319 (patch)
treeb06b897ce2617b9f24e04445570d7a31686d59c4 /test/FrontendC/2008-11-11-AnnotateStructFieldAttribute.c
parent6766572dcbb00008c14f66bc81d494356ce85268 (diff)
downloadllvm-02fa4f4e01ae24ac1507b3c86902a14ee2815319.tar.gz
llvm-02fa4f4e01ae24ac1507b3c86902a14ee2815319.tar.bz2
llvm-02fa4f4e01ae24ac1507b3c86902a14ee2815319.tar.xz
Add test case for ptr annotation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59142 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/FrontendC/2008-11-11-AnnotateStructFieldAttribute.c')
-rw-r--r--test/FrontendC/2008-11-11-AnnotateStructFieldAttribute.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/FrontendC/2008-11-11-AnnotateStructFieldAttribute.c b/test/FrontendC/2008-11-11-AnnotateStructFieldAttribute.c
new file mode 100644
index 0000000000..fa5713e248
--- /dev/null
+++ b/test/FrontendC/2008-11-11-AnnotateStructFieldAttribute.c
@@ -0,0 +1,18 @@
+// RUN: %llvmgcc -c -emit-llvm %s -o - | llvm-dis | grep llvm.ptr.annotation | count 3
+
+#include <stdio.h>
+
+/* Struct with element X being annotated */
+struct foo {
+ int X __attribute__((annotate("StructAnnotation")));
+ int Y;
+ int Z;
+};
+
+
+void test(struct foo *F) {
+ F->X = 42;
+ F->Z = 1;
+ F->Y = F->X;
+}
+