summaryrefslogtreecommitdiff
path: root/test/FrontendC/2008-11-11-AnnotateStructFieldAttribute.c
diff options
context:
space:
mode:
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 000000000000..fa5713e2482b
--- /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;
+}
+