Sebastian Redl | e3f38ea | 2008-12-21 12:17:24 +0000 | [diff] [blame^] | 1 | // RUN: clang -triple=i686-apple-darwin9 -fnext-runtime -emit-llvm -o %t %s && |
Fariborz Jahanian | 43822ea | 2008-12-19 23:34:38 +0000 | [diff] [blame] | 2 | // RUN: grep -e "\^{Innermost=CC}" %t | count 1 && |
Fariborz Jahanian | adcaf54 | 2008-12-20 19:17:01 +0000 | [diff] [blame] | 3 | // RUN: grep -e "{Derived=#ib32b8b3b8sb16b8b8b2b8ccb6}" %t | count 1 && |
Fariborz Jahanian | 4306d3c | 2008-12-20 23:29:59 +0000 | [diff] [blame] | 4 | // RUN: grep -e "{B1=#@c}" %t | count 1 && |
| 5 | // RUN: grep -e "v12@0:4\[3\[4{Test=i}]]8" %t | count 1 |
Fariborz Jahanian | e4bb68a | 2008-12-19 17:45:06 +0000 | [diff] [blame] | 6 | |
| 7 | @class Int1; |
| 8 | |
| 9 | struct Innermost { |
| 10 | unsigned char a, b; |
| 11 | }; |
| 12 | |
| 13 | @interface Int1 { |
| 14 | signed char a, b; |
| 15 | struct Innermost *innermost; |
| 16 | } |
| 17 | @end |
| 18 | |
| 19 | @implementation Int1 |
| 20 | @end |
Fariborz Jahanian | 43822ea | 2008-12-19 23:34:38 +0000 | [diff] [blame] | 21 | |
| 22 | @interface Base |
| 23 | { |
| 24 | struct objc_class *isa; |
| 25 | int full; |
| 26 | int full2: 32; |
| 27 | int _refs: 8; |
| 28 | int field2: 3; |
| 29 | unsigned f3: 8; |
| 30 | short cc; |
| 31 | unsigned g: 16; |
| 32 | int r2: 8; |
| 33 | int r3: 8; |
| 34 | int r4: 2; |
| 35 | int r5: 8; |
| 36 | char c; |
| 37 | } |
| 38 | @end |
| 39 | |
| 40 | @interface Derived: Base |
| 41 | { |
| 42 | char d; |
| 43 | int _field3: 6; |
| 44 | } |
| 45 | @end |
| 46 | |
| 47 | @implementation Base |
| 48 | @end |
| 49 | |
| 50 | @implementation Derived |
| 51 | @end |
| 52 | |
Fariborz Jahanian | adcaf54 | 2008-12-20 19:17:01 +0000 | [diff] [blame] | 53 | @interface B1 |
| 54 | { |
| 55 | struct objc_class *isa; |
| 56 | Int1 *sBase; |
| 57 | char c; |
| 58 | } |
| 59 | @end |
| 60 | |
| 61 | @implementation B1 |
| 62 | @end |
| 63 | |
Fariborz Jahanian | 4306d3c | 2008-12-20 23:29:59 +0000 | [diff] [blame] | 64 | @interface Test |
| 65 | { |
| 66 | int ivar; |
| 67 | } |
| 68 | -(void) test3: (Test [3] [4])b ; |
| 69 | @end |
| 70 | |
| 71 | @implementation Test |
| 72 | -(void) test3: (Test [3] [4])b {} |
| 73 | @end |
| 74 | |
| 75 | |
Fariborz Jahanian | 43822ea | 2008-12-19 23:34:38 +0000 | [diff] [blame] | 76 | int main() |
| 77 | { |
| 78 | const char *en = @encode(Derived); |
Fariborz Jahanian | adcaf54 | 2008-12-20 19:17:01 +0000 | [diff] [blame] | 79 | const char *eb = @encode(B1); |
Fariborz Jahanian | 43822ea | 2008-12-19 23:34:38 +0000 | [diff] [blame] | 80 | } |
| 81 | |