|
8 | 8 | // CHECK: @"OBJC_IVAR_$_IntermediateClass._intermediateProperty" = hidden constant i64 48 |
9 | 9 | // CHECK: @"OBJC_IVAR_$_SubClass.subClassIvar" = constant i64 56 |
10 | 10 | // CHECK: @"OBJC_IVAR_$_SubClass._subClassProperty" = hidden constant i64 64 |
| 11 | + |
| 12 | +// CHECK: @"OBJC_IVAR_$_RootClass.these" = constant i64 0 |
| 13 | +// CHECK: @"OBJC_IVAR_$_RootClass.dont" = constant i64 4 |
| 14 | +// CHECK: @"OBJC_IVAR_$_RootClass.change" = constant i64 4 |
| 15 | +// CHECK: @"OBJC_IVAR_$_StillStaticLayout.static_layout_ivar" = hidden global i32 12 |
| 16 | + |
11 | 17 | // CHECK: @"OBJC_IVAR_$_NotStaticLayout.not_static_layout_ivar" = hidden global i64 12 |
12 | 18 |
|
13 | 19 | @interface NSObject { |
@@ -120,7 +126,29 @@ -(void)intermediateSubclassVar { |
120 | 126 | // CHECK: getelementptr inbounds i8, ptr %1, i64 64 |
121 | 127 | @end |
122 | 128 |
|
123 | | -@interface NotNSObject { |
| 129 | + __attribute((objc_root_class)) @interface RootClass { |
| 130 | + int these, dont, change; |
| 131 | +} |
| 132 | +@end |
| 133 | + |
| 134 | +@implementation RootClass |
| 135 | +@end |
| 136 | + |
| 137 | +@interface StillStaticLayout : RootClass |
| 138 | +@end |
| 139 | + |
| 140 | +@implementation StillStaticLayout { |
| 141 | + int static_layout_ivar; |
| 142 | +} |
| 143 | + |
| 144 | +// CHECK-LABEL: define internal void @"\01-[StillStaticLayout meth]" |
| 145 | +-(void)meth { |
| 146 | + static_layout_ivar = 0; |
| 147 | + // CHECK-NOT: load i64, ptr @"OBJC_IVAR_$StillStaticLayout.static_layout_ivar |
| 148 | +} |
| 149 | +@end |
| 150 | + |
| 151 | +__attribute((objc_root_class)) @interface NotNSObject { |
124 | 152 | int these, might, change; |
125 | 153 | } |
126 | 154 | @end |
|
0 commit comments