blob: 0976735637c4ad59e8dd8dd8dc44199e367cbca2 [file] [log] [blame]
Daniel Dunbar5a5a8032009-05-03 21:05:10 +00001// RUNX: llvm-gcc -m64 -fobjc-gc -emit-llvm -S -o %t %s &&
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: true
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.*# ...#' | \
Daniel Dunbar37153282009-05-04 04:10:48 +000014 sed -e 's#_[0-9]*"#_NNN#' | \
Daniel Dunbar5a5a8032009-05-03 21:05:10 +000015 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 Dunbar37153282009-05-04 04:10:48 +000036@interface C : A
37@property int p3;
38@end
39
40@implementation C
41@synthesize p3 = _p3;
42@end
43
Daniel Dunbar5a5a8032009-05-03 21:05:10 +000044@interface A()
45@property int p0;
46@property (assign) __strong id p1;
47@property (assign) __weak id p2;
48@end
49
Daniel Dunbar37153282009-05-04 04:10:48 +000050// FIXME: Check layout for this class, once it is clear what the right
51// answer is.
Daniel Dunbar5a5a8032009-05-03 21:05:10 +000052@implementation A
Daniel Dunbar37153282009-05-04 04:10:48 +000053@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 Dunbar5a5a8032009-05-03 21:05:10 +000066@end