[llvm-commits] [llvm] r59142 - /llvm/trunk/test/FrontendC/2008-11-11-AnnotateStructFieldAttribute.c
Tanya Lattner
tonic at nondot.org
Wed Nov 12 08:12:32 PST 2008
Author: tbrethou
Date: Wed Nov 12 10:12:27 2008
New Revision: 59142
URL: http://llvm.org/viewvc/llvm-project?rev=59142&view=rev
Log:
Add test case for ptr annotation.
Added:
llvm/trunk/test/FrontendC/2008-11-11-AnnotateStructFieldAttribute.c
Added: llvm/trunk/test/FrontendC/2008-11-11-AnnotateStructFieldAttribute.c
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/2008-11-11-AnnotateStructFieldAttribute.c?rev=59142&view=auto
==============================================================================
--- llvm/trunk/test/FrontendC/2008-11-11-AnnotateStructFieldAttribute.c (added)
+++ llvm/trunk/test/FrontendC/2008-11-11-AnnotateStructFieldAttribute.c Wed Nov 12 10:12:27 2008
@@ -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;
+}
+
More information about the llvm-commits
mailing list