diff --git a/test/FrontendC/2008-11-11-AnnotateStructFieldAttribute.c b/test/FrontendC/2008-11-11-AnnotateStructFieldAttribute.c new file mode 100644 index 00000000000..fa5713e2482 --- /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 + +/* 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; +} +