Erik Pilkington | 2ff012d | 2019-01-17 18:18:53 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -triple x86_64-apple-macosx10.14.0 -emit-llvm %s -o - | FileCheck %s |
| 2 | |
| 3 | // CHECK: @"OBJC_IVAR_$_StaticLayout.static_layout_ivar" = hidden constant i64 20 |
| 4 | // CHECK: @"OBJC_IVAR_$_NotStaticLayout.not_static_layout_ivar" = hidden global i64 12 |
| 5 | |
| 6 | @interface NSObject { |
| 7 | int these, will, never, change, ever; |
| 8 | } |
| 9 | @end |
| 10 | |
| 11 | @interface StaticLayout : NSObject |
| 12 | @end |
| 13 | |
| 14 | @implementation StaticLayout { |
| 15 | int static_layout_ivar; |
| 16 | } |
| 17 | -(void)meth { |
| 18 | static_layout_ivar = 0; |
| 19 | // CHECK-NOT: load i64, i64* @"OBJC_IVAR_$_StaticLayout |
| 20 | } |
| 21 | @end |
| 22 | |
| 23 | @interface NotNSObject { |
| 24 | int these, might, change; |
| 25 | } |
| 26 | @end |
| 27 | |
| 28 | @interface NotStaticLayout : NotNSObject |
| 29 | @end |
| 30 | |
| 31 | @implementation NotStaticLayout { |
| 32 | int not_static_layout_ivar; |
| 33 | } |
| 34 | -(void)meth { |
| 35 | not_static_layout_ivar = 0; |
| 36 | // CHECK: load i64, i64* @"OBJC_IVAR_$_NotStaticLayout.not_static_layout_ivar |
| 37 | } |
| 38 | @end |