Daniel Dunbar | 5a5a803 | 2009-05-03 21:05:10 +0000 | [diff] [blame] | 1 | // RUNX: llvm-gcc -m64 -fobjc-gc -emit-llvm -S -o %t %s && |
Daniel Dunbar | a572887 | 2009-12-15 20:14:24 +0000 | [diff] [blame] | 2 | // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-nonfragile-abi -fobjc-gc -emit-llvm -o %t %s |
Daniel Dunbar | 4fcfde4 | 2009-11-08 01:45:36 +0000 | [diff] [blame] | 3 | // RUN: grep '@"\\01L_OBJC_CLASS_NAME_.*" = internal global .* c"A\\00"' %t |
| 4 | // RUN: grep '@"\\01L_OBJC_CLASS_NAME_.*" = internal global .* c"\\11q\\10\\00"' %t |
| 5 | // RUN: grep '@"\\01L_OBJC_CLASS_NAME_.*" = internal global .* c"!q\\00"' %t |
| 6 | // RUN: grep '@"\\01L_OBJC_CLASS_NAME_.*" = internal global .* c"\\01\\14\\00"' %t |
Daniel Dunbar | 5a5a803 | 2009-05-03 21:05:10 +0000 | [diff] [blame] | 7 | |
| 8 | /* |
| 9 | |
| 10 | Here is a handy command for looking at llvm-gcc's output: |
| 11 | llvm-gcc -m64 -fobjc-gc -emit-llvm -S -o - ivar-layout-64.m | \ |
| 12 | grep 'OBJC_CLASS_NAME.* =.*global' | \ |
| 13 | sed -e 's#, section.*# ...#' | \ |
Daniel Dunbar | 3715328 | 2009-05-04 04:10:48 +0000 | [diff] [blame] | 14 | sed -e 's#_[0-9]*"#_NNN#' | \ |
Daniel Dunbar | 5a5a803 | 2009-05-03 21:05:10 +0000 | [diff] [blame] | 15 | sort |
| 16 | |
| 17 | */ |
| 18 | |
| 19 | @interface B @end |
| 20 | |
| 21 | @interface A { |
| 22 | struct s0 { |
| 23 | int f0; |
| 24 | int f1; |
| 25 | } f0; |
| 26 | id f1; |
| 27 | __weak B *f2; |
| 28 | int f3 : 5; |
| 29 | struct s1 { |
| 30 | int *f0; |
| 31 | int *f1; |
| 32 | } f4[2][1]; |
| 33 | } |
| 34 | @end |
| 35 | |
Daniel Dunbar | 3715328 | 2009-05-04 04:10:48 +0000 | [diff] [blame] | 36 | @interface C : A |
| 37 | @property int p3; |
| 38 | @end |
| 39 | |
| 40 | @implementation C |
| 41 | @synthesize p3 = _p3; |
| 42 | @end |
| 43 | |
Daniel Dunbar | 5a5a803 | 2009-05-03 21:05:10 +0000 | [diff] [blame] | 44 | @interface A() |
| 45 | @property int p0; |
| 46 | @property (assign) __strong id p1; |
| 47 | @property (assign) __weak id p2; |
| 48 | @end |
| 49 | |
Daniel Dunbar | 3715328 | 2009-05-04 04:10:48 +0000 | [diff] [blame] | 50 | // FIXME: Check layout for this class, once it is clear what the right |
| 51 | // answer is. |
Daniel Dunbar | 5a5a803 | 2009-05-03 21:05:10 +0000 | [diff] [blame] | 52 | @implementation A |
Daniel Dunbar | 3715328 | 2009-05-04 04:10:48 +0000 | [diff] [blame] | 53 | @synthesize p0 = _p0; |
| 54 | @synthesize p1 = _p1; |
| 55 | @synthesize p2 = _p2; |
| 56 | @end |
| 57 | |
| 58 | @interface D : A |
| 59 | @property int p3; |
| 60 | @end |
| 61 | |
| 62 | // FIXME: Check layout for this class, once it is clear what the right |
| 63 | // answer is. |
| 64 | @implementation D |
| 65 | @synthesize p3 = _p3; |
Daniel Dunbar | 5a5a803 | 2009-05-03 21:05:10 +0000 | [diff] [blame] | 66 | @end |
Fariborz Jahanian | 31fa7d7 | 2009-05-04 21:46:27 +0000 | [diff] [blame] | 67 | |
| 68 | typedef unsigned short UInt16; |
| 69 | |
| 70 | |
| 71 | typedef signed char BOOL; |
| 72 | typedef unsigned int FSCatalogInfoBitmap; |
| 73 | |
| 74 | @interface NSFileLocationComponent { |
| 75 | @private |
| 76 | |
| 77 | id _specifierOrStandardizedPath; |
| 78 | BOOL _carbonCatalogInfoAndNameAreValid; |
| 79 | FSCatalogInfoBitmap _carbonCatalogInfoMask; |
| 80 | id _name; |
| 81 | id _containerComponent; |
| 82 | id _presentableName; |
| 83 | id _iconAsAttributedString; |
| 84 | } |
| 85 | @end |
| 86 | |
| 87 | @implementation NSFileLocationComponent @end |
| 88 | |