blob: 9d1cf6cec3c42c7b5a485da3b258770e8fa34cae [file] [log] [blame]
Daniel Dunbara5728872009-12-15 20:14:24 +00001// RUN: %clang_cc1 -triple=i686-apple-darwin9 -emit-llvm -o %t %s
Daniel Dunbar4fcfde42009-11-08 01:45:36 +00002// RUN: grep -e "\^{Innermost=CC}" %t | count 1
3// RUN: grep -e "{Derived=#ib32b8b3b8sb16b8b8b2b8ccb6}" %t | count 1
4// RUN: grep -e "{B1=#@c}" %t | count 1
5// RUN: grep -e "v12@0:4\[3\[4@]]8" %t | count 1
6// RUN: grep -e "r\^{S=i}" %t | count 1
Fariborz Jahanian3e1b16c2008-12-23 21:30:15 +00007// RUN: grep -e "\^{Object=#}" %t | count 1
Fariborz Jahaniane4bb68a2008-12-19 17:45:06 +00008
9@class Int1;
10
11struct Innermost {
12 unsigned char a, b;
13};
14
15@interface Int1 {
16 signed char a, b;
17 struct Innermost *innermost;
18}
19@end
20
21@implementation Int1
22@end
Fariborz Jahanian43822ea2008-12-19 23:34:38 +000023
24@interface Base
25{
26 struct objc_class *isa;
27 int full;
28 int full2: 32;
29 int _refs: 8;
30 int field2: 3;
31 unsigned f3: 8;
32 short cc;
33 unsigned g: 16;
34 int r2: 8;
35 int r3: 8;
36 int r4: 2;
37 int r5: 8;
38 char c;
39}
40@end
41
42@interface Derived: Base
43{
44 char d;
45 int _field3: 6;
46}
47@end
48
49@implementation Base
50@end
51
52@implementation Derived
53@end
54
Fariborz Jahanianadcaf542008-12-20 19:17:01 +000055@interface B1
56{
57 struct objc_class *isa;
58 Int1 *sBase;
59 char c;
60}
61@end
62
63@implementation B1
64@end
65
Fariborz Jahanian4306d3c2008-12-20 23:29:59 +000066@interface Test
67{
68 int ivar;
Fariborz Jahanian8d2c0a92009-11-30 18:43:52 +000069 __attribute__((objc_gc(weak))) SEL selector;
Fariborz Jahanian4306d3c2008-12-20 23:29:59 +000070}
Chris Lattnerc7c11b12009-04-27 01:55:56 +000071-(void) test3: (Test* [3] [4])b ;
Fariborz Jahanian60bce3e2009-11-23 20:40:50 +000072- (SEL**) meth : (SEL) arg : (SEL*****) arg1 : (SEL*)arg2 : (SEL**) arg3;
Fariborz Jahanian4306d3c2008-12-20 23:29:59 +000073@end
74
75@implementation Test
Chris Lattnerc7c11b12009-04-27 01:55:56 +000076-(void) test3: (Test* [3] [4])b {}
Fariborz Jahanian60bce3e2009-11-23 20:40:50 +000077- (SEL**) meth : (SEL) arg : (SEL*****) arg1 : (SEL*)arg2 : (SEL**) arg3 {}
Fariborz Jahanian4306d3c2008-12-20 23:29:59 +000078@end
79
Fariborz Jahanian5b8c7d92008-12-22 23:22:27 +000080struct S { int iS; };
Fariborz Jahanian4306d3c2008-12-20 23:29:59 +000081
Fariborz Jahanian3e1b16c2008-12-23 21:30:15 +000082@interface Object
83{
84 Class isa;
85}
86@end
87typedef Object MyObj;
88
Fariborz Jahanian43822ea2008-12-19 23:34:38 +000089int main()
90{
91 const char *en = @encode(Derived);
Fariborz Jahanianadcaf542008-12-20 19:17:01 +000092 const char *eb = @encode(B1);
Fariborz Jahanian5b8c7d92008-12-22 23:22:27 +000093 const char *es = @encode(const struct S *);
94 const char *ec = @encode(const struct S);
Fariborz Jahanian3e1b16c2008-12-23 21:30:15 +000095 const char *ee = @encode(MyObj *const);
Fariborz Jahanian43822ea2008-12-19 23:34:38 +000096}
97