brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.5 KiB · 421167c Raw
78 lines · plain
1// RUN: %clang_cc1 -fobjc-arc -fobjc-runtime-has-weak -triple x86_64-apple-darwin -print-ivar-layout -emit-llvm %s -o %t-64.s | FileCheck -check-prefix CHECK-LP64 %s2 3@interface NSObject {4  id isa;5}6@end7 8@interface AllPointers : NSObject {9    id foo;10    id __strong bar;    11    NSObject *bletch;12}13@end14 15@implementation AllPointers16@end17// CHECK-LP64: strong ivar layout for class 'AllPointers': 0x03, 0x0018 19@class NSString, NSNumber;20@interface A : NSObject {21   NSString *foo;22   NSNumber *bar;23   unsigned int bletch;24   __weak id delegate;25}26@end27 28@interface B : A {29  unsigned int x;30  NSString *y;31  NSString *z;32}33@end34 35@implementation A @end36 37// CHECK-LP64: strong ivar layout for class 'A': 0x02, 0x0038// CHECK-LP64: weak ivar layout for class 'A': 0x31, 0x0039 40@implementation B @end41 42// CHECK-LP64: strong ivar layout for class 'B': 0x12, 0x0043 44@interface UnsafePerson {45@public46    __unsafe_unretained id name;47    __unsafe_unretained id age;48    id value;49}50@end51 52@implementation UnsafePerson @end53 54// CHECK-LP64: strong ivar layout for class 'UnsafePerson': 0x21, 0x0055 56@interface rdar1613643957    @property (nonatomic, readonly, weak) id first;58@end59 60@implementation rdar16136439 @end61 62// CHECK-LP64: weak ivar layout for class 'rdar16136439': 0x01, 0x0063 64@interface Misalign : NSObject {65  char a;66}67@end68 69@interface Misaligned : Misalign {70  char b;71  id x;72}73@end74 75@implementation Misaligned @end76 77// CHECK-LP64: strong ivar layout for class 'Misaligned': 0x01, 0x0078