1// RUN: clang-cc -triple=i686-apple-darwin9 -fnext-runtime -emit-llvm -o %t %s &&
2// 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 &&
7// RUN: grep -e "\^{Object=#}" %t | count 1
8
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
23
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
55@interface B1
56{
57    struct objc_class *isa;
58    Int1 *sBase;
59    char c;
60}
61@end
62
63@implementation B1
64@end
65
66@interface Test
67{
68	int ivar;
69}
70-(void) test3: (Test*  [3] [4])b ;
71@end
72
73@implementation Test
74-(void) test3: (Test* [3] [4])b {}
75@end
76
77struct S { int iS; };
78
79@interface Object
80{
81 Class isa;
82}
83@end
84typedef Object MyObj;
85
86int main()
87{
88	const char *en = @encode(Derived);
89	const char *eb = @encode(B1);
90        const char *es = @encode(const struct S *);
91        const char *ec = @encode(const struct S);
92        const char *ee = @encode(MyObj *const);
93}
94
95