blob: f227bfc30d36db1f00ad245792da378be2bd2829 [file] [log] [blame]
Daniel Dunbar5a5a8032009-05-03 21:05:10 +00001// RUNX: llvm-gcc -m64 -fobjc-gc -emit-llvm -S -o %t %s &&
Daniel Dunbara5728872009-12-15 20:14:24 +00002// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-nonfragile-abi -fobjc-gc -emit-llvm -o %t %s
Daniel Dunbar4fcfde42009-11-08 01:45:36 +00003// 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 Jahaniana5da9022010-05-19 23:07:54 +00007// 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 Dunbar5a5a8032009-05-03 21:05:10 +000013
14/*
15
16Here is a handy command for looking at llvm-gcc's output:
17llvm-gcc -m64 -fobjc-gc -emit-llvm -S -o - ivar-layout-64.m | \
18 grep 'OBJC_CLASS_NAME.* =.*global' | \
19 sed -e 's#, section.*# ...#' | \
Daniel Dunbar37153282009-05-04 04:10:48 +000020 sed -e 's#_[0-9]*"#_NNN#' | \
Daniel Dunbar5a5a8032009-05-03 21:05:10 +000021 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 Dunbar37153282009-05-04 04:10:48 +000042@interface C : A
43@property int p3;
44@end
45
46@implementation C
47@synthesize p3 = _p3;
48@end
49
Daniel Dunbar5a5a8032009-05-03 21:05:10 +000050@interface A()
51@property int p0;
52@property (assign) __strong id p1;
53@property (assign) __weak id p2;
54@end
55
Daniel Dunbar37153282009-05-04 04:10:48 +000056// FIXME: Check layout for this class, once it is clear what the right
57// answer is.
Daniel Dunbar5a5a8032009-05-03 21:05:10 +000058@implementation A
Daniel Dunbar37153282009-05-04 04:10:48 +000059@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 Dunbar5a5a8032009-05-03 21:05:10 +000072@end
Fariborz Jahanian31fa7d72009-05-04 21:46:27 +000073
74typedef unsigned short UInt16;
75
76
77typedef signed char BOOL;
78typedef 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