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