From 2f85a6450a00cff4b178323f196393cf84cf1c47 Mon Sep 17 00:00:00 2001 From: Fariborz Jahanian Date: Tue, 20 Jan 2009 20:04:12 +0000 Subject: Detailed documentation for encoding of properties and a test case. llvm-svn: 62607 --- clang/test/CodeGenObjC/objc2-protocol-enc.m | 43 +++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 clang/test/CodeGenObjC/objc2-protocol-enc.m (limited to 'clang/test/CodeGenObjC') diff --git a/clang/test/CodeGenObjC/objc2-protocol-enc.m b/clang/test/CodeGenObjC/objc2-protocol-enc.m new file mode 100644 index 00000000000..b0c1e7ad575 --- /dev/null +++ b/clang/test/CodeGenObjC/objc2-protocol-enc.m @@ -0,0 +1,43 @@ +// RUN: clang -triple=i686-apple-darwin9 -fnext-runtime -emit-llvm -o %t %s && +// RUN: grep -e "T@\\\22\\\22" %t && +// RUN: grep -e "T@\\\22\\\22" %t && +// RUN: grep -e "T@\\\22\\\22" %t && +// RUN: grep -e "T@\\\22Foo\\\22" %t + +@protocol X, Y, Z; +@class Foo; + +@protocol Proto +@property (copy) id x; +@property (copy) id xy; +@property (copy) id xyz; +@property(copy) Foo *fooxyz; +@end + +@interface Intf +{ +id IVAR_x; +id IVAR_xy; +id IVAR_xyz; +Foo *IVAR_Fooxyz; +} +@end + +@implementation Intf +@dynamic x, xy, xyz, fooxyz; +@end + +/** +This protocol should generate the following metadata: +struct objc_property_list __Protocol_Test_metadata = { + sizeof(struct objc_property), 4, + { + { "x", "T@\"\"" }, + { "xy", "T@\"\"" }, + { "xyz", "T@\"\"" }, + { "fooxyz", "T@\"Foo\"" } + } +}; + +"T@\"\",D +*/ -- cgit v1.2.3