blob: 60ce1dff57de842dc72816c4dd2ba594341cc382 [file] [log] [blame]
Shih-wei Liaof8fd82b2010-02-10 11:10:31 -08001// RUNX: llvm-gcc -m64 -fobjc-gc -emit-llvm -S -o %t %s &&
2// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-nonfragile-abi -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
7
8/*
9
10Here is a handy command for looking at llvm-gcc's output:
11llvm-gcc -m64 -fobjc-gc -emit-llvm -S -o - ivar-layout-64.m | \
12 grep 'OBJC_CLASS_NAME.* =.*global' | \
13 sed -e 's#, section.*# ...#' | \
14 sed -e 's#_[0-9]*"#_NNN#' | \
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
36@interface C : A
37@property int p3;
38@end
39
40@implementation C
41@synthesize p3 = _p3;
42@end
43
44@interface A()
45@property int p0;
46@property (assign) __strong id p1;
47@property (assign) __weak id p2;
48@end
49
50// FIXME: Check layout for this class, once it is clear what the right
51// answer is.
52@implementation A
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;
66@end
67
68typedef unsigned short UInt16;
69
70
71typedef signed char BOOL;
72typedef 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