xref: /aosp_15_r20/external/clang/test/CodeGenObjC/objc2-protocol-enc.m (revision 67e74705e28f6214e480b399dd47ea732279e315)
1*67e74705SXin Li// RUN: %clang_cc1 -triple=i686-apple-darwin9 -emit-llvm -o %t %s
2*67e74705SXin Li// RUN: grep -e "T@\\\22<X>\\\22" %t
3*67e74705SXin Li// RUN: grep -e "T@\\\22<X><Y>\\\22" %t
4*67e74705SXin Li// RUN: grep -e "T@\\\22<X><Y><Z>\\\22" %t
5*67e74705SXin Li// RUN: grep -e "T@\\\22Foo<X><Y><Z>\\\22" %t
6*67e74705SXin Li
7*67e74705SXin Li@protocol X, Y, Z;
8*67e74705SXin Li@class Foo;
9*67e74705SXin Li
10*67e74705SXin Li@protocol Proto
11*67e74705SXin Li@property (copy) id <X> x;
12*67e74705SXin Li@property (copy) id <X, Y> xy;
13*67e74705SXin Li@property (copy) id <X, Y, Z> xyz;
14*67e74705SXin Li@property(copy)  Foo <X, Y, Z> *fooxyz;
15*67e74705SXin Li@end
16*67e74705SXin Li
17*67e74705SXin Li@interface Intf <Proto>
18*67e74705SXin Li{
19*67e74705SXin Liid <X> IVAR_x;
20*67e74705SXin Liid <X, Y> IVAR_xy;
21*67e74705SXin Liid <X, Y, Z> IVAR_xyz;
22*67e74705SXin LiFoo <X, Y, Z> *IVAR_Fooxyz;
23*67e74705SXin Li}
24*67e74705SXin Li@end
25*67e74705SXin Li
26*67e74705SXin Li@implementation Intf
27*67e74705SXin Li@dynamic x, xy, xyz, fooxyz;
28*67e74705SXin Li@end
29*67e74705SXin Li
30*67e74705SXin Li/**
31*67e74705SXin LiThis protocol should generate the following metadata:
32*67e74705SXin Listruct objc_property_list __Protocol_Test_metadata = {
33*67e74705SXin Li  sizeof(struct objc_property), 4,
34*67e74705SXin Li  {
35*67e74705SXin Li    { "x", "T@\"<X>\"" },
36*67e74705SXin Li    { "xy", "T@\"<X><Y>\"" },
37*67e74705SXin Li    { "xyz", "T@\"<X><Y><Z>\"" },
38*67e74705SXin Li    { "fooxyz", "T@\"Foo<X><Y><Z>\"" }
39*67e74705SXin Li  }
40*67e74705SXin Li};
41*67e74705SXin Li
42*67e74705SXin Li"T@\"<X><Y><Z>\",D
43*67e74705SXin Li*/
44