Fariborz Jahanian | e4bb68a | 2008-12-19 17:45:06 +0000 | [diff] [blame] | 1 | // RUN: clang -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 && |
| 4 | // RUN: grep -e "{B1=#@c}" %t | count 1 |
Fariborz Jahanian | e4bb68a | 2008-12-19 17:45:06 +0000 | [diff] [blame] | 5 | |
| 6 | @class Int1; |
| 7 | |
| 8 | struct Innermost { |
| 9 | unsigned char a, b; |
| 10 | }; |
| 11 | |
| 12 | @interface Int1 { |
| 13 | signed char a, b; |
| 14 | struct Innermost *innermost; |
| 15 | } |
| 16 | @end |
| 17 | |
| 18 | @implementation Int1 |
| 19 | @end |
Fariborz Jahanian | 43822ea | 2008-12-19 23:34:38 +0000 | [diff] [blame] | 20 | |
| 21 | @interface Base |
| 22 | { |
| 23 | struct objc_class *isa; |
| 24 | int full; |
| 25 | int full2: 32; |
| 26 | int _refs: 8; |
| 27 | int field2: 3; |
| 28 | unsigned f3: 8; |
| 29 | short cc; |
| 30 | unsigned g: 16; |
| 31 | int r2: 8; |
| 32 | int r3: 8; |
| 33 | int r4: 2; |
| 34 | int r5: 8; |
| 35 | char c; |
| 36 | } |
| 37 | @end |
| 38 | |
| 39 | @interface Derived: Base |
| 40 | { |
| 41 | char d; |
| 42 | int _field3: 6; |
| 43 | } |
| 44 | @end |
| 45 | |
| 46 | @implementation Base |
| 47 | @end |
| 48 | |
| 49 | @implementation Derived |
| 50 | @end |
| 51 | |
Fariborz Jahanian | adcaf54 | 2008-12-20 19:17:01 +0000 | [diff] [blame^] | 52 | @interface B1 |
| 53 | { |
| 54 | struct objc_class *isa; |
| 55 | Int1 *sBase; |
| 56 | char c; |
| 57 | } |
| 58 | @end |
| 59 | |
| 60 | @implementation B1 |
| 61 | @end |
| 62 | |
Fariborz Jahanian | 43822ea | 2008-12-19 23:34:38 +0000 | [diff] [blame] | 63 | int main() |
| 64 | { |
| 65 | const char *en = @encode(Derived); |
Fariborz Jahanian | adcaf54 | 2008-12-20 19:17:01 +0000 | [diff] [blame^] | 66 | const char *eb = @encode(B1); |
Fariborz Jahanian | 43822ea | 2008-12-19 23:34:38 +0000 | [diff] [blame] | 67 | } |
| 68 | |