From 02fa4f4e01ae24ac1507b3c86902a14ee2815319 Mon Sep 17 00:00:00 2001 From: Tanya Lattner Date: Wed, 12 Nov 2008 16:12:27 +0000 Subject: [PATCH] Add test case for ptr annotation. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59142 91177308-0d34-0410-b5e6-96231b3b80d8 --- .../2008-11-11-AnnotateStructFieldAttribute.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 test/FrontendC/2008-11-11-AnnotateStructFieldAttribute.c 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; +} +