Daniel Dunbar | a572887 | 2009-12-15 20:14:24 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -triple=i686-apple-darwin9 -emit-llvm -o %t %s |
Daniel Dunbar | 4fcfde4 | 2009-11-08 01:45:36 +0000 | [diff] [blame] | 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 |
Fariborz Jahanian | 3e1b16c | 2008-12-23 21:30:15 +0000 | [diff] [blame] | 7 | // RUN: grep -e "\^{Object=#}" %t | count 1 |
Fariborz Jahanian | e4bb68a | 2008-12-19 17:45:06 +0000 | [diff] [blame] | 8 | |
| 9 | @class Int1; |
| 10 | |
| 11 | struct 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 Jahanian | 43822ea | 2008-12-19 23:34:38 +0000 | [diff] [blame] | 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 | |
Fariborz Jahanian | adcaf54 | 2008-12-20 19:17:01 +0000 | [diff] [blame] | 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 | |
Fariborz Jahanian | 4306d3c | 2008-12-20 23:29:59 +0000 | [diff] [blame] | 66 | @interface Test |
| 67 | { |
| 68 | int ivar; |
Fariborz Jahanian | 8d2c0a9 | 2009-11-30 18:43:52 +0000 | [diff] [blame] | 69 | __attribute__((objc_gc(weak))) SEL selector; |
Fariborz Jahanian | 4306d3c | 2008-12-20 23:29:59 +0000 | [diff] [blame] | 70 | } |
Chris Lattner | c7c11b1 | 2009-04-27 01:55:56 +0000 | [diff] [blame] | 71 | -(void) test3: (Test* [3] [4])b ; |
Fariborz Jahanian | 60bce3e | 2009-11-23 20:40:50 +0000 | [diff] [blame] | 72 | - (SEL**) meth : (SEL) arg : (SEL*****) arg1 : (SEL*)arg2 : (SEL**) arg3; |
Fariborz Jahanian | 4306d3c | 2008-12-20 23:29:59 +0000 | [diff] [blame] | 73 | @end |
| 74 | |
| 75 | @implementation Test |
Chris Lattner | c7c11b1 | 2009-04-27 01:55:56 +0000 | [diff] [blame] | 76 | -(void) test3: (Test* [3] [4])b {} |
Fariborz Jahanian | 60bce3e | 2009-11-23 20:40:50 +0000 | [diff] [blame] | 77 | - (SEL**) meth : (SEL) arg : (SEL*****) arg1 : (SEL*)arg2 : (SEL**) arg3 {} |
Fariborz Jahanian | 4306d3c | 2008-12-20 23:29:59 +0000 | [diff] [blame] | 78 | @end |
| 79 | |
Fariborz Jahanian | 5b8c7d9 | 2008-12-22 23:22:27 +0000 | [diff] [blame] | 80 | struct S { int iS; }; |
Fariborz Jahanian | 4306d3c | 2008-12-20 23:29:59 +0000 | [diff] [blame] | 81 | |
Fariborz Jahanian | 3e1b16c | 2008-12-23 21:30:15 +0000 | [diff] [blame] | 82 | @interface Object |
| 83 | { |
| 84 | Class isa; |
| 85 | } |
| 86 | @end |
| 87 | typedef Object MyObj; |
| 88 | |
Fariborz Jahanian | 43822ea | 2008-12-19 23:34:38 +0000 | [diff] [blame] | 89 | int main() |
| 90 | { |
| 91 | const char *en = @encode(Derived); |
Fariborz Jahanian | adcaf54 | 2008-12-20 19:17:01 +0000 | [diff] [blame] | 92 | const char *eb = @encode(B1); |
Fariborz Jahanian | 5b8c7d9 | 2008-12-22 23:22:27 +0000 | [diff] [blame] | 93 | const char *es = @encode(const struct S *); |
| 94 | const char *ec = @encode(const struct S); |
Fariborz Jahanian | 3e1b16c | 2008-12-23 21:30:15 +0000 | [diff] [blame] | 95 | const char *ee = @encode(MyObj *const); |
Fariborz Jahanian | 43822ea | 2008-12-19 23:34:38 +0000 | [diff] [blame] | 96 | } |
| 97 | |