Skip to content

Commit 18987af

Browse files
committed
[ObjC] Add pre-commit tests [NFC]
1 parent 4fb7b33 commit 18987af

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

clang/test/CodeGenObjC/constant-non-fragile-ivar-offset.m

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// RUN: %clang_cc1 -triple x86_64-apple-macosx10.14.0 -emit-llvm %s -o - | FileCheck %s
22

33
// CHECK: @"OBJC_IVAR_$_StaticLayout.static_layout_ivar" = hidden constant i64 20
4+
// CHECK: @"OBJC_IVAR_$_StaticLayoutSubClass.static_layout_ivar2" = hidden global i64 24
45
// CHECK: @"OBJC_IVAR_$_NotStaticLayout.not_static_layout_ivar" = hidden global i64 12
56

67
@interface NSObject {
@@ -20,6 +21,18 @@ -(void)meth {
2021
}
2122
@end
2223

24+
@interface StaticLayoutSubClass : StaticLayout
25+
@end
26+
27+
@implementation StaticLayoutSubClass {
28+
int static_layout_ivar2;
29+
}
30+
-(void)meth2 {
31+
static_layout_ivar2 = 0;
32+
// CHECK: load i64, ptr @"OBJC_IVAR_$_StaticLayoutSubClass
33+
}
34+
@end
35+
2336
@interface NotNSObject {
2437
int these, might, change;
2538
}

0 commit comments

Comments
 (0)