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