diff options
author | John McCall <rjmccall@apple.com> | 2015-10-29 23:36:14 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2015-10-29 23:36:14 +0000 |
commit | f5ea072e019bd87689f9d00877d267c91ff2c8a1 (patch) | |
tree | ec284addb60aaeb3c5ef158eeddcba5271317aa3 /clang/test/CodeGenObjC | |
parent | 25cb32091cce2e6227e1f8812aea84b45000654e (diff) | |
download | bcm5719-llvm-f5ea072e019bd87689f9d00877d267c91ff2c8a1.tar.gz bcm5719-llvm-f5ea072e019bd87689f9d00877d267c91ff2c8a1.zip |
Fix the emission of ARC ivar layouts in the non-fragile Mac runtime.
My previous change in this area accidentally broke the rule when
InstanceBegin was not a multiple of the word size.
llvm-svn: 251666
Diffstat (limited to 'clang/test/CodeGenObjC')
-rw-r--r-- | clang/test/CodeGenObjC/arc-ivar-layout.m | 36 |
1 files changed, 25 insertions, 11 deletions
diff --git a/clang/test/CodeGenObjC/arc-ivar-layout.m b/clang/test/CodeGenObjC/arc-ivar-layout.m index 086a726d806..5e08d625e34 100644 --- a/clang/test/CodeGenObjC/arc-ivar-layout.m +++ b/clang/test/CodeGenObjC/arc-ivar-layout.m @@ -1,6 +1,4 @@ -// RUN: %clang_cc1 -fobjc-arc -fobjc-runtime-has-weak -triple x86_64-apple-darwin -S %s -o %t-64.s -// RUN: FileCheck -check-prefix CHECK-LP64 --input-file=%t-64.s %s -// REQUIRES: x86-registered-target +// 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 %s // rdar://8991729 @interface NSObject { @@ -17,8 +15,7 @@ @implementation AllPointers @end -// CHECK-LP64: L_OBJC_CLASS_NAME_.1: -// CHECK-LP64-NEXT: .asciz "\003" +// CHECK-LP64: strong ivar layout for class 'AllPointers': 0x03, 0x00 @class NSString, NSNumber; @interface A : NSObject { @@ -38,10 +35,12 @@ @implementation A @end +// CHECK-LP64: strong ivar layout for class 'A': 0x02, 0x00 +// CHECK-LP64: weak ivar layout for class 'A': 0x31, 0x00 + @implementation B @end -// CHECK-LP64: L_OBJC_CLASS_NAME_.15: -// CHECK-LP64-NEXT: .asciz "\022" +// CHECK-LP64: strong ivar layout for class 'B': 0x12, 0x00 @interface UnsafePerson { @public @@ -52,8 +51,8 @@ @end @implementation UnsafePerson @end -// CHECK-LP64: L_OBJC_CLASS_NAME_.20: -// CHECK-LP64-NEXT: .asciz "!" + +// CHECK-LP64: strong ivar layout for class 'UnsafePerson': 0x21, 0x00 // rdar://16136439 @interface rdar16136439 @@ -61,5 +60,20 @@ @end @implementation rdar16136439 @end -// CHECK-LP64: L_OBJC_PROP_NAME_ATTR_.29: -// CHECK-LP64-NEXT: .asciz "T@,R,W,N,V_first" + +// CHECK-LP64: weak ivar layout for class 'rdar16136439': 0x01, 0x00 + +@interface Misalign : NSObject { + char a; +} +@end + +@interface Misaligned : Misalign { + char b; + id x; +} +@end + +@implementation Misaligned @end + +// CHECK-LP64: strong ivar layout for class 'Misaligned': 0x01, 0x00 |