Add test case for ptr annotation.
authorTanya Lattner <tonic@nondot.org>
Wed, 12 Nov 2008 16:12:27 +0000 (16:12 +0000)
committerTanya Lattner <tonic@nondot.org>
Wed, 12 Nov 2008 16:12:27 +0000 (16:12 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59142 91177308-0d34-0410-b5e6-96231b3b80d8

test/FrontendC/2008-11-11-AnnotateStructFieldAttribute.c [new file with mode: 0644]

diff --git a/test/FrontendC/2008-11-11-AnnotateStructFieldAttribute.c b/test/FrontendC/2008-11-11-AnnotateStructFieldAttribute.c
new file mode 100644 (file)
index 0000000..fa5713e
--- /dev/null
@@ -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;
+}
+