summaryrefslogtreecommitdiff
path: root/test/CodeGenObjC/interface-layout-64.m
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-05-04 21:26:30 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-05-04 21:26:30 +0000
commitb4c79e027fdcc752b5a377611fd4cfbb21611a05 (patch)
tree56c5003cf11ca50e0b4bd1ca23eb2ffcfaef18d8 /test/CodeGenObjC/interface-layout-64.m
parentc2e57bfc7f784e8f2d6026ec6b03259c1109f120 (diff)
Compute interface instanceStart and instanceSize using the record
layout. - This is much simpler / more efficient. - This also properly computes the size in the presence of bit-fields. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70916 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGenObjC/interface-layout-64.m')
-rw-r--r--test/CodeGenObjC/interface-layout-64.m23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/CodeGenObjC/interface-layout-64.m b/test/CodeGenObjC/interface-layout-64.m
index 57f89b4787..ee01ac6bb6 100644
--- a/test/CodeGenObjC/interface-layout-64.m
+++ b/test/CodeGenObjC/interface-layout-64.m
@@ -7,6 +7,8 @@
// RUN: grep '@"OBJC_IVAR_$_I5._iv5" = global i64 24, section "__DATA, __objc_const", align 8' %t &&
// RUN: grep '@"OBJC_IVAR_$_I5._iv6_synth" = global i64 28, section "__DATA, __objc_const", align 8' %t &&
// RUN: grep '@"OBJC_IVAR_$_I5._iv7_synth" = global i64 32, section "__DATA, __objc_const", align 8' %t &&
+// RUN: grep '_OBJC_CLASS_RO_$_I6" = internal global .* { i32 2, i32 0, i32 1, .*' %t &&
+// RUN: grep '_OBJC_CLASS_RO_$_I8" = internal global .* { i32 0, i32 8, i32 16, .*' %t &&
// RUN: true
@@ -54,3 +56,24 @@ struct s0 {
@synthesize prop1 = _iv7_synth;
@synthesize prop2 = _iv5;
@end
+
+// The size rounds up to the next available byte.
+@interface I6 {
+ unsigned iv0 : 2;
+}
+@end
+@implementation I6
+@end
+
+// The start of the subclass includes padding for its own alignment.
+@interface I7 {
+ char a;
+}
+@end
+@interface I8 : I7 {
+ double b;
+}
+@end
+@implementation I8
+@end
+