diff options
Diffstat (limited to 'test/CodeGenObjC')
153 files changed, 1188 insertions, 275 deletions
diff --git a/test/CodeGenObjC/2007-04-03-ObjcEH.m b/test/CodeGenObjC/2007-04-03-ObjcEH.m new file mode 100644 index 000000000000..f86ff49bbbd5 --- /dev/null +++ b/test/CodeGenObjC/2007-04-03-ObjcEH.m @@ -0,0 +1,27 @@ +// RUN: %clang -fexceptions -S -emit-llvm %s -o - + +@interface B +-(int)bar; +@end + +@interface A +-(void) Foo:(int) state; +@end + +@implementation A +- (void) Foo:(int) state { + + int wasResponded = 0; + @try { + if (state) { + B * b = 0; + @try { } + @finally { + wasResponded = ![b bar]; + } + } + } + @finally { + } +} +@end diff --git a/test/CodeGenObjC/2007-05-02-Strong.m b/test/CodeGenObjC/2007-05-02-Strong.m new file mode 100644 index 000000000000..31553df6130a --- /dev/null +++ b/test/CodeGenObjC/2007-05-02-Strong.m @@ -0,0 +1,23 @@ +// RUN: %clang_cc1 -S %s -fobjc-gc -o /dev/null +typedef int NSInteger; +typedef struct _NSRect { + int origin; + int size; +} NSRect; + +__attribute__((objc_gc(strong))) NSRect *_cachedRectArray; +extern const NSRect NSZeroRect; +@interface A{ +} +-(void)bar:(NSInteger *)rectCount; +@end + +@implementation A + +-(void)bar:(NSInteger *)rectCount { + NSRect appendRect = NSZeroRect; + + _cachedRectArray[*rectCount - 1] = NSZeroRect; +} + +@end diff --git a/test/CodeGenObjC/2007-10-18-ProDescriptor.m b/test/CodeGenObjC/2007-10-18-ProDescriptor.m new file mode 100644 index 000000000000..35a0df3a1a9f --- /dev/null +++ b/test/CodeGenObjC/2007-10-18-ProDescriptor.m @@ -0,0 +1,18 @@ +// RUN: %clang_cc1 -emit-llvm %s -o /dev/null +@protocol O +@end +@interface O < O > { +} +@end +struct A { +}; +@protocol AB +- (unsigned) ver; +@end +@interface AGy:O < AB > { +} +@end +@implementation AGy +- (unsigned) ver { +} +@end diff --git a/test/CodeGenObjC/2007-10-23-GC-WriteBarrier.m b/test/CodeGenObjC/2007-10-23-GC-WriteBarrier.m new file mode 100644 index 000000000000..af8508b6463a --- /dev/null +++ b/test/CodeGenObjC/2007-10-23-GC-WriteBarrier.m @@ -0,0 +1,9 @@ +// RUN: %clang_cc1 -emit-llvm %s -o /dev/null -fobjc-gc +// rdar://5541393 + +typedef unsigned int NSUInteger; +__attribute__((objc_gc(strong))) float *_scores; + +void foo(int i, float f) { + _scores[i] = f; +} diff --git a/test/CodeGenObjC/2008-10-3-EhValue.m b/test/CodeGenObjC/2008-10-3-EhValue.m new file mode 100644 index 000000000000..0ed0d8993977 --- /dev/null +++ b/test/CodeGenObjC/2008-10-3-EhValue.m @@ -0,0 +1,50 @@ +// RUN: %clang -fexceptions -S -emit-llvm %s -o /dev/null + +@interface Object { +@public + Class isa; +} ++initialize; ++alloc; ++new; ++free; +-free; ++(Class)class; +-(Class)class; +-init; +-superclass; +-(const char *)name; +@end + +@interface Frob: Object +@end + +@implementation Frob: Object +@end + +static Frob* _connection = ((void *)0); + +extern void abort(void); + +void test (Object* sendPort) +{ + int cleanupPorts = 1; + Frob* receivePort = ((void *)0); + + @try { + receivePort = (Frob *) -1; + _connection = (Frob *) -1; + receivePort = ((void *)0); + sendPort = ((void *)0); + cleanupPorts = 0; + @throw [Object new]; + } + @catch(Frob *obj) { + if(!(0)) abort(); + } + @catch(id exc) { + if(!(!receivePort)) abort(); + if(!(!sendPort)) abort(); + if(!(!cleanupPorts)) abort(); + } +} diff --git a/test/CodeGenObjC/2008-11-12-Metadata.m b/test/CodeGenObjC/2008-11-12-Metadata.m new file mode 100644 index 000000000000..afd7ce035aea --- /dev/null +++ b/test/CodeGenObjC/2008-11-12-Metadata.m @@ -0,0 +1,14 @@ +// RUN: %clang_cc1 -emit-llvm -triple x86_64-apple-darwin -fobjc-fragile-abi %s -o /dev/null + +@interface A +@end +@protocol P +@end +@interface B : A <P> +{ +} +@end +@implementation B +- (void)test { +} +@end diff --git a/test/CodeGenObjC/2008-11-24-ConstCFStrings.m b/test/CodeGenObjC/2008-11-24-ConstCFStrings.m new file mode 100644 index 000000000000..b37f66c29707 --- /dev/null +++ b/test/CodeGenObjC/2008-11-24-ConstCFStrings.m @@ -0,0 +1,13 @@ +// RUN: %clang_cc1 -emit-llvm -triple x86_64-apple-darwin -fobjc-fragile-abi %s -o - | FileCheck %s + +// CHECK: _unnamed_cfstring_ + +@class NSString; + +@interface A +- (void)bork:(NSString*)msg; +@end + +void func(A *a) { + [a bork:@"Hello world!"]; +} diff --git a/test/CodeGenObjC/2008-11-25-Blocks.m b/test/CodeGenObjC/2008-11-25-Blocks.m new file mode 100644 index 000000000000..39364d5de00a --- /dev/null +++ b/test/CodeGenObjC/2008-11-25-Blocks.m @@ -0,0 +1,17 @@ +// RUN: %clang_cc1 -fblocks -emit-llvm %s -o /dev/null +// rdar://6394879 + +@interface bork +- (id)B:(void (^)())blk; +- (void)C; +@end +@implementation bork +- (id)B:(void (^)())blk { + __attribute__((__blocks__(byref))) bork* new = ((void *)0); + blk(); +} +- (void)C { + __attribute__((__blocks__(byref))) id var; + [self B:^() {}]; +} +@end diff --git a/test/CodeGenObjC/2009-01-26-WriteBarrier-2.m b/test/CodeGenObjC/2009-01-26-WriteBarrier-2.m new file mode 100644 index 000000000000..d7219f185ba7 --- /dev/null +++ b/test/CodeGenObjC/2009-01-26-WriteBarrier-2.m @@ -0,0 +1,19 @@ +// RUN: %clang_cc1 -fblocks -emit-llvm %s -fobjc-gc -o - | FileCheck %s + +// CHECK: objc_assign_strongCast +// rdar://5541393 + +typedef __SIZE_TYPE__ size_t; +void * malloc(size_t size); + +typedef struct { + void (^ivarBlock)(void); +} StructWithBlock_t; + +int main(int argc, char *argv[]) { + StructWithBlock_t *swbp = (StructWithBlock_t *)malloc(sizeof(StructWithBlock_t*)); + __block int i = 10; + // assigning a Block into an struct slot should elicit a write-barrier under GC + swbp->ivarBlock = ^ { ++i; }; + return 0; +} diff --git a/test/CodeGenObjC/2009-02-05-VolatileProp.m b/test/CodeGenObjC/2009-02-05-VolatileProp.m new file mode 100644 index 000000000000..1f696ac7c2d0 --- /dev/null +++ b/test/CodeGenObjC/2009-02-05-VolatileProp.m @@ -0,0 +1,10 @@ +// RUN: %clang -fexceptions -S -emit-llvm %s -o /dev/null -pedantic-errors +// rdar://6551276 + +void foo(const unsigned short *); +void bar() { + unsigned short *s[3]; + int i; + @try { } @catch (id anException) { } + foo(2+s[i]); +} diff --git a/test/CodeGenObjC/2009-08-05-utf16.m b/test/CodeGenObjC/2009-08-05-utf16.m new file mode 100644 index 000000000000..38c9c82e7835 --- /dev/null +++ b/test/CodeGenObjC/2009-08-05-utf16.m @@ -0,0 +1,5 @@ +// RUN: %clang_cc1 -emit-llvm -w -x objective-c %s -o - | FileCheck %s +// rdar://7095855 rdar://7115749 + +// CHECK: internal unnamed_addr constant [12 x i8] +void *P = @"iPodâ„¢"; diff --git a/test/CodeGenObjC/2010-02-01-utf16-with-null.m b/test/CodeGenObjC/2010-02-01-utf16-with-null.m new file mode 100644 index 000000000000..1863984c216e --- /dev/null +++ b/test/CodeGenObjC/2010-02-01-utf16-with-null.m @@ -0,0 +1,5 @@ +// RUN: %clang_cc1 -emit-llvm %s -o - | FileCheck %s +// rdar://7589850 + +// CHECK-NOT: __ustring +void *P = @"good\0bye"; diff --git a/test/CodeGenObjC/2010-02-23-DbgInheritance.m b/test/CodeGenObjC/2010-02-23-DbgInheritance.m new file mode 100644 index 000000000000..7d31b30cce5f --- /dev/null +++ b/test/CodeGenObjC/2010-02-23-DbgInheritance.m @@ -0,0 +1,10 @@ +// RUN: %clang_cc1 -emit-llvm %s -g -o - | FileCheck %s +// CHECK-NOT: DW_TAG_member +// Interface P should not be a member of interface I in debug info. +@interface P +@end + +@interface I : P +@end + +void fn(I *iptr) {} diff --git a/test/CodeGenObjC/2010-03-17-StructRef.m b/test/CodeGenObjC/2010-03-17-StructRef.m new file mode 100644 index 000000000000..fd0e6462ce2e --- /dev/null +++ b/test/CodeGenObjC/2010-03-17-StructRef.m @@ -0,0 +1,43 @@ +// RUN: %clang_cc1 %s -emit-llvm -triple x86_64-apple-darwin -fobjc-fragile-abi -o - | FileCheck %s +// Bitfield references must not touch memory outside of the enclosing +// struct. Radar 7639995 +typedef signed char BOOL; +@protocol NSObject +- (id)init; +@end +@interface NSObject <NSObject> {} +@end +@interface IMAVChatParticipant : NSObject { + int _ardRole; + int _state; + int _avRelayStatus; + int _chatEndedReason; + int _chatError; + unsigned _sendingAudio:1; + unsigned _sendingVideo:1; + unsigned _sendingAuxVideo:1; + unsigned _audioMuted:1; + unsigned _videoPaused:1; + unsigned _networkStalled:1; + unsigned _isInitiator:1; + unsigned _isAOLInterop:1; + unsigned _isRecording:1; + unsigned _isUsingICE:1; +} +@end +@implementation IMAVChatParticipant +- (id) init { + self = [super init]; + if ( self ) { + BOOL blah = (BOOL)1; + // We're expecting these three bitfield assignments will generate i8 stores. + _sendingAudio = (BOOL)1; + _isUsingICE = (BOOL)1; + _isUsingICE = blah; + // CHECK: store i8 + // CHECK: store i8 + // CHECK: store i8 + } + return self; +} +@end diff --git a/test/CodeGenObjC/2011-03-08-IVarLookup.m b/test/CodeGenObjC/2011-03-08-IVarLookup.m new file mode 100644 index 000000000000..a24b98c3ac6c --- /dev/null +++ b/test/CodeGenObjC/2011-03-08-IVarLookup.m @@ -0,0 +1,30 @@ +// RUN: %clang -S -emit-llvm -m64 -fobjc-abi-version=2 %s -o /dev/null + +typedef unsigned int UInt_t; + +@interface A +{ +@protected + UInt_t _f1; +} +@end + +@interface B : A { } +@end + +@interface A () +@property (assign) UInt_t f1; +@end + +@interface B () +@property (assign) int x; +@end + +@implementation B +@synthesize x; +- (id) init +{ + _f1 = 0; + return self; +} +@end diff --git a/test/CodeGenObjC/arc-arm.m b/test/CodeGenObjC/arc-arm.m index a3d55c28f400..23da3be2a5dd 100644 --- a/test/CodeGenObjC/arc-arm.m +++ b/test/CodeGenObjC/arc-arm.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple armv7-apple-darwin10 -emit-llvm -fobjc-nonfragile-abi -fblocks -fobjc-arc -o - %s | FileCheck %s +// RUN: %clang_cc1 -triple armv7-apple-darwin10 -emit-llvm -fblocks -fobjc-arc -o - %s | FileCheck %s id test0(void) { extern id test0_helper(void); diff --git a/test/CodeGenObjC/arc-block-copy-escape.m b/test/CodeGenObjC/arc-block-copy-escape.m new file mode 100644 index 000000000000..15c0d1d0f496 --- /dev/null +++ b/test/CodeGenObjC/arc-block-copy-escape.m @@ -0,0 +1,22 @@ +// RUN: %clang_cc1 -fobjc-arc -fblocks -emit-llvm %s -o - | FileCheck %s + +typedef void (^block_t)(void); +void use_block(block_t); +void use_int(int); + +// rdar://problem/10211676 + +void test0(int i) { + block_t block = ^{ use_int(i); }; + // CHECK: define void @test0( + // CHECK: call i8* @objc_retainBlock(i8* {{%.*}}) nounwind, !clang.arc.copy_on_escape + // CHECK: ret void +} + +void test1(int i) { + id block = ^{ use_int(i); }; + // CHECK: define void @test1( + // CHECK: call i8* @objc_retainBlock(i8* {{%.*}}) nounwind + // CHECK-NOT: !clang.arc.copy_on_escape + // CHECK: ret void +} diff --git a/test/CodeGenObjC/arc-block-ivar-layout.m b/test/CodeGenObjC/arc-block-ivar-layout.m index 50c35bacda06..6c82f2969823 100644 --- a/test/CodeGenObjC/arc-block-ivar-layout.m +++ b/test/CodeGenObjC/arc-block-ivar-layout.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -fblocks -fobjc-arc -fobjc-nonfragile-abi -fobjc-runtime-has-weak -triple x86_64-apple-darwin -O0 -emit-llvm %s -o %t-64.s +// RUN: %clang_cc1 -fblocks -fobjc-arc -fobjc-runtime-has-weak -triple x86_64-apple-darwin -O0 -emit-llvm %s -o %t-64.s // RUN: FileCheck -check-prefix LP64 --input-file=%t-64.s %s // rdar://8991729 diff --git a/test/CodeGenObjC/arc-bridged-cast.m b/test/CodeGenObjC/arc-bridged-cast.m index 3354bda5bf00..eb9045d3d840 100644 --- a/test/CodeGenObjC/arc-bridged-cast.m +++ b/test/CodeGenObjC/arc-bridged-cast.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -fobjc-nonfragile-abi -fblocks -fobjc-arc -O2 -disable-llvm-optzns -o - %s | FileCheck %s +// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -fblocks -fobjc-arc -O2 -disable-llvm-optzns -o - %s | FileCheck %s typedef const void *CFTypeRef; typedef const struct __CFString *CFStringRef; diff --git a/test/CodeGenObjC/arc-compound-stmt.m b/test/CodeGenObjC/arc-compound-stmt.m index 946d72f00591..573ee449aaae 100644 --- a/test/CodeGenObjC/arc-compound-stmt.m +++ b/test/CodeGenObjC/arc-compound-stmt.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -fobjc-nonfragile-abi -fobjc-arc -o - %s +// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -fobjc-arc -o - %s // rdar://9694706 typedef unsigned long NSUInteger; diff --git a/test/CodeGenObjC/arc-foreach.m b/test/CodeGenObjC/arc-foreach.m index f9d7782fbedd..9449b3d2d602 100644 --- a/test/CodeGenObjC/arc-foreach.m +++ b/test/CodeGenObjC/arc-foreach.m @@ -1,11 +1,17 @@ -// RUN: %clang_cc1 -fblocks -fobjc-arc -fobjc-nonfragile-abi -fobjc-runtime-has-weak -triple x86_64-apple-darwin -O0 -emit-llvm %s -o %t-64.s +// RUN: %clang_cc1 -fblocks -fobjc-arc -fobjc-runtime-has-weak -triple x86_64-apple-darwin -O0 -emit-llvm %s -o %t-64.s // RUN: FileCheck -check-prefix LP64 --input-file=%t-64.s %s // rdar://9503326 // rdar://9606600 extern void use(id); extern void use_block(void (^)(void)); -@class NSArray; + +struct NSFastEnumerationState; +@interface NSArray +- (unsigned long) countByEnumeratingWithState: (struct NSFastEnumerationState*) state + objects: (id*) buffer + count: (unsigned long) bufferSize; +@end; void test0(NSArray *array) { // 'x' should be initialized without a retain. @@ -17,12 +23,37 @@ void test0(NSArray *array) { } // CHECK-LP64: define void @test0( -// CHECK-LP64: alloca [[ARRAY_T:%.*]]*, +// CHECK-LP64: [[ARRAY:%.*]] = alloca [[ARRAY_T:%.*]]*, // CHECK-LP64-NEXT: [[X:%.*]] = alloca i8*, // CHECK-LP64-NEXT: [[STATE:%.*]] = alloca [[STATE_T:%.*]], -// CHECK-LP64-NEXT: alloca [16 x i8*], align 8 +// CHECK-LP64-NEXT: [[BUFFER:%.*]] = alloca [16 x i8*], align 8 // CHECK-LP64-NEXT: [[BLOCK:%.*]] = alloca [[BLOCK_T:<{.*}>]], +// Initialize 'array'. +// CHECK-LP64-NEXT: [[T0:%.*]] = bitcast [[ARRAY_T:%.*]]* {{%.*}} to i8* +// CHECK-LP64-NEXT: [[T1:%.*]] = call i8* @objc_retain(i8* [[T0]]) +// CHECK-LP64-NEXT: [[T2:%.*]] = bitcast i8* [[T1]] to [[ARRAY_T]]* +// CHECK-LP64-NEXT: store [[ARRAY_T]]* [[T2]], [[ARRAY_T]]** [[ARRAY]], align 8 + +// Initialize the fast enumaration state. +// CHECK-LP64-NEXT: [[T0:%.*]] = bitcast [[STATE_T]]* [[STATE]] to i8* +// CHECK-LP64-NEXT: call void @llvm.memset.p0i8.i64(i8* [[T0]], i8 0, i64 64, i32 8, i1 false) + +// Evaluate the collection expression and retain. +// CHECK-LP64-NEXT: [[T0:%.*]] = load [[ARRAY_T]]** [[ARRAY]], align 8 +// CHECK-LP64-NEXT: [[T1:%.*]] = bitcast [[ARRAY_T]]* [[T0]] to i8* +// CHECK-LP64-NEXT: [[T2:%.*]] = call i8* @objc_retain(i8* [[T1]]) +// CHECK-LP64-NEXT: [[SAVED_ARRAY:%.*]] = bitcast i8* [[T2]] to [[ARRAY_T]]* + +// Call the enumeration method. +// CHECK-LP64-NEXT: [[T0:%.*]] = load i8** @"\01L_OBJC_SELECTOR_REFERENCES_ +// CHECK-LP64-NEXT: [[T1:%.*]] = bitcast [[ARRAY_T]]* [[SAVED_ARRAY]] to i8* +// CHECK-LP64-NEXT: [[SIZE:%.*]] = call i64 bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to i64 (i8*, i8*, [[STATE_T]]*, [16 x i8*]*, i64)*)(i8* [[T1]], i8* [[T0]], [[STATE_T]]* [[STATE]], [16 x i8*]* [[BUFFER]], i64 16) + +// Check for a nonzero result. +// CHECK-LP64-NEXT: [[T0:%.*]] = icmp eq i64 [[SIZE]], 0 +// CHECK-LP64-NEXT: br i1 [[T0]] + // CHECK-LP64: [[T0:%.*]] = getelementptr inbounds [[STATE_T]]* [[STATE]], i32 0, i32 1 // CHECK-LP64-NEXT: [[T1:%.*]] = load i8*** [[T0]] // CHECK-LP64-NEXT: [[T2:%.*]] = getelementptr i8** [[T1]], i64 @@ -38,6 +69,20 @@ void test0(NSArray *array) { // CHECK-LP64-NEXT: [[T1:%.*]] = load i8** [[T0]] // CHECK-LP64-NEXT: call void @objc_release(i8* [[T1]]) +// CHECK-LP64: [[T0:%.*]] = load i8** @"\01L_OBJC_SELECTOR_REFERENCES_ +// CHECK-LP64-NEXT: [[T1:%.*]] = bitcast [[ARRAY_T]]* [[SAVED_ARRAY]] to i8* +// CHECK-LP64-NEXT: [[SIZE:%.*]] = call i64 bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to i64 (i8*, i8*, [[STATE_T]]*, [16 x i8*]*, i64)*)(i8* [[T1]], i8* [[T0]], [[STATE_T]]* [[STATE]], [16 x i8*]* [[BUFFER]], i64 16) + +// Release the array. +// CHECK-LP64: [[T0:%.*]] = bitcast [[ARRAY_T]]* [[SAVED_ARRAY]] to i8* +// CHECK-LP64-NEXT: call void @objc_release(i8* [[T0]]) + +// Destroy 'array'. +// CHECK-LP64: [[T0:%.*]] = load [[ARRAY_T]]** [[ARRAY]] +// CHECK-LP64-NEXT: [[T1:%.*]] = bitcast [[ARRAY_T]]* [[T0]] to i8* +// CHECK-LP64-NEXT: call void @objc_release(i8* [[T1]]) +// CHECK-LP64-NEXT: ret void + // CHECK-LP64: define internal void @__test0_block_invoke // CHECK-LP64: [[BLOCK:%.*]] = bitcast i8* {{%.*}} to [[BLOCK_T]]* // CHECK-LP64-NEXT: [[T0:%.*]] = getelementptr inbounds [[BLOCK_T]]* [[BLOCK]], i32 0, i32 5 @@ -70,3 +115,57 @@ void test1(NSArray *array) { // CHECK-LP64: call void @use_block // CHECK-LP64-NEXT: call void @objc_destroyWeak(i8** [[T0]]) // CHECK-LP64-NEXT: call void @objc_destroyWeak(i8** [[X]]) + +// rdar://problem/9817306 +@interface Test2 +- (NSArray *) array; +@end +void test2(Test2 *a) { + for (id x in a.array) { + use(x); + } +} + +// CHECK-LP64: define void @test2( +// CHECK-LP64: [[T0:%.*]] = call [[ARRAY_T]]* bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to [[ARRAY_T]]* (i8*, i8*)*)( +// CHECK-LP64-NEXT: [[T1:%.*]] = bitcast [[ARRAY_T]]* [[T0]] to i8* +// CHECK-LP64-NEXT: [[T2:%.*]] = call i8* @objc_retainAutoreleasedReturnValue(i8* [[T1]]) +// CHECK-LP64-NEXT: [[COLL:%.*]] = bitcast i8* [[T2]] to [[ARRAY_T]]* + +// Make sure it's not immediately released before starting the iteration. +// CHECK-LP64-NEXT: load i8** @"\01L_OBJC_SELECTOR_REFERENCES_ +// CHECK-LP64-NEXT: [[T0:%.*]] = bitcast [[ARRAY_T]]* [[COLL]] to i8* +// CHECK-LP64-NEXT: @objc_msgSend + +// This bitcast is for the mutation check. +// CHECK-LP64: [[T0:%.*]] = bitcast [[ARRAY_T]]* [[COLL]] to i8* +// CHECK-LP64-NEXT: @objc_enumerationMutation + +// This bitcast is for the 'next' message send. +// CHECK-LP64: [[T0:%.*]] = bitcast [[ARRAY_T]]* [[COLL]] to i8* +// CHECK-LP64-NEXT: @objc_msgSend + +// This bitcast is for the final release. +// CHECK-LP64: [[T0:%.*]] = bitcast [[ARRAY_T]]* [[COLL]] to i8* +// CHECK-LP64-NEXT: call void @objc_release(i8* [[T0]]) + + +// Check that the 'continue' label is positioned appropriately +// relative to the collection clenaup. +void test3(NSArray *array) { + for (id x in array) { + if (!x) continue; + use(x); + } + + // CHECK-LP64: define void @test3( + // CHECK-LP64: [[ARRAY:%.*]] = alloca [[ARRAY_T]]*, align 8 + // CHECK-LP64-NEXT: [[X:%.*]] = alloca i8*, align 8 + // CHECK-LP64: [[T0:%.*]] = load i8** [[X]], align 8 + // CHECK-LP64-NEXT: [[T1:%.*]] = icmp ne i8* [[T0]], null + // CHECK-LP64-NEXT: br i1 [[T1]], + // CHECK-LP64: br label [[L:%[^ ]+]] + // CHECK-LP64: [[T0:%.*]] = load i8** [[X]], align 8 + // CHECK-LP64-NEXT: call void @use(i8* [[T0]]) + // CHECK-LP64-NEXT: br label [[L]] +} diff --git a/test/CodeGenObjC/arc-ivar-layout.m b/test/CodeGenObjC/arc-ivar-layout.m index cb930fe3d365..30c90fac9e40 100644 --- a/test/CodeGenObjC/arc-ivar-layout.m +++ b/test/CodeGenObjC/arc-ivar-layout.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -fobjc-arc -fobjc-nonfragile-abi -fobjc-runtime-has-weak -triple x86_64-apple-darwin -O0 -S %s -o %t-64.s +// RUN: %clang_cc1 -fobjc-arc -fobjc-runtime-has-weak -triple x86_64-apple-darwin -O0 -S %s -o %t-64.s // RUN: FileCheck -check-prefix LP64 --input-file=%t-64.s %s // rdar://8991729 diff --git a/test/CodeGenObjC/arc-no-runtime.m b/test/CodeGenObjC/arc-no-runtime.m index 39f7da3460e5..3c85e8783cb8 100644 --- a/test/CodeGenObjC/arc-no-runtime.m +++ b/test/CodeGenObjC/arc-no-runtime.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-arc -fobjc-nonfragile-abi -emit-llvm %s -o - | FileCheck %s +// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-arc -emit-llvm %s -o - | FileCheck %s // rdar://problem/9224855 void test0() { diff --git a/test/CodeGenObjC/arc-related-result-type.m b/test/CodeGenObjC/arc-related-result-type.m index c51757df5d8d..f73aa5049f5c 100644 --- a/test/CodeGenObjC/arc-related-result-type.m +++ b/test/CodeGenObjC/arc-related-result-type.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -fobjc-nonfragile-abi -fblocks -fobjc-arc -o - %s | FileCheck %s +// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -fblocks -fobjc-arc -o - %s | FileCheck %s @interface Test0 - (id) self; diff --git a/test/CodeGenObjC/arc-unbridged-cast.m b/test/CodeGenObjC/arc-unbridged-cast.m index 0f3db09f1ffd..5ab5d02fffee 100644 --- a/test/CodeGenObjC/arc-unbridged-cast.m +++ b/test/CodeGenObjC/arc-unbridged-cast.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple x86_64-apple-darwin11 -emit-llvm -fobjc-nonfragile-abi -fobjc-arc -o - %s | FileCheck %s +// RUN: %clang_cc1 -triple x86_64-apple-darwin11 -emit-llvm -fobjc-arc -o - %s | FileCheck %s // rdar://9744349 typedef const struct __CFString * CFStringRef; @@ -29,8 +29,6 @@ CFStringRef SomeOtherFunc() __attribute__((cf_returns_retained)); id MMM() { id obj = (id)((CFStringRef) __builtin___CFStringMakeConstantString ("" "Some CF String" "")); - if (obj) - return (id) SomeOtherFunc(); return 0; } diff --git a/test/CodeGenObjC/arc-unopt.m b/test/CodeGenObjC/arc-unopt.m index ed46052af848..c319bf260f6b 100644 --- a/test/CodeGenObjC/arc-unopt.m +++ b/test/CodeGenObjC/arc-unopt.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -fobjc-nonfragile-abi -fobjc-runtime-has-weak -fblocks -fobjc-arc -o - %s | FileCheck %s +// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -fobjc-runtime-has-weak -fblocks -fobjc-arc -o - %s | FileCheck %s // A test to ensure that we generate fused calls at -O0. diff --git a/test/CodeGenObjC/arc-weak-property.m b/test/CodeGenObjC/arc-weak-property.m index c0796046446e..0a6b2a63bfc6 100644 --- a/test/CodeGenObjC/arc-weak-property.m +++ b/test/CodeGenObjC/arc-weak-property.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -fobjc-nonfragile-abi -fobjc-runtime-has-weak -fblocks -fobjc-arc -o - %s | FileCheck %s +// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -fobjc-runtime-has-weak -fblocks -fobjc-arc -o - %s | FileCheck %s // rdar://8899430 @interface WeakPropertyTest { diff --git a/test/CodeGenObjC/arc-with-atthrow.m b/test/CodeGenObjC/arc-with-atthrow.m new file mode 100644 index 000000000000..213b05bffded --- /dev/null +++ b/test/CodeGenObjC/arc-with-atthrow.m @@ -0,0 +1,17 @@ +// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -fobjc-arc -fobjc-exceptions -o - %s | FileCheck %s +// pr10411 +// rdar://10042689 + +id make(void); +void test() { + @throw make(); +} + +// TODO: We should probably emit this specific pattern without the reclaim. + +// CHECK: define void @test() +// CHECK: [[T0:%.*]] = call i8* @make() +// CHECK-NEXT: [[T1:%.*]] = call i8* @objc_retainAutoreleasedReturnValue(i8* [[T0]]) +// CHECK-NEXT: [[T2:%.*]] = call i8* @objc_autorelease(i8* [[T1]]) +// CHECK-NEXT: call void @objc_exception_throw(i8* [[T2]]) noreturn +// CHECK-NEXT: unreachable diff --git a/test/CodeGenObjC/arc.m b/test/CodeGenObjC/arc.m index 407b3eb77167..e97e625b06eb 100644 --- a/test/CodeGenObjC/arc.m +++ b/test/CodeGenObjC/arc.m @@ -1,5 +1,5 @@ -// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -fobjc-nonfragile-abi -fblocks -fobjc-arc -fobjc-runtime-has-weak -O2 -disable-llvm-optzns -o - %s | FileCheck %s -// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -fobjc-nonfragile-abi -fblocks -fobjc-arc -fobjc-runtime-has-weak -o - %s | FileCheck -check-prefix=CHECK-GLOBALS %s +// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -fblocks -fobjc-arc -fobjc-runtime-has-weak -O2 -disable-llvm-optzns -o - %s | FileCheck %s +// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -fblocks -fobjc-arc -fobjc-runtime-has-weak -o - %s | FileCheck -check-prefix=CHECK-GLOBALS %s // CHECK: define void @test0 void test0(id x) { @@ -578,18 +578,18 @@ void test22(_Bool cond) { // CHECK: define void @test22( // CHECK: [[COND:%.*]] = alloca i8, // CHECK-NEXT: [[X:%.*]] = alloca i8*, - // CHECK-NEXT: [[RELCOND:%.*]] = alloca i1 // CHECK-NEXT: [[RELVAL:%.*]] = alloca i8* - // CHECK-NEXT: store i1 false, i1* [[RELCOND]] + // CHECK-NEXT: [[RELCOND:%.*]] = alloca i1 // CHECK-NEXT: zext // CHECK-NEXT: store // CHECK-NEXT: [[T0:%.*]] = load i8* [[COND]] // CHECK-NEXT: [[T1:%.*]] = trunc i8 [[T0]] to i1 + // CHECK-NEXT: store i1 false, i1* [[RELCOND]] // CHECK-NEXT: br i1 [[T1]], // CHECK: br label // CHECK: [[CALL:%.*]] = call i8* @test22_helper() - // CHECK-NEXT: store i1 true, i1* [[RELCOND]] // CHECK-NEXT: store i8* [[CALL]], i8** [[RELVAL]] + // CHECK-NEXT: store i1 true, i1* [[RELCOND]] // CHECK-NEXT: br label // CHECK: [[T0:%.*]] = phi i8* [ null, {{%.*}} ], [ [[CALL]], {{%.*}} ] // CHECK-NEXT: [[T1:%.*]] = call i8* @objc_retain(i8* [[T0]]) nounwind @@ -1552,3 +1552,387 @@ void test54(int first, ...) { // CHECK: define internal void @"\01-[Test55(Category) dealloc]"( // CHECK-NOT: ret // CHECK: call void bitcast (i8* ({{%.*}}*, i8*, ...)* @objc_msgSendSuper2 to void ({{%.*}}*, i8*)*)( + +// rdar://problem/8024350 +@protocol Test56Protocol ++ (id) make __attribute__((ns_returns_retained)); +@end +@interface Test56<Test56Protocol> @end +@implementation Test56 +// CHECK: define internal i8* @"\01+[Test56 make]"( ++ (id) make { + extern id test56_helper(void); + // CHECK: [[T0:%.*]] = call i8* @test56_helper() + // CHECK-NEXT: [[T1:%.*]] = call i8* @objc_retainAutoreleasedReturnValue(i8* [[T0]]) + // CHECK-NEXT: ret i8* [[T1]] + return test56_helper(); +} +@end +void test56_test(void) { + id x = [Test56 make]; + // CHECK: define void @test56_test() + // CHECK: [[X:%.*]] = alloca i8*, align 8 + // CHECK: [[T0:%.*]] = call i8* bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to i8* (i8*, i8*)*)( + // CHECK-NEXT: store i8* [[T0]], i8** [[X]] + // CHECK-NEXT: [[T0:%.*]] = load i8** [[X]] + // CHECK-NEXT: call void @objc_release(i8* [[T0]]) + // CHECK-NEXT: ret void +} + +// rdar://problem/9784964 +@interface Test57 +@property (nonatomic, strong) id strong; +@property (nonatomic, weak) id weak; +@property (nonatomic, unsafe_unretained) id unsafe; +@end +@implementation Test57 +@synthesize strong, weak, unsafe; +@end +// CHECK: define internal i8* @"\01-[Test57 strong]"( +// CHECK: [[T0:%.*]] = load [[TEST57:%.*]]** {{%.*}} +// CHECK-NEXT: [[T1:%.*]] = load i64* @"OBJC_IVAR_$_Test57.strong" +// CHECK-NEXT: [[T2:%.*]] = bitcast [[TEST57]]* [[T0]] to i8* +// CHECK-NEXT: [[T3:%.*]] = getelementptr inbounds i8* [[T2]], i64 [[T1]] +// CHECK-NEXT: [[T4:%.*]] = bitcast i8* [[T3]] to i8** +// CHECK-NEXT: [[T5:%.*]] = load i8** [[T4]] +// CHECK-NEXT: ret i8* [[T5]] + +// CHECK: define internal i8* @"\01-[Test57 weak]"( +// CHECK: [[T0:%.*]] = load [[TEST57]]** {{%.*}} +// CHECK-NEXT: [[T1:%.*]] = load i64* @"OBJC_IVAR_$_Test57.weak" +// CHECK-NEXT: [[T2:%.*]] = bitcast [[TEST57]]* [[T0]] to i8* +// CHECK-NEXT: [[T3:%.*]] = getelementptr inbounds i8* [[T2]], i64 [[T1]] +// CHECK-NEXT: [[T4:%.*]] = bitcast i8* [[T3]] to i8** +// CHECK-NEXT: [[T5:%.*]] = call i8* @objc_loadWeakRetained(i8** [[T4]]) +// CHECK-NEXT: [[T6:%.*]] = call i8* @objc_autoreleaseReturnValue(i8* [[T5]]) +// CHECK-NEXT: ret i8* [[T6]] + +// CHECK: define internal i8* @"\01-[Test57 unsafe]"( +// CHECK: [[T0:%.*]] = load [[TEST57]]** {{%.*}} +// CHECK-NEXT: [[T1:%.*]] = load i64* @"OBJC_IVAR_$_Test57.unsafe" +// CHECK-NEXT: [[T2:%.*]] = bitcast [[TEST57]]* [[T0]] to i8* +// CHECK-NEXT: [[T3:%.*]] = getelementptr inbounds i8* [[T2]], i64 [[T1]] +// CHECK-NEXT: [[T4:%.*]] = bitcast i8* [[T3]] to i8** +// CHECK-NEXT: [[T5:%.*]] = load i8** [[T4]] +// CHECK-NEXT: ret i8* [[T5]] + +// rdar://problem/9821110 +@interface Test58 +- (char*) interior __attribute__((objc_returns_inner_pointer)); +// Should we allow this on properties? +@end +extern Test58 *test58_helper(void); + +// CHECK: define void @test58a() +void test58a(void) { + // CHECK: [[T0:%.*]] = call [[TEST58:%.*]]* @test58_helper() + // CHECK-NEXT: [[T1:%.*]] = bitcast [[TEST58]]* [[T0]] to i8* + // CHECK-NEXT: [[T2:%.*]] = call i8* @objc_retainAutoreleasedReturnValue(i8* [[T1]]) + // CHECK-NEXT: [[T3:%.*]] = bitcast i8* [[T2]] to [[TEST58]]* + // CHECK-NEXT: store [[TEST58]]* [[T3]] + // CHECK-NEXT: [[T0:%.*]] = load [[TEST58]]** + // CHECK-NEXT: [[T1:%.*]] = bitcast [[TEST58]]* [[T0]] to i8* + // CHECK-NEXT: [[T2:%.*]] = call i8* @objc_retainAutorelease(i8* [[T1]]) + // CHECK-NEXT: [[T3:%.*]] = bitcast i8* [[T2]] to [[TEST58]]* + // CHECK-NEXT: [[T4:%.*]] = load i8** @"\01L_OBJC_SELECTOR_REFERENCES_ + // CHECK-NEXT: [[T5:%.*]] = bitcast [[TEST58]]* [[T3]] to i8* + // CHECK-NEXT: [[T6:%.*]] = call i8* bitcast + // CHECK-NEXT: store i8* [[T6]], i8** + // CHECK-NEXT: [[T0:%.*]] = load [[TEST58]]** + // CHECK-NEXT: [[T1:%.*]] = bitcast [[TEST58]]* [[T0]] to i8* + // CHECK-NEXT: call void @objc_release(i8* [[T1]]) nounwind, !clang.imprecise_release + // CHECK-NEXT: ret void + Test58 *ptr = test58_helper(); + char *c = [(ptr) interior]; +} + +// CHECK: define void @test58b() +void test58b(void) { + // CHECK: [[T0:%.*]] = call [[TEST58:%.*]]* @test58_helper() + // CHECK-NEXT: [[T1:%.*]] = bitcast [[TEST58]]* [[T0]] to i8* + // CHECK-NEXT: [[T2:%.*]] = call i8* @objc_retainAutoreleasedReturnValue(i8* [[T1]]) + // CHECK-NEXT: [[T3:%.*]] = bitcast i8* [[T2]] to [[TEST58]]* + // CHECK-NEXT: store [[TEST58]]* [[T3]] + // CHECK-NEXT: [[T0:%.*]] = load [[TEST58]]** + // CHECK-NEXT: [[T1:%.*]] = load i8** @"\01L_OBJC_SELECTOR_REFERENCES_ + // CHECK-NEXT: [[T2:%.*]] = bitcast [[TEST58]]* [[T0]] to i8* + // CHECK-NEXT: [[T3:%.*]] = call i8* bitcast + // CHECK-NEXT: store i8* [[T3]], i8** + // CHECK-NEXT: [[T0:%.*]] = load [[TEST58]]** + // CHECK-NEXT: [[T1:%.*]] = bitcast [[TEST58]]* [[T0]] to i8* + // CHECK-NEXT: call void @objc_release(i8* [[T1]]) nounwind + // CHECK-NOT: clang.imprecise_release + // CHECK-NEXT: ret void + __attribute__((objc_precise_lifetime)) Test58 *ptr = test58_helper(); + char *c = [ptr interior]; +} + +// rdar://problem/9842343 +void test59(void) { + extern id test59_getlock(void); + extern void test59_body(void); + @synchronized (test59_getlock()) { + test59_body(); + } + + // CHECK: define void @test59() + // CHECK: [[T0:%.*]] = call i8* @test59_getlock() + // CHECK-NEXT: [[T1:%.*]] = call i8* @objc_retainAutoreleasedReturnValue(i8* [[T0]]) + // CHECK-NEXT: call void @objc_sync_enter(i8* [[T1]]) + // CHECK-NEXT: call void @test59_body() + // CHECK-NEXT: call void @objc_sync_exit(i8* [[T1]]) + // CHECK-NEXT: call void @objc_release(i8* [[T1]]) + // CHECK-NEXT: ret void +} + +// rdar://problem/9814099 +// Test that we correctly initialize __block variables +// when the initialization captures the variable. +void test60a(void) { + __block void (^block)(void) = ^{ block(); }; + // CHECK: define void @test60a() + // CHECK: [[BYREF:%.*]] = alloca [[BYREF_T:%.*]], + + // Zero-initialization before running the initializer. + // CHECK: [[T0:%.*]] = getelementptr inbounds [[BYREF_T]]* [[BYREF]], i32 0, i32 6 + // CHECK-NEXT: store void ()* null, void ()** [[T0]], align 8 + + // Run the initializer as an assignment. + // CHECK: [[T0:%.*]] = bitcast void ()* {{%.*}} to i8* + // CHECK-NEXT: [[T1:%.*]] = call i8* @objc_retainBlock(i8* [[T0]]) + // CHECK-NEXT: [[T2:%.*]] = bitcast i8* [[T1]] to void ()* + // CHECK-NEXT: [[T3:%.*]] = getelementptr inbounds [[BYREF_T]]* [[BYREF]], i32 0, i32 1 + // CHECK-NEXT: [[T4:%.*]] = load [[BYREF_T]]** [[T3]] + // CHECK-NEXT: [[T5:%.*]] = getelementptr inbounds [[BYREF_T]]* [[T4]], i32 0, i32 6 + // CHECK-NEXT: [[T6:%.*]] = load void ()** [[T5]], align 8 + // CHECK-NEXT: store void ()* {{%.*}}, void ()** [[T5]], align 8 + // CHECK-NEXT: [[T7:%.*]] = bitcast void ()* [[T6]] to i8* + // CHECK-NEXT: call void @objc_release(i8* [[T7]]) + + // Destroy at end of function. + // CHECK-NEXT: [[SLOT:%.*]] = getelementptr inbounds [[BYREF_T]]* [[BYREF]], i32 0, i32 6 + // CHECK-NEXT: [[T0:%.*]] = bitcast [[BYREF_T]]* [[BYREF]] to i8* + // CHECK-NEXT: call void @_Block_object_dispose(i8* [[T0]], i32 8) + // CHECK-NEXT: [[T1:%.*]] = load void ()** [[SLOT]] + // CHECK-NEXT: [[T2:%.*]] = bitcast void ()* [[T1]] to i8* + // CHECK-NEXT: call void @objc_release(i8* [[T2]]) + // CHECK-NEXT: ret void +} + +// Test that we correctly assign to __block variables when the +// assignment captures the variable. +void test60b(void) { + __block void (^block)(void); + block = ^{ block(); }; + + // CHECK: define void @test60b() + // CHECK: [[BYREF:%.*]] = alloca [[BYREF_T:%.*]], + + // Zero-initialize. + // CHECK: [[T0:%.*]] = getelementptr inbounds [[BYREF_T]]* [[BYREF]], i32 0, i32 6 + // CHECK-NEXT: store void ()* null, void ()** [[T0]], align 8 + + // CHECK-NEXT: [[SLOT:%.*]] = getelementptr inbounds [[BYREF_T]]* [[BYREF]], i32 0, i32 6 + + // The assignment. + // CHECK: [[T0:%.*]] = bitcast void ()* {{%.*}} to i8* + // CHECK-NEXT: [[T1:%.*]] = call i8* @objc_retainBlock(i8* [[T0]]) + // CHECK-NEXT: [[T2:%.*]] = bitcast i8* [[T1]] to void ()* + // CHECK-NEXT: [[T3:%.*]] = getelementptr inbounds [[BYREF_T]]* [[BYREF]], i32 0, i32 1 + // CHECK-NEXT: [[T4:%.*]] = load [[BYREF_T]]** [[T3]] + // CHECK-NEXT: [[T5:%.*]] = getelementptr inbounds [[BYREF_T]]* [[T4]], i32 0, i32 6 + // CHECK-NEXT: [[T6:%.*]] = load void ()** [[T5]], align 8 + // CHECK-NEXT: store void ()* {{%.*}}, void ()** [[T5]], align 8 + // CHECK-NEXT: [[T7:%.*]] = bitcast void ()* [[T6]] to i8* + // CHECK-NEXT: call void @objc_release(i8* [[T7]]) + + // Destroy at end of function. + // CHECK-NEXT: [[T0:%.*]] = bitcast [[BYREF_T]]* [[BYREF]] to i8* + // CHECK-NEXT: call void @_Block_object_dispose(i8* [[T0]], i32 8) + // CHECK-NEXT: [[T1:%.*]] = load void ()** [[SLOT]] + // CHECK-NEXT: [[T2:%.*]] = bitcast void ()* [[T1]] to i8* + // CHECK-NEXT: call void @objc_release(i8* [[T2]]) + // CHECK-NEXT: ret void +} + +// Verify that we don't try to reclaim the result of performSelector. +// rdar://problem/9887545 +@interface Test61 +- (id) performSelector: (SEL) selector; +- (void) test61_void; +- (id) test61_id; +@end +void test61(void) { + // CHECK: define void @test61() + // CHECK: [[Y:%.*]] = alloca i8*, align 8 + + extern id test61_make(void); + + // CHECK-NEXT: [[T0:%.*]] = call i8* @test61_make() + // CHECK-NEXT: [[T1:%.*]] = call i8* @objc_retainAutoreleasedReturnValue(i8* [[T0]]) + // CHECK-NEXT: [[T2:%.*]] = load i8** @"\01L_OBJC_SELECTOR_REFERENCES_ + // CHECK-NEXT: [[T3:%.*]] = load i8** @"\01L_OBJC_SELECTOR_REFERENCES_ + // CHECK-NEXT: [[T4:%.*]] = call i8* bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to i8* (i8*, i8*, i8*)*)(i8* [[T1]], i8* [[T3]], i8* [[T2]]) + // CHECK-NEXT: call void @objc_release(i8* [[T1]]) + [test61_make() performSelector: @selector(test61_void)]; + + // CHECK-NEXT: [[T0:%.*]] = call i8* @test61_make() + // CHECK-NEXT: [[T1:%.*]] = call i8* @objc_retainAutoreleasedReturnValue(i8* [[T0]]) + // CHECK-NEXT: [[T2:%.*]] = load i8** @"\01L_OBJC_SELECTOR_REFERENCES_ + // CHECK-NEXT: [[T3:%.*]] = load i8** @"\01L_OBJC_SELECTOR_REFERENCES_ + // CHECK-NEXT: [[T4:%.*]] = call i8* bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to i8* (i8*, i8*, i8*)*)(i8* [[T1]], i8* [[T3]], i8* [[T2]]) + // CHECK-NEXT: [[T5:%.*]] = call i8* @objc_retainAutoreleasedReturnValue(i8* [[T4]]) + // CHECK-NEXT: store i8* [[T5]], i8** [[Y]] + // CHECK-NEXT: call void @objc_release(i8* [[T1]]) + id y = [test61_make() performSelector: @selector(test61_id)]; + + // CHECK-NEXT: [[T0:%.*]] = load i8** [[Y]] + // CHECK-NEXT: call void @objc_release(i8* [[T0]]) + // CHECK-NEXT: ret void +} + +// rdar://problem/9891815 +void test62(void) { + // CHECK: define void @test62() + // CHECK: [[I:%.*]] = alloca i32, align 4 + // CHECK-NEXT: [[CLEANUP_VALUE:%.*]] = alloca i8* + // CHECK-NEXT: [[CLEANUP_REQUIRED:%.*]] = alloca i1 + extern id test62_make(void); + extern void test62_body(void); + + // CHECK-NEXT: store i32 0, i32* [[I]], align 4 + // CHECK-NEXT: br label + + // CHECK: [[T0:%.*]] = load i32* [[I]], align 4 + // CHECK-NEXT: [[T1:%.*]] = icmp ne i32 [[T0]], 20 + // CHECK-NEXT: br i1 [[T1]], + + for (unsigned i = 0; i != 20; ++i) { + // CHECK: [[T0:%.*]] = load i32* [[I]], align 4 + // CHECK-NEXT: [[T1:%.*]] = icmp ne i32 [[T0]], 0 + // CHECK-NEXT: store i1 false, i1* [[CLEANUP_REQUIRED]] + // CHECK-NEXT: br i1 [[T1]], + // CHECK: [[T0:%.*]] = call i8* @test62_make() + // CHECK-NEXT: [[T1:%.*]] = call i8* @objc_retainAutoreleasedReturnValue(i8* [[T0]]) + // CHECK-NEXT: store i8* [[T1]], i8** [[CLEANUP_VALUE]] + // CHECK-NEXT: store i1 true, i1* [[CLEANUP_REQUIRED]] + // CHECK-NEXT: [[T2:%.*]] = icmp ne i8* [[T1]], null + // CHECK-NEXT: br label + // CHECK: [[COND:%.*]] = phi i1 [ false, {{%.*}} ], [ [[T2]], {{%.*}} ] + // CHECK-NEXT: [[T0:%.*]] = load i1* [[CLEANUP_REQUIRED]] + // CHECK-NEXT: br i1 [[T0]], + // CHECK: [[T0:%.*]] = load i8** [[CLEANUP_VALUE]] + // CHECK-NEXT: call void @objc_release(i8* [[T0]]) + // CHECK-NEXT: br label + // CHECK: br i1 [[COND]] + // CHECK: call void @test62_body() + // CHECK-NEXT: br label + // CHECK: br label + if (i != 0 && test62_make() != 0) + test62_body(); + } + + // CHECK: [[T0:%.*]] = load i32* [[I]], align 4 + // CHECK-NEXT: [[T1:%.*]] = add i32 [[T0]], 1 + // CHECK-NEXT: store i32 [[T1]], i32* [[I]] + // CHECK-NEXT: br label + + // CHECK: ret void +} + +// rdar://9971982 +@class NSString; + +@interface Person { + NSString *name; +} +@property NSString *address; +@end + +@implementation Person +@synthesize address; +@end +// CHECK: call i8* @objc_getProperty +// CHECK: call void @objc_setProperty + +// rdar://problem/10088932 +void test64_helper(id); +void test64a(void) { + int x; + test64_helper(^{ (void) x; }); + + // CHECK: define void @test64a() + // CHECK: [[X:%.*]] = alloca i32, align 4 + // CHECK-NEXT: [[BLOCK:%.*]] = alloca [[BLOCK_T:<{.*}>]], align 8 + // CHECK: [[T0:%.*]] = bitcast [[BLOCK_T]]* [[BLOCK]] to void ()* + // CHECK-NEXT: [[T1:%.*]] = bitcast void ()* [[T0]] to i8* + // CHECK-NEXT: [[T2:%.*]] = call i8* @objc_retainBlock(i8* [[T1]]) + // CHECK-NEXT: [[T3:%.*]] = bitcast i8* [[T2]] to void ()* + // CHECK-NEXT: [[T4:%.*]] = bitcast void ()* [[T3]] to i8* + // CHECK-NEXT: call void @test64_helper(i8* [[T4]]) + // CHECK-NEXT: [[T5:%.*]] = bitcast void ()* [[T3]] to i8* + // CHECK-NEXT: call void @objc_release(i8* [[T5]]) + // CHECK-NEXT: ret void +} +void test64b(void) { + int x; + id b = ^{ (void) x; }; + + // CHECK: define void @test64b() + // CHECK: [[X:%.*]] = alloca i32, align 4 + // CHECK-NEXT: [[B:%.*]] = alloca i8*, align 8 + // CHECK-NEXT: [[BLOCK:%.*]] = alloca [[BLOCK_T:<{.*}>]], align 8 + // CHECK: [[T0:%.*]] = bitcast [[BLOCK_T]]* [[BLOCK]] to void ()* + // CHECK-NEXT: [[T1:%.*]] = bitcast void ()* [[T0]] to i8* + // CHECK-NEXT: [[T2:%.*]] = call i8* @objc_retainBlock(i8* [[T1]]) + // CHECK-NEXT: [[T3:%.*]] = bitcast i8* [[T2]] to void ()* + // CHECK-NEXT: [[T4:%.*]] = bitcast void ()* [[T3]] to i8* + // CHECK-NEXT: store i8* [[T4]], i8** [[B]], align 8 + // CHECK-NEXT: [[T5:%.*]] = load i8** [[B]] + // CHECK-NEXT: call void @objc_release(i8* [[T5]]) + // CHECK-NEXT: ret void +} + +// rdar://problem/9979150 +@interface Test65 +@property (strong) void(^ablock)(void); +@property (nonatomic, strong) void(^nblock)(void); +@end +@implementation Test65 +@synthesize ablock, nblock; +// CHECK: define internal void ()* @"\01-[Test65 ablock]"( +// CHECK: call i8* @objc_getProperty(i8* {{%.*}}, i8* {{%.*}}, i64 {{%.*}}, i1 zeroext true) + +// CHECK: define internal void @"\01-[Test65 setAblock:]"( +// CHECK: call void @objc_setProperty(i8* {{%.*}}, i8* {{%.*}}, i64 {{%.*}}, i8* {{%.*}}, i1 zeroext true, i1 zeroext true) + +// CHECK: define internal void ()* @"\01-[Test65 nblock]"( +// CHECK: call i8* @objc_getProperty(i8* {{%.*}}, i8* {{%.*}}, i64 {{%.*}}, i1 zeroext false) + +// CHECK: define internal void @"\01-[Test65 setNblock:]"( +// CHECK: call void @objc_setProperty(i8* {{%.*}}, i8* {{%.*}}, i64 {{%.*}}, i8* {{%.*}}, i1 zeroext false, i1 zeroext true) +@end + +// Verify that we successfully parse and preserve this attribute in +// this position. +@interface Test66 +- (void) consume: (id __attribute__((ns_consumed))) ptr; +@end +void test66(void) { + extern Test66 *test66_receiver(void); + extern id test66_arg(void); + [test66_receiver() consume: test66_arg()]; +} +// CHECK: define void @test66() +// CHECK: [[T0:%.*]] = call [[TEST66:%.*]]* @test66_receiver() +// CHECK-NEXT: [[T1:%.*]] = bitcast [[TEST66]]* [[T0]] to i8* +// CHECK-NEXT: [[T2:%.*]] = call i8* @objc_retainAutoreleasedReturnValue(i8* [[T1]]) +// CHECK-NEXT: [[T3:%.*]] = bitcast i8* [[T2]] to [[TEST66]]* +// CHECK-NEXT: [[T4:%.*]] = call i8* @test66_arg() +// CHECK-NEXT: [[T5:%.*]] = call i8* @objc_retainAutoreleasedReturnValue(i8* [[T4]]) +// CHECK-NEXT: [[T6:%.*]] = load i8** @"\01L_OBJC_SELECTOR_REFERENCES +// CHECK-NEXT: [[T7:%.*]] = bitcast [[TEST66]]* [[T3]] to i8* +// CHECK-NEXT: call void bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to void (i8*, i8*, i8*)*)(i8* [[T7]], i8* [[T6]], i8* [[T5]]) +// CHECK-NEXT: [[T8:%.*]] = bitcast [[TEST66]]* [[T3]] to i8* +// CHECK-NEXT: call void @objc_release(i8* [[T8]]) +// CHECK-NEXT: ret void diff --git a/test/CodeGenObjC/arm-atomic-scalar-setter-getter.m b/test/CodeGenObjC/arm-atomic-scalar-setter-getter.m index 2515c706a9bf..535cbbb85c4f 100644 --- a/test/CodeGenObjC/arm-atomic-scalar-setter-getter.m +++ b/test/CodeGenObjC/arm-atomic-scalar-setter-getter.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple armv7-apple-darwin10 -fobjc-nonfragile-abi -emit-llvm -o - %s | FileCheck -check-prefix=CHECK-ARM %s +// RUN: %clang_cc1 -triple armv7-apple-darwin10 -emit-llvm -o - %s | FileCheck -check-prefix=CHECK-ARM %s // rdar://7761305 @interface I diff --git a/test/CodeGenObjC/assign.m b/test/CodeGenObjC/assign.m index 87e3834fc874..82da800e7399 100644 --- a/test/CodeGenObjC/assign.m +++ b/test/CodeGenObjC/assign.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple x86_64 -emit-llvm -o - %s | FileCheck %s +// RUN: %clang_cc1 -triple x86_64 -fobjc-fragile-abi -emit-llvm -o - %s | FileCheck %s struct s0 { int x; diff --git a/test/CodeGenObjC/atomic-aggregate-property.m b/test/CodeGenObjC/atomic-aggregate-property.m index 3cd12a5c2c1a..978299b45a6d 100644 --- a/test/CodeGenObjC/atomic-aggregate-property.m +++ b/test/CodeGenObjC/atomic-aggregate-property.m @@ -1,5 +1,5 @@ -// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-nonfragile-abi -fobjc-gc -emit-llvm -o - %s | FileCheck -check-prefix LP64 %s -// RUN: %clang_cc1 -x objective-c++ -triple x86_64-apple-darwin10 -fobjc-nonfragile-abi -fobjc-gc -emit-llvm -o - %s | FileCheck -check-prefix LP64 %s +// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-gc -emit-llvm -o - %s | FileCheck -check-prefix LP64 %s +// RUN: %clang_cc1 -x objective-c++ -triple x86_64-apple-darwin10 -fobjc-gc -emit-llvm -o - %s | FileCheck -check-prefix LP64 %s // rdar: // 7849824 struct s { @@ -23,7 +23,20 @@ struct s1 { @synthesize y; @synthesize z; @end -// CHECK-LP64: call void @objc_copyStruct -// CHECK-LP64: call void @objc_copyStruct -// CHECK-LP64: call void @objc_copyStruct -// CHECK-LP64: call i8* @objc_memmove_collectable +// CHECK-LP64: define internal double @"\01-[A x]"( +// CHECK-LP64: load atomic i64* {{%.*}} unordered, align 8 + +// CHECK-LP64: define internal void @"\01-[A setX:]"( +// CHECK-LP64: store atomic i64 {{%.*}}, i64* {{%.*}} unordered, align 8 + +// CHECK-LP64: define internal void @"\01-[A y]"( +// CHECK-LP64: call void @objc_copyStruct(i8* {{%.*}}, i8* {{%.*}}, i64 32, i1 zeroext true, i1 zeroext false) + +// CHECK-LP64: define internal void @"\01-[A setY:]"( +// CHECK-LP64: call void @objc_copyStruct(i8* {{%.*}}, i8* {{%.*}}, i64 32, i1 zeroext true, i1 zeroext false) + +// CHECK-LP64: define internal void @"\01-[A z]"( +// CHECK-LP64: call i8* @objc_memmove_collectable( + +// CHECK-LP64: define internal void @"\01-[A setZ:]"( +// CHECK-LP64: call i8* @objc_memmove_collectable( diff --git a/test/CodeGenObjC/attr-availability.m b/test/CodeGenObjC/attr-availability.m index d2b2973c78d3..375a5be4fadd 100644 --- a/test/CodeGenObjC/attr-availability.m +++ b/test/CodeGenObjC/attr-availability.m @@ -1,6 +1,6 @@ -// RUN: %clang_cc1 -fvisibility hidden -fobjc-nonfragile-abi "-triple" "x86_64-apple-darwin8.0.0" -emit-llvm -o - %s | FileCheck -check-prefix=CHECK-10_4 %s -// RUN: %clang_cc1 -fvisibility hidden -fobjc-nonfragile-abi "-triple" "x86_64-apple-darwin9.0.0" -emit-llvm -o - %s | FileCheck -check-prefix=CHECK-10_5 %s -// RUN: %clang_cc1 -fvisibility hidden -fobjc-nonfragile-abi "-triple" "x86_64-apple-darwin10.0.0" -emit-llvm -o - %s | FileCheck -check-prefix=CHECK-10_6 %s +// RUN: %clang_cc1 -fvisibility hidden "-triple" "x86_64-apple-darwin8.0.0" -emit-llvm -o - %s | FileCheck -check-prefix=CHECK-10_4 %s +// RUN: %clang_cc1 -fvisibility hidden "-triple" "x86_64-apple-darwin9.0.0" -emit-llvm -o - %s | FileCheck -check-prefix=CHECK-10_5 %s +// RUN: %clang_cc1 -fvisibility hidden "-triple" "x86_64-apple-darwin10.0.0" -emit-llvm -o - %s | FileCheck -check-prefix=CHECK-10_6 %s // CHECK-10_4: @"OBJC_CLASS_$_WeakClass1" = extern_weak global // CHECK-10_5: @"OBJC_CLASS_$_WeakClass1" = external global diff --git a/test/CodeGenObjC/autorelease.m b/test/CodeGenObjC/autorelease.m index 7bf40f11ffd1..9260c3fafe8b 100644 --- a/test/CodeGenObjC/autorelease.m +++ b/test/CodeGenObjC/autorelease.m @@ -1,5 +1,5 @@ -// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -fobjc-arc -fobjc-nonfragile-abi -fobjc-runtime-has-arc -o - %s | FileCheck %s -// RUN: %clang_cc1 -triple x86_64-apple-darwin11 -emit-llvm -fobjc-nonfragile-abi -fobjc-runtime-has-arc -o - %s | FileCheck %s +// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -fobjc-arc -fobjc-runtime-has-arc -o - %s | FileCheck %s +// RUN: %clang_cc1 -triple x86_64-apple-darwin11 -emit-llvm -fobjc-runtime-has-arc -o - %s | FileCheck %s // rdar://8881826 // rdar://9412038 diff --git a/test/CodeGenObjC/bitfield-1.m b/test/CodeGenObjC/bitfield-1.m index 978b3cc30403..648ab2a374db 100644 --- a/test/CodeGenObjC/bitfield-1.m +++ b/test/CodeGenObjC/bitfield-1.m @@ -1,6 +1,6 @@ -// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -emit-llvm -o %t %s -// RUN: %clang_cc1 -triple i386-apple-darwin9 -emit-llvm -o %t %s -// RUN: %clang_cc1 -triple i386-pc-linux-gnu -emit-llvm -o %t %s +// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -fobjc-fragile-abi -emit-llvm -o %t %s +// RUN: %clang_cc1 -triple i386-apple-darwin9 -fobjc-fragile-abi -emit-llvm -o %t %s +// RUN: %clang_cc1 -triple i386-pc-linux-gnu -fobjc-fragile-abi -emit-llvm -o %t %s @interface Object - (id) alloc; diff --git a/test/CodeGenObjC/bitfield-access.m b/test/CodeGenObjC/bitfield-access.m index ab776abd4ea6..521d2e52a6fa 100644 --- a/test/CodeGenObjC/bitfield-access.m +++ b/test/CodeGenObjC/bitfield-access.m @@ -1,7 +1,7 @@ -// RUN: %clang_cc1 -triple i386-apple-darwin10 -emit-llvm -o %t1 %s +// RUN: %clang_cc1 -triple i386-apple-darwin10 -fobjc-fragile-abi -emit-llvm -o %t1 %s // RUN: FileCheck -check-prefix=CHECK-I386 < %t1 %s -// RUN: %clang_cc1 -triple armv6-apple-darwin10 -target-abi apcs-gnu -emit-llvm -o %t2 %s +// RUN: %clang_cc1 -triple armv6-apple-darwin10 -fobjc-fragile-abi -target-abi apcs-gnu -emit-llvm -o %t2 %s // RUN: FileCheck -check-prefix=CHECK-ARM < %t2 %s @interface I0 { diff --git a/test/CodeGenObjC/bitfield-ivar-offsets.m b/test/CodeGenObjC/bitfield-ivar-offsets.m index ce6f17b8a725..b0c848fd7e3c 100644 --- a/test/CodeGenObjC/bitfield-ivar-offsets.m +++ b/test/CodeGenObjC/bitfield-ivar-offsets.m @@ -1,5 +1,5 @@ // RUNX: llvm-gcc -m64 -emit-llvm -S -o %t %s && -// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-nonfragile-abi -emit-llvm -o %t %s +// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -o %t %s // RUN: grep -F '@"OBJC_IVAR_$_I0._b0" = global i64 0, section "__DATA, __objc_ivar", align 8' %t // RUN: grep -F '@"OBJC_IVAR_$_I0._b1" = global i64 0, section "__DATA, __objc_ivar", align 8' %t // RUN: grep -F '@"OBJC_IVAR_$_I0._b2" = global i64 1, section "__DATA, __objc_ivar", align 8' %t diff --git a/test/CodeGenObjC/bitfield_encoding.m b/test/CodeGenObjC/bitfield_encoding.m index 03cf9bfba722..17fd4a4108b7 100644 --- a/test/CodeGenObjC/bitfield_encoding.m +++ b/test/CodeGenObjC/bitfield_encoding.m @@ -1,6 +1,6 @@ -// RUN: %clang_cc1 -triple i386-unknown-unknown -emit-llvm -o %t %s +// RUN: %clang_cc1 -triple i386-unknown-unknown -fobjc-fragile-abi -emit-llvm -o %t %s // RUN: grep "ib1b14" %t | count 1 -// RUN: %clang_cc1 -triple i386-unknown-unknown -fgnu-runtime -emit-llvm -o %t %s +// RUN: %clang_cc1 -triple i386-unknown-unknown -fobjc-fragile-abi -fgnu-runtime -emit-llvm -o %t %s // RUN: grep "ib32i1b33i14" %t | count 1 struct foo{ diff --git a/test/CodeGenObjC/block-6.m b/test/CodeGenObjC/block-6.m index 44c7a78e698e..140fa8831937 100644 --- a/test/CodeGenObjC/block-6.m +++ b/test/CodeGenObjC/block-6.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 %s -emit-llvm -o - -fblocks -triple x86_64-apple-darwin10 | FileCheck %s +// RUN: %clang_cc1 %s -emit-llvm -o - -fblocks -triple x86_64-apple-darwin10 -fobjc-fragile-abi | FileCheck %s // rdar://8893785 void MYFUNC() { diff --git a/test/CodeGenObjC/block-var-layout.m b/test/CodeGenObjC/block-var-layout.m index 466dee1e9e96..1d0ce2d373ad 100644 --- a/test/CodeGenObjC/block-var-layout.m +++ b/test/CodeGenObjC/block-var-layout.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -fblocks -fobjc-gc -triple x86_64-apple-darwin -O0 -emit-llvm %s -o %t-64.s +// RUN: %clang_cc1 -fblocks -fobjc-gc -triple x86_64-apple-darwin -fobjc-fragile-abi -O0 -emit-llvm %s -o %t-64.s // RUN: FileCheck -check-prefix LP64 --input-file=%t-64.s %s struct S { diff --git a/test/CodeGenObjC/blocks-1.m b/test/CodeGenObjC/blocks-1.m index 55ce38fe9ef9..64da3594c271 100644 --- a/test/CodeGenObjC/blocks-1.m +++ b/test/CodeGenObjC/blocks-1.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 %s -emit-llvm -o %t -fobjc-gc -fblocks -triple i386-apple-darwin10 +// RUN: %clang_cc1 %s -emit-llvm -o %t -fobjc-gc -fblocks -triple i386-apple-darwin10 -fobjc-fragile-abi // RUN: grep "_Block_object_dispose" %t | count 6 // RUN: grep "__copy_helper_block_" %t | count 4 // RUN: grep "__destroy_helper_block_" %t | count 4 @@ -8,7 +8,7 @@ // RUN: grep "_Block_object_assign" %t | count 4 // RUN: grep "objc_read_weak" %t | count 2 // RUN: grep "objc_assign_weak" %t | count 3 -// RUN: %clang_cc1 -x objective-c++ %s -emit-llvm -o %t -fobjc-gc -fblocks -triple i386-apple-darwin10 +// RUN: %clang_cc1 -x objective-c++ %s -emit-llvm -o %t -fobjc-gc -fblocks -triple i386-apple-darwin10 -fobjc-fragile-abi // RUN: grep "_Block_object_dispose" %t | count 6 // RUN: grep "__copy_helper_block_" %t | count 4 // RUN: grep "__destroy_helper_block_" %t | count 4 diff --git a/test/CodeGenObjC/blocks-2.m b/test/CodeGenObjC/blocks-2.m index 5d63e919fb31..591d63bf37da 100644 --- a/test/CodeGenObjC/blocks-2.m +++ b/test/CodeGenObjC/blocks-2.m @@ -1,6 +1,6 @@ // We run this twice, once as Objective-C and once as Objective-C++. -// RUN: %clang_cc1 %s -emit-llvm -o - -fobjc-gc -fblocks -fexceptions -triple i386-apple-darwin10 | FileCheck %s -// RUN: %clang_cc1 %s -emit-llvm -o - -fobjc-gc -fblocks -fexceptions -triple i386-apple-darwin10 -x objective-c++ | FileCheck %s +// RUN: %clang_cc1 %s -emit-llvm -o - -fobjc-gc -fblocks -fexceptions -triple i386-apple-darwin10 -fobjc-fragile-abi | FileCheck %s +// RUN: %clang_cc1 %s -emit-llvm -o - -fobjc-gc -fblocks -fexceptions -triple i386-apple-darwin10 -fobjc-fragile-abi -x objective-c++ | FileCheck %s // CHECK: define i8* @{{.*}}test0 @@ -30,8 +30,9 @@ void test1() { // CHECK-NEXT: call void @_Block_object_dispose(i8* [[T1]], i32 8) // CHECK-NEXT: ret void - // CHECK: call i8* @llvm.eh.exception() + // CHECK: landingpad { i8*, i32 } personality + // CHECK-NEXT: cleanup // CHECK: [[T1:%.*]] = bitcast [[N_T]]* [[N]] to i8* // CHECK-NEXT: call void @_Block_object_dispose(i8* [[T1]], i32 8) - // CHECK: call void @llvm.eh.resume( + // CHECK: resume { i8*, i32 } } diff --git a/test/CodeGenObjC/blocks-3.m b/test/CodeGenObjC/blocks-3.m index a0b693dc810b..55e215c7e6ab 100644 --- a/test/CodeGenObjC/blocks-3.m +++ b/test/CodeGenObjC/blocks-3.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -emit-llvm -fblocks -o %t %s +// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -fobjc-fragile-abi -emit-llvm -fblocks -o %t %s // 1x for the declaration // 1x for the object-pointer byref copy helper diff --git a/test/CodeGenObjC/blocks-4.m b/test/CodeGenObjC/blocks-4.m index f2d6e21a1ce1..b3d099811cf0 100644 --- a/test/CodeGenObjC/blocks-4.m +++ b/test/CodeGenObjC/blocks-4.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple i386-apple-darwin9 -emit-llvm -fobjc-exceptions -fblocks -o %t %s +// RUN: %clang_cc1 -triple i386-apple-darwin9 -fobjc-fragile-abi -emit-llvm -fobjc-exceptions -fblocks -o %t %s // rdar://7590273 void EXIT(id e); diff --git a/test/CodeGenObjC/blocks-5.m b/test/CodeGenObjC/blocks-5.m index 2d48b46a4316..caa8d664455e 100644 --- a/test/CodeGenObjC/blocks-5.m +++ b/test/CodeGenObjC/blocks-5.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -emit-llvm -fblocks -o %t %s +// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -fobjc-fragile-abi -emit-llvm -fblocks -o %t %s // rdar: // 8064140 diff --git a/test/CodeGenObjC/blocks.m b/test/CodeGenObjC/blocks.m index 47d47cca2e8c..f478c07f78fb 100644 --- a/test/CodeGenObjC/blocks.m +++ b/test/CodeGenObjC/blocks.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple i386-apple-darwin9 -emit-llvm -fblocks -o - %s | FileCheck %s +// RUN: %clang_cc1 -triple i386-apple-darwin9 -fobjc-fragile-abi -emit-llvm -fblocks -o - %s | FileCheck %s // test1. All of this is somehow testing rdar://6676764 struct S { diff --git a/test/CodeGenObjC/builtins.m b/test/CodeGenObjC/builtins.m new file mode 100644 index 000000000000..cb2995da52a5 --- /dev/null +++ b/test/CodeGenObjC/builtins.m @@ -0,0 +1,7 @@ +// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-fragile-abi -emit-llvm -o - %s | FileCheck %s + +void test0(id receiver, SEL sel, const char *str) { + short s = ((short (*)(id, SEL, const char*)) objc_msgSend)(receiver, sel, str); +} +// CHECK: define void @test0( +// CHECK: call signext i16 bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to i16 (i8*, i8*, i8*)*)( diff --git a/test/CodeGenObjC/category-class.m b/test/CodeGenObjC/category-class.m index 22d197380f32..5a82c1425504 100644 --- a/test/CodeGenObjC/category-class.m +++ b/test/CodeGenObjC/category-class.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple i386-apple-darwin9 -emit-llvm -o - %s | FileCheck %s +// RUN: %clang_cc1 -triple i386-apple-darwin9 -fobjc-fragile-abi -emit-llvm -o - %s | FileCheck %s // PR7431 // CHECK: module asm "\09.lazy_reference .objc_class_name_A" diff --git a/test/CodeGenObjC/class-type.m b/test/CodeGenObjC/class-type.m index 192a80832783..45aae254bd33 100644 --- a/test/CodeGenObjC/class-type.m +++ b/test/CodeGenObjC/class-type.m @@ -1,6 +1,6 @@ -// RUN: %clang_cc1 -triple x86_64-unknown-unknown -emit-llvm -o - %s -// RUN: %clang_cc1 -triple i386-apple-darwin9 -emit-llvm -o - %s -// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -emit-llvm -o - %s +// RUN: %clang_cc1 -triple x86_64-unknown-unknown -fobjc-fragile-abi -emit-llvm -o - %s +// RUN: %clang_cc1 -triple i386-apple-darwin9 -fobjc-fragile-abi -emit-llvm -o - %s +// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -fobjc-fragile-abi -emit-llvm -o - %s @interface I0 { diff --git a/test/CodeGenObjC/complex-property.m b/test/CodeGenObjC/complex-property.m index 5a2b78b5977a..8c3aef9e24bd 100644 --- a/test/CodeGenObjC/complex-property.m +++ b/test/CodeGenObjC/complex-property.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-nonfragile-abi -emit-llvm -o - %s | FileCheck -check-prefix LP64 %s +// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -o - %s | FileCheck -check-prefix LP64 %s // rdar: // 7351147 @interface A diff --git a/test/CodeGenObjC/constant-string-class-1.m b/test/CodeGenObjC/constant-string-class-1.m index 8ff605ec6934..5f1e882d0d2e 100644 --- a/test/CodeGenObjC/constant-string-class-1.m +++ b/test/CodeGenObjC/constant-string-class-1.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-nonfragile-abi -fno-constant-cfstrings -fconstant-string-class OFConstantString -emit-llvm -o %t %s +// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fno-constant-cfstrings -fconstant-string-class OFConstantString -emit-llvm -o %t %s // pr9914 @interface OFConstantString diff --git a/test/CodeGenObjC/constant-string-class.m b/test/CodeGenObjC/constant-string-class.m index 489f511e7813..ea049a51e12b 100644 --- a/test/CodeGenObjC/constant-string-class.m +++ b/test/CodeGenObjC/constant-string-class.m @@ -1,7 +1,7 @@ -// RUN: %clang_cc1 -triple i386-apple-darwin9 -fno-constant-cfstrings -fconstant-string-class Foo -emit-llvm -o %t %s +// RUN: %clang_cc1 -triple i386-apple-darwin9 -fobjc-fragile-abi -fno-constant-cfstrings -fconstant-string-class Foo -emit-llvm -o %t %s // RUN: FileCheck --check-prefix CHECK-FRAGILE < %t %s -// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-nonfragile-abi -fno-constant-cfstrings -fconstant-string-class Foo -emit-llvm -o %t %s +// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fno-constant-cfstrings -fconstant-string-class Foo -emit-llvm -o %t %s // RUN: FileCheck --check-prefix CHECK-NONFRAGILE < %t %s // rdar: // 8564463 diff --git a/test/CodeGenObjC/deadcode_strip_used_var.m b/test/CodeGenObjC/deadcode_strip_used_var.m index 01e6bd4feb33..3137ceb22298 100644 --- a/test/CodeGenObjC/deadcode_strip_used_var.m +++ b/test/CodeGenObjC/deadcode_strip_used_var.m @@ -1,6 +1,6 @@ -// RUN: %clang_cc1 %s -emit-llvm -o %t -triple i386-apple-darwin10 +// RUN: %clang_cc1 %s -emit-llvm -o %t -triple i386-apple-darwin10 -fobjc-fragile-abi // RUN: grep "llvm.used" %t | count 1 -// RUN: %clang_cc1 %s -emit-llvm -o %t -triple x86_64-apple-darwin10 +// RUN: %clang_cc1 %s -emit-llvm -o %t -triple x86_64-apple-darwin10 -fobjc-fragile-abi // RUN: grep "llvm.used" %t | count 1 diff --git a/test/CodeGenObjC/debug-info-block-helper.m b/test/CodeGenObjC/debug-info-block-helper.m index 136af14bff8b..644e458bbd2c 100644 --- a/test/CodeGenObjC/debug-info-block-helper.m +++ b/test/CodeGenObjC/debug-info-block-helper.m @@ -1,5 +1,5 @@ // REQUIRES: x86-64-registered-target -// RUN: %clang_cc1 -masm-verbose -S -fblocks -g -triple x86_64-apple-darwin10 %s -o - | FileCheck %s +// RUN: %clang_cc1 -masm-verbose -S -fblocks -g -triple x86_64-apple-darwin10 -fobjc-fragile-abi %s -o - | FileCheck %s extern void foo(void(^)(void)); // CHECK: .ascii "__destroy_helper_block_" ## DW_AT_name diff --git a/test/CodeGenObjC/debug-info-blocks.m b/test/CodeGenObjC/debug-info-blocks.m index fc8e9629734f..71ae8a610ee8 100644 --- a/test/CodeGenObjC/debug-info-blocks.m +++ b/test/CodeGenObjC/debug-info-blocks.m @@ -1,5 +1,5 @@ // REQUIRES: x86-64-registered-target -// RUN: %clang_cc1 -masm-verbose -S -fblocks -g -triple x86_64-apple-darwin10 -fobjc-nonfragile-abi -fobjc-dispatch-method=mixed %s -o - | FileCheck %s +// RUN: %clang_cc1 -masm-verbose -S -fblocks -g -triple x86_64-apple-darwin10 -fobjc-dispatch-method=mixed %s -o - | FileCheck %s //Radar 9279956 //CHECK: ## DW_OP_deref diff --git a/test/CodeGenObjC/debug-info-class-extension.m b/test/CodeGenObjC/debug-info-class-extension.m index cf0445d539b5..e1573f063377 100644 --- a/test/CodeGenObjC/debug-info-class-extension.m +++ b/test/CodeGenObjC/debug-info-class-extension.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -fobjc-nonfragile-abi -masm-verbose -S -g %s -o - | FileCheck %s +// RUN: %clang_cc1 -masm-verbose -S -g %s -o - | FileCheck %s // CHECK: AT_APPLE_objc_complete_type diff --git a/test/CodeGenObjC/debug-info-class-extension2.m b/test/CodeGenObjC/debug-info-class-extension2.m index 4cef88f1637a..bae12dce4e4d 100644 --- a/test/CodeGenObjC/debug-info-class-extension2.m +++ b/test/CodeGenObjC/debug-info-class-extension2.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -fobjc-nonfragile-abi -masm-verbose -S -g %s -o - | FileCheck %s +// RUN: %clang_cc1 -masm-verbose -S -g %s -o - | FileCheck %s // CHECK: AT_APPLE_objc_complete_type @interface Foo {} @end diff --git a/test/CodeGenObjC/debug-info-class-extension3.m b/test/CodeGenObjC/debug-info-class-extension3.m index 595c7bd2c6bc..f49bef82a24f 100644 --- a/test/CodeGenObjC/debug-info-class-extension3.m +++ b/test/CodeGenObjC/debug-info-class-extension3.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -fobjc-nonfragile-abi -masm-verbose -S -g %s -o - | FileCheck %s +// RUN: %clang_cc1 -masm-verbose -S -g %s -o - | FileCheck %s // CHECK-NOT: AT_APPLE_objc_complete_type diff --git a/test/CodeGenObjC/debug-info-crash-2.m b/test/CodeGenObjC/debug-info-crash-2.m new file mode 100644 index 000000000000..a2acd9dc9170 --- /dev/null +++ b/test/CodeGenObjC/debug-info-crash-2.m @@ -0,0 +1,15 @@ +// RUN: %clang_cc1 -triple x86_64-apple-darwin11 -g -S %s -o - +@class Bar; +@interface Foo +@property (strong, nonatomic) Bar *window; +@end + +@interface Foo__ : Foo +@end +@implementation Foo__ +@end + +@implementation Foo +@synthesize window = _window; +@end + diff --git a/test/CodeGenObjC/debug-info-crash.m b/test/CodeGenObjC/debug-info-crash.m index eb2143faed6c..5504356d2e3a 100644 --- a/test/CodeGenObjC/debug-info-crash.m +++ b/test/CodeGenObjC/debug-info-crash.m @@ -1,5 +1,5 @@ // REQUIRES: x86-registered-target -// RUN: %clang_cc1 -triple i386-apple-darwin10 -fblocks -g -S %s -o - +// RUN: %clang_cc1 -triple i386-apple-darwin10 -fobjc-fragile-abi -fblocks -g -S %s -o - // rdar://7556129 @implementation test diff --git a/test/CodeGenObjC/debug-info-default-synth-ivar.m b/test/CodeGenObjC/debug-info-default-synth-ivar.m index 967a361d6c48..30d751e67d1e 100644 --- a/test/CodeGenObjC/debug-info-default-synth-ivar.m +++ b/test/CodeGenObjC/debug-info-default-synth-ivar.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-nonfragile-abi -fobjc-default-synthesize-properties -emit-llvm -g %s -o %t +// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-default-synthesize-properties -emit-llvm -g %s -o %t // RUN: grep DW_TAG_member %t | count 5 // rdar://8493239 diff --git a/test/CodeGenObjC/debug-info-fnname.m b/test/CodeGenObjC/debug-info-fnname.m deleted file mode 100644 index f336d6b26875..000000000000 --- a/test/CodeGenObjC/debug-info-fnname.m +++ /dev/null @@ -1,15 +0,0 @@ -// RUN: %clang_cc1 -emit-llvm -Os -g %s -o - | FileCheck %s -// Radar 8653152 -@interface A { -} -@end - - -// CHECK: llvm.dbg.lv.-.A.title. -@implementation A --(int) title { - int x = 1; - return x; -} -@end - diff --git a/test/CodeGenObjC/debug-info-getter-name.m b/test/CodeGenObjC/debug-info-getter-name.m index ec784e372bf8..e7d3a9a8749e 100644 --- a/test/CodeGenObjC/debug-info-getter-name.m +++ b/test/CodeGenObjC/debug-info-getter-name.m @@ -1,5 +1,5 @@ // REQUIRES: x86-64-registered-target -// RUN: %clang_cc1 -fno-dwarf2-cfi-asm -triple x86_64-apple-darwin10 -fobjc-nonfragile-abi -S -g %s -o - | FileCheck %s +// RUN: %clang_cc1 -fno-dwarf2-cfi-asm -triple x86_64-apple-darwin10 -fexceptions -fobjc-exceptions -S -g %s -o - | FileCheck %s //CHECK: "-[InstanceVariablesEverywhereButTheInterface someString]": //CHECK: .quad "-[InstanceVariablesEverywhereButTheInterface someString]" diff --git a/test/CodeGenObjC/debug-info-property2.m b/test/CodeGenObjC/debug-info-property2.m new file mode 100644 index 000000000000..4cd76c1ca6dc --- /dev/null +++ b/test/CodeGenObjC/debug-info-property2.m @@ -0,0 +1,14 @@ +// RUN: %clang_cc1 -masm-verbose -S -g %s -o - | FileCheck %s + +// CHECK: AT_APPLE_property_name +@interface C { + int _base; +} +@property int base; +@end + +@implementation C +@synthesize base = _base; +@end + +void foo(C *cptr) {} diff --git a/test/CodeGenObjC/debug-info-static-var.m b/test/CodeGenObjC/debug-info-static-var.m index 94513f227884..1f281d042d10 100644 --- a/test/CodeGenObjC/debug-info-static-var.m +++ b/test/CodeGenObjC/debug-info-static-var.m @@ -1,5 +1,5 @@ // REQUIRES: x86-64-registered-target -// RUN: %clang_cc1 -g -triple x86_64-apple-darwin10 -S -masm-verbose -o - %s | FileCheck %s +// RUN: %clang_cc1 -g -triple x86_64-apple-darwin10 -fobjc-fragile-abi -S -masm-verbose -o - %s | FileCheck %s // Radar 8801045 // Do not emit AT_MIPS_linkage_name for static variable i diff --git a/test/CodeGenObjC/default-property-synthesis.m b/test/CodeGenObjC/default-property-synthesis.m index 72acb768a11a..7d7296b5df78 100644 --- a/test/CodeGenObjC/default-property-synthesis.m +++ b/test/CodeGenObjC/default-property-synthesis.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-nonfragile-abi -emit-llvm -o %t %s +// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -o %t %s // rdar://7923851. // Superclass declares property. Subclass redeclares the same property. diff --git a/test/CodeGenObjC/encode-cstyle-method.m b/test/CodeGenObjC/encode-cstyle-method.m index 187c9bfa9d63..ea630230b541 100644 --- a/test/CodeGenObjC/encode-cstyle-method.m +++ b/test/CodeGenObjC/encode-cstyle-method.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -o - %s | FileCheck -check-prefix LP64 %s +// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-fragile-abi -emit-llvm -o - %s | FileCheck -check-prefix LP64 %s // rdar: // 7445205 @interface Foo diff --git a/test/CodeGenObjC/encode-test-4.m b/test/CodeGenObjC/encode-test-4.m index 117e1733486e..2624bc71fce2 100644 --- a/test/CodeGenObjC/encode-test-4.m +++ b/test/CodeGenObjC/encode-test-4.m @@ -1,5 +1,10 @@ // RUN: %clang_cc1 -emit-llvm -o - %s -O2 | grep "ret i32 1" +typedef long Integer; +typedef enum : Integer { Red, Green, Blue} Color; +typedef enum { Cyan, Magenta, Yellow, Key } PrintColor; int a() { - return @encode(int) == @encode(int); + return @encode(int) == @encode(int) && + @encode(Color) == @encode(long) && + @encode(PrintColor) == @encode(int); } diff --git a/test/CodeGenObjC/encode-test.m b/test/CodeGenObjC/encode-test.m index f30fb26a1e65..02af5daa2265 100644 --- a/test/CodeGenObjC/encode-test.m +++ b/test/CodeGenObjC/encode-test.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple=i686-apple-darwin9 -emit-llvm -o %t %s +// RUN: %clang_cc1 -triple i686-apple-darwin9 -fobjc-fragile-abi -emit-llvm -o %t %s // RUN: FileCheck < %t %s // // CHECK: @"\01L_OBJC_METH_VAR_TYPE_34" = internal global [16 x i8] c"v12@0:4[3[4@]]8\00" diff --git a/test/CodeGenObjC/exceptions-nonfragile.m b/test/CodeGenObjC/exceptions-nonfragile.m index 2557aab25219..1f3892699839 100644 --- a/test/CodeGenObjC/exceptions-nonfragile.m +++ b/test/CodeGenObjC/exceptions-nonfragile.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -fobjc-nonfragile-abi -fexceptions -fobjc-exceptions -o - %s | FileCheck %s +// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -fexceptions -fobjc-exceptions -o - %s | FileCheck %s // rdar://problem/8535238 // CHECK: declare void @objc_exception_rethrow() diff --git a/test/CodeGenObjC/exceptions.m b/test/CodeGenObjC/exceptions.m index d378f848f861..2472869ff58b 100644 --- a/test/CodeGenObjC/exceptions.m +++ b/test/CodeGenObjC/exceptions.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -fexceptions -fobjc-exceptions -O2 -o - %s | FileCheck %s +// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-fragile-abi -emit-llvm -fexceptions -fobjc-exceptions -O2 -o - %s | FileCheck %s // // <rdar://problem/7471679> [irgen] [eh] Exception code built with clang (x86_64) crashes diff --git a/test/CodeGenObjC/forward-class-impl-metadata.m b/test/CodeGenObjC/forward-class-impl-metadata.m index 0ab7a8166453..e9e08589d19f 100644 --- a/test/CodeGenObjC/forward-class-impl-metadata.m +++ b/test/CodeGenObjC/forward-class-impl-metadata.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -fobjc-nonfragile-abi -emit-llvm -o %t %s +// RUN: %clang_cc1 -emit-llvm -o %t %s @interface BASE { @private diff --git a/test/CodeGenObjC/fpret.m b/test/CodeGenObjC/fpret.m index bde0caa8ff3a..bf111e001d04 100644 --- a/test/CodeGenObjC/fpret.m +++ b/test/CodeGenObjC/fpret.m @@ -1,10 +1,10 @@ -// RUN: %clang_cc1 -triple i386-apple-darwin9 -emit-llvm -o - %s | \ +// RUN: %clang_cc1 -triple i386-apple-darwin9 -fobjc-fragile-abi -emit-llvm -o - %s | \ // RUN: FileCheck --check-prefix=CHECK-X86_32 %s // -// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -o - %s | \ +// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-fragile-abi -emit-llvm -o - %s | \ // RUN: FileCheck --check-prefix=CHECK-X86_64 %s // -// RUN: %clang_cc1 -triple armv7-apple-darwin10 -emit-llvm -target-abi apcs-gnu -o - %s | \ +// RUN: %clang_cc1 -triple armv7-apple-darwin10 -fobjc-fragile-abi -emit-llvm -target-abi apcs-gnu -o - %s | \ // RUN: FileCheck --check-prefix=CHECK-ARMV7 %s @interface A diff --git a/test/CodeGenObjC/gc-weak-attribute.m b/test/CodeGenObjC/gc-weak-attribute.m new file mode 100644 index 000000000000..032c7c6beb4f --- /dev/null +++ b/test/CodeGenObjC/gc-weak-attribute.m @@ -0,0 +1,28 @@ +// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-gc -emit-llvm -o - %s | FileCheck %s +// rdar://10073896 + +@interface I +{ + __weak id wObject; +} +@property (readwrite, weak) id representedObject; +@property (readwrite, weak) id wObject; +@property (readwrite, weak) __weak id wRandom; +@property (readwrite, assign) __weak id wAnother; +@end + +@implementation I +@synthesize representedObject; +@synthesize wObject; +@synthesize wRandom; +@synthesize wAnother; +@end +// CHECK: call i8* @objc_read_weak +// CHECK: call i8* @objc_assign_weak +// CHECK: call i8* @objc_read_weak +// CHECK: call i8* @objc_assign_weak +// CHECK: call i8* @objc_read_weak +// CHECK: call i8* @objc_assign_weak +// CHECK: call i8* @objc_read_weak +// CHECK: call i8* @objc_assign_weak + diff --git a/test/CodeGenObjC/gc.m b/test/CodeGenObjC/gc.m index 93554e65b880..b6721813c17e 100644 --- a/test/CodeGenObjC/gc.m +++ b/test/CodeGenObjC/gc.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-gc -fobjc-nonfragile-abi -emit-llvm -o - %s | FileCheck %s +// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-gc -emit-llvm -o - %s | FileCheck %s void test0(void) { extern id test0_helper(void); diff --git a/test/CodeGenObjC/gnu-exceptions.m b/test/CodeGenObjC/gnu-exceptions.m index 7f3ae9df467e..8917bf3120da 100644 --- a/test/CodeGenObjC/gnu-exceptions.m +++ b/test/CodeGenObjC/gnu-exceptions.m @@ -14,9 +14,9 @@ void test0() { // CHECK: call void @log(i32 1) } @catch (C *c) { - // CHECK: call i8* @llvm.eh.exception() - // CHECK: call i32 (i8*, i8*, ...)* @llvm.eh.selector({{.*}} @__gnu_objc_personality_v0 - // CHECK: br i1 + // CHECK: landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gnu_objc_personality_v0 to i8*) + // CHECK-NEXT: catch i8* getelementptr inbounds ([2 x i8]* @0, i64 0, i64 0) + // CHECK: br i1 // CHECK: call void @log(i32 0) diff --git a/test/CodeGenObjC/hidden-visibility.m b/test/CodeGenObjC/hidden-visibility.m index 5e08ef9d55d2..9f5071d5ffaa 100644 --- a/test/CodeGenObjC/hidden-visibility.m +++ b/test/CodeGenObjC/hidden-visibility.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -fvisibility hidden -fobjc-nonfragile-abi -emit-llvm -o - %s | FileCheck %s +// RUN: %clang_cc1 -fvisibility hidden -emit-llvm -o - %s | FileCheck %s // CHECK: @"OBJC_IVAR_$_I.P" = hidden // CHECK: @"OBJC_CLASS_$_I" = hidden // CHECK: @"OBJC_METACLASS_$_I" = hidden diff --git a/test/CodeGenObjC/id-isa-codegen.m b/test/CodeGenObjC/id-isa-codegen.m index e4f5fd9ab571..8cac750773c4 100644 --- a/test/CodeGenObjC/id-isa-codegen.m +++ b/test/CodeGenObjC/id-isa-codegen.m @@ -1,5 +1,5 @@ -// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -o - %s | FileCheck -check-prefix LP64 %s -// RUN: %clang_cc1 -triple i386-apple-darwin9 -emit-llvm -o - %s | FileCheck -check-prefix LP32 %s +// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-fragile-abi -emit-llvm -o - %s | FileCheck -check-prefix LP64 %s +// RUN: %clang_cc1 -triple i386-apple-darwin9 -fobjc-fragile-abi -emit-llvm -o - %s | FileCheck -check-prefix LP32 %s typedef struct objc_class *Class; diff --git a/test/CodeGenObjC/image-info.m b/test/CodeGenObjC/image-info.m index 2777723f736f..22f7229b6950 100644 --- a/test/CodeGenObjC/image-info.m +++ b/test/CodeGenObjC/image-info.m @@ -1,7 +1,7 @@ -// RUN: %clang_cc1 -triple i386-apple-darwin9 -emit-llvm -o %t %s +// RUN: %clang_cc1 -triple i386-apple-darwin9 -fobjc-fragile-abi -emit-llvm -o %t %s // RUN: FileCheck --check-prefix CHECK-FRAGILE < %t %s -// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-nonfragile-abi -emit-llvm -o %t %s +// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -o %t %s // RUN: FileCheck --check-prefix CHECK-NONFRAGILE < %t %s // CHECK-FRAGILE: @"\01L_OBJC_IMAGE_INFO" = internal constant [2 x i32] [i32 0, i32 16], section "__OBJC, __image_info,regular" diff --git a/test/CodeGenObjC/implicit-objc_msgSend.m b/test/CodeGenObjC/implicit-objc_msgSend.m index 322f82e920a0..aff0fe45a009 100644 --- a/test/CodeGenObjC/implicit-objc_msgSend.m +++ b/test/CodeGenObjC/implicit-objc_msgSend.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -emit-llvm -o %t %s +// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -fobjc-fragile-abi -emit-llvm -o %t %s // RUN: grep -F 'declare i8* @objc_msgSend(i8*, i8*, ...)' %t typedef struct objc_selector *SEL; diff --git a/test/CodeGenObjC/instance-method-metadata.m b/test/CodeGenObjC/instance-method-metadata.m index 4e752c0061b9..ec24c287a36d 100644 --- a/test/CodeGenObjC/instance-method-metadata.m +++ b/test/CodeGenObjC/instance-method-metadata.m @@ -1,5 +1,5 @@ // REQUIRES: x86-64-registered-target -// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-nonfragile-abi -S -o %t %s +// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -S -o %t %s // RUN: FileCheck < %t %s // rdar://9072317 diff --git a/test/CodeGenObjC/interface-layout-64.m b/test/CodeGenObjC/interface-layout-64.m index 5158c61c5bdb..4fdda4559d14 100644 --- a/test/CodeGenObjC/interface-layout-64.m +++ b/test/CodeGenObjC/interface-layout-64.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-nonfragile-abi -emit-llvm -o %t %s +// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -o %t %s // RUNX: llvm-gcc -m64 -emit-llvm -S -o %t %s && // RUN: grep '@"OBJC_IVAR_$_I3._iv2" = global i64 8, section "__DATA, __objc_ivar", align 8' %t diff --git a/test/CodeGenObjC/interface.m b/test/CodeGenObjC/interface.m index 17d56f7b1db4..0ca64ecd3ffc 100644 --- a/test/CodeGenObjC/interface.m +++ b/test/CodeGenObjC/interface.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple i386-apple-darwin9 -O3 -emit-llvm -o %t %s +// RUN: %clang_cc1 -triple i386-apple-darwin9 -fobjc-fragile-abi -O3 -emit-llvm -o %t %s // RUN: grep 'ret i32 385' %t void *alloca(); diff --git a/test/CodeGenObjC/ivar-layout-64-bitfields.m b/test/CodeGenObjC/ivar-layout-64-bitfields.m index 700ce18d74cb..acc734a575de 100644 --- a/test/CodeGenObjC/ivar-layout-64-bitfields.m +++ b/test/CodeGenObjC/ivar-layout-64-bitfields.m @@ -1,5 +1,5 @@ -// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -fobjc-gc -emit-llvm -o %t %s -// RUN: %clang_cc1 -x objective-c++ -triple x86_64-apple-darwin9 -fobjc-gc -emit-llvm -o %t %s +// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -fobjc-fragile-abi -fobjc-gc -emit-llvm -o %t %s +// RUN: %clang_cc1 -x objective-c++ -triple x86_64-apple-darwin9 -fobjc-fragile-abi -fobjc-gc -emit-llvm -o %t %s #ifdef __cplusplus typedef bool _Bool; diff --git a/test/CodeGenObjC/ivar-layout-64.m b/test/CodeGenObjC/ivar-layout-64.m index f227bfc30d36..ea4cdce4b8b2 100644 --- a/test/CodeGenObjC/ivar-layout-64.m +++ b/test/CodeGenObjC/ivar-layout-64.m @@ -1,11 +1,11 @@ // RUNX: llvm-gcc -m64 -fobjc-gc -emit-llvm -S -o %t %s && -// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-nonfragile-abi -fobjc-gc -emit-llvm -o %t %s +// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-gc -emit-llvm -o %t %s // RUN: grep '@"\\01L_OBJC_CLASS_NAME_.*" = internal global .* c"A\\00"' %t // RUN: grep '@"\\01L_OBJC_CLASS_NAME_.*" = internal global .* c"\\11q\\10\\00"' %t // RUN: grep '@"\\01L_OBJC_CLASS_NAME_.*" = internal global .* c"!q\\00"' %t // RUN: grep '@"\\01L_OBJC_CLASS_NAME_.*" = internal global .* c"\\01\\14\\00"' %t // RUNX: llvm-gcc -ObjC++ -m64 -fobjc-gc -emit-llvm -S -o %t %s && -// RUN: %clang_cc1 -x objective-c++ -triple x86_64-apple-darwin10 -fobjc-nonfragile-abi -fobjc-gc -emit-llvm -o %t %s +// RUN: %clang_cc1 -x objective-c++ -triple x86_64-apple-darwin10 -fobjc-gc -emit-llvm -o %t %s // RUN: grep '@"\\01L_OBJC_CLASS_NAME_.*" = internal global .* c"A\\00"' %t // RUN: grep '@"\\01L_OBJC_CLASS_NAME_.*" = internal global .* c"\\11q\\10\\00"' %t // RUN: grep '@"\\01L_OBJC_CLASS_NAME_.*" = internal global .* c"!q\\00"' %t diff --git a/test/CodeGenObjC/ivar-layout-array0-struct.m b/test/CodeGenObjC/ivar-layout-array0-struct.m index a9ae0ac73389..7ef32f634237 100644 --- a/test/CodeGenObjC/ivar-layout-array0-struct.m +++ b/test/CodeGenObjC/ivar-layout-array0-struct.m @@ -1,5 +1,5 @@ // REQUIRES: x86-64-registered-target -// RUN: %clang_cc1 -fobjc-gc -triple x86_64-apple-darwin -O0 -S %s -o %t-64.s +// RUN: %clang_cc1 -fobjc-gc -triple x86_64-apple-darwin -fobjc-fragile-abi -O0 -S %s -o %t-64.s // RUN: FileCheck -check-prefix LP64 --input-file=%t-64.s %s // rdar://8800513 diff --git a/test/CodeGenObjC/ivar-layout-no-optimize.m b/test/CodeGenObjC/ivar-layout-no-optimize.m index 2851e7942798..85bba8abaaa9 100644 --- a/test/CodeGenObjC/ivar-layout-no-optimize.m +++ b/test/CodeGenObjC/ivar-layout-no-optimize.m @@ -1,7 +1,7 @@ // REQUIRES: x86-64-registered-target -// RUN: %clang_cc1 -fobjc-gc -triple x86_64-apple-darwin -O0 -S %s -o %t-64.s +// RUN: %clang_cc1 -fobjc-gc -triple x86_64-apple-darwin -fobjc-fragile-abi -O0 -S %s -o %t-64.s // RUN: FileCheck -check-prefix LP64 --input-file=%t-64.s %s -// RUN: %clang_cc1 -x objective-c++ -fobjc-gc -triple x86_64-apple-darwin -O0 -S %s -o %t-64.s +// RUN: %clang_cc1 -x objective-c++ -fobjc-gc -triple x86_64-apple-darwin -fobjc-fragile-abi -O0 -S %s -o %t-64.s // RUN: FileCheck -check-prefix LP64 --input-file=%t-64.s %s @interface NSObject { diff --git a/test/CodeGenObjC/ivar-layout-nonfragile-abi2.m b/test/CodeGenObjC/ivar-layout-nonfragile-abi2.m index 012ccadd9f92..65e17a84f163 100644 --- a/test/CodeGenObjC/ivar-layout-nonfragile-abi2.m +++ b/test/CodeGenObjC/ivar-layout-nonfragile-abi2.m @@ -1,5 +1,5 @@ -// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-nonfragile-abi -emit-llvm -o %t %s -// RUN: %clang_cc1 -x objective-c++ -triple x86_64-apple-darwin10 -fobjc-nonfragile-abi -emit-llvm -o %t %s +// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -o %t %s +// RUN: %clang_cc1 -x objective-c++ -triple x86_64-apple-darwin10 -emit-llvm -o %t %s // rdar: // 7824380 @interface Super { diff --git a/test/CodeGenObjC/ivars.m b/test/CodeGenObjC/ivars.m index 98c39b7a844b..6c8a72d0f100 100644 --- a/test/CodeGenObjC/ivars.m +++ b/test/CodeGenObjC/ivars.m @@ -1,5 +1,5 @@ -// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -emit-llvm -o - %s -// RUN: %clang_cc1 -triple i386-apple-darwin9 -emit-llvm -o - %s +// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -fobjc-fragile-abi -emit-llvm -o - %s +// RUN: %clang_cc1 -triple i386-apple-darwin9 -fobjc-fragile-abi -emit-llvm -o - %s // RUN: %clang_cc1 -fobjc-gc -emit-llvm -o - %s // rdar://6800926 diff --git a/test/CodeGenObjC/link-errors.m b/test/CodeGenObjC/link-errors.m index a82f0ceaf76d..0d19681ec109 100644 --- a/test/CodeGenObjC/link-errors.m +++ b/test/CodeGenObjC/link-errors.m @@ -1,8 +1,8 @@ -// RUN: %clang_cc1 -triple i386-apple-darwin9 -emit-llvm -o %t %s +// RUN: %clang_cc1 -triple i386-apple-darwin9 -fobjc-fragile-abi -emit-llvm -o %t %s // RUN: grep '.lazy_reference .objc_class_name_A' %t | count 1 // RUN: grep '.lazy_reference .objc_class_name_Unknown' %t | count 1 // RUN: grep '.lazy_reference .objc_class_name_Protocol' %t | count 1 -// RUN: %clang_cc1 -triple i386-apple-darwin9 -DWITH_IMPL -emit-llvm -o %t %s +// RUN: %clang_cc1 -triple i386-apple-darwin9 -fobjc-fragile-abi -DWITH_IMPL -emit-llvm -o %t %s // RUN: grep '.lazy_reference .objc_class_name_Root' %t | count 1 @interface Root diff --git a/test/CodeGenObjC/local-static-block.m b/test/CodeGenObjC/local-static-block.m index a40abb26ea79..7a7b6f6e087b 100644 --- a/test/CodeGenObjC/local-static-block.m +++ b/test/CodeGenObjC/local-static-block.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -fblocks -triple x86_64-apple-darwin -emit-llvm %s -o %t-64.ll +// RUN: %clang_cc1 -fblocks -triple x86_64-apple-darwin -fobjc-fragile-abi -emit-llvm %s -o %t-64.ll // RUN: FileCheck -check-prefix LP64 --input-file=%t-64.ll %s // rdar: // 8390455 diff --git a/test/CodeGenObjC/messages-2.m b/test/CodeGenObjC/messages-2.m index e4e8cfb5e202..7c9d81cc9d71 100644 --- a/test/CodeGenObjC/messages-2.m +++ b/test/CodeGenObjC/messages-2.m @@ -1,5 +1,5 @@ -// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -o - %s | FileCheck %s -check-prefix=CHECK -// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-nonfragile-abi -emit-llvm -o - %s | FileCheck %s -check-prefix=CHECK-NF +// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-fragile-abi -emit-llvm -o - %s | FileCheck %s -check-prefix=CHECK +// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -o - %s | FileCheck %s -check-prefix=CHECK-NF // Most of this test is apparently just verifying that we don't crash. diff --git a/test/CodeGenObjC/messages.m b/test/CodeGenObjC/messages.m index a921dc774ad1..6f39602d9c96 100644 --- a/test/CodeGenObjC/messages.m +++ b/test/CodeGenObjC/messages.m @@ -1,7 +1,7 @@ -// RUN: %clang_cc1 -emit-llvm -o - %s | FileCheck %s -check-prefix=CHECK-MAC -// RUN: %clang_cc1 -emit-llvm -fobjc-nonfragile-abi -o - %s | FileCheck %s -check-prefix=CHECK-MAC-NF -// RUN: %clang_cc1 -fgnu-runtime -emit-llvm -o - %s | FileCheck %s -check-prefix=CHECK-GNU -// RUN: %clang_cc1 -fgnu-runtime -fobjc-nonfragile-abi -emit-llvm -o - %s | FileCheck %s -check-prefix CHECK-GNU-NF +// RUN: %clang_cc1 -fobjc-fragile-abi -emit-llvm -o - %s | FileCheck %s -check-prefix=CHECK-MAC +// RUN: %clang_cc1 -emit-llvm -o - %s | FileCheck %s -check-prefix=CHECK-MAC-NF +// RUN: %clang_cc1 -fobjc-fragile-abi -fgnu-runtime -emit-llvm -o - %s | FileCheck %s -check-prefix=CHECK-GNU +// RUN: %clang_cc1 -fgnu-runtime -emit-llvm -o - %s | FileCheck %s -check-prefix CHECK-GNU-NF typedef struct { int x; diff --git a/test/CodeGenObjC/metadata-symbols-32.m b/test/CodeGenObjC/metadata-symbols-32.m index 34cc83da315a..a7bcf01926b2 100644 --- a/test/CodeGenObjC/metadata-symbols-32.m +++ b/test/CodeGenObjC/metadata-symbols-32.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple i386-apple-darwin9 -emit-llvm -o %t %s +// RUN: %clang_cc1 -triple i386-apple-darwin9 -fobjc-fragile-abi -emit-llvm -o %t %s // RUNX: llvm-gcc -m32 -emit-llvm -S -o %t %s && // RUN: grep '@"\\01L_OBJC_CATEGORY_A_Cat" = internal global .*section "__OBJC,__category,regular,no_dead_strip", align 4' %t diff --git a/test/CodeGenObjC/metadata-symbols-64.m b/test/CodeGenObjC/metadata-symbols-64.m index 4bc41fa443da..57f5d508ab1c 100644 --- a/test/CodeGenObjC/metadata-symbols-64.m +++ b/test/CodeGenObjC/metadata-symbols-64.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-nonfragile-abi -fobjc-dispatch-method=mixed -emit-llvm -o %t %s +// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-dispatch-method=mixed -emit-llvm -o %t %s // RUNX: llvm-gcc -m64 -emit-llvm -S -o %t %s && // RUN: grep '@"OBJC_CLASS_$_A" = global' %t diff --git a/test/CodeGenObjC/metadata_symbols.m b/test/CodeGenObjC/metadata_symbols.m index 370ca6eccbe9..576a55b13693 100644 --- a/test/CodeGenObjC/metadata_symbols.m +++ b/test/CodeGenObjC/metadata_symbols.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-nonfragile-abi -emit-llvm -fexceptions -fobjc-exceptions -o %t %s +// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -fexceptions -fobjc-exceptions -o %t %s // RUN: FileCheck -check-prefix=CHECK-X86_64 < %t %s // RUN: grep '@"OBJC_EHTYPE_$_EH3"' %t | count 3 @@ -12,7 +12,7 @@ // CHECK-X86_64: define internal void @"\01-[A im0]" // CHECK-X86_64: define internal void @"\01-[A(Cat) im1]" -// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-nonfragile-abi -fobjc-exceptions -fvisibility hidden -emit-llvm -o %t %s +// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-exceptions -fvisibility hidden -emit-llvm -o %t %s // RUN: FileCheck -check-prefix=CHECK-X86_64-HIDDEN < %t %s // CHECK-X86_64-HIDDEN: @"OBJC_CLASS_$_A" = hidden global {{.*}}, section "__DATA, __objc_data", align 8 @@ -23,7 +23,7 @@ // CHECK-X86_64-HIDDEN: define internal void @"\01-[A im0]" // CHECK-X86_64-HIDDEN: define internal void @"\01-[A(Cat) im1]" -// RUN: %clang_cc1 -triple armv6-apple-darwin10 -target-abi apcs-gnu -fobjc-nonfragile-abi -fobjc-exceptions -emit-llvm -o %t %s +// RUN: %clang_cc1 -triple armv6-apple-darwin10 -target-abi apcs-gnu -fobjc-exceptions -emit-llvm -o %t %s // RUN: FileCheck -check-prefix=CHECK-ARMV6 < %t %s // CHECK-ARMV6: @"OBJC_CLASS_$_A" = global {{.*}}, section "__DATA, __objc_data", align 4 diff --git a/test/CodeGenObjC/misc-atomic-property.m b/test/CodeGenObjC/misc-atomic-property.m index 26402d355b59..f2645dcaef84 100644 --- a/test/CodeGenObjC/misc-atomic-property.m +++ b/test/CodeGenObjC/misc-atomic-property.m @@ -1,5 +1,5 @@ -// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-nonfragile-abi -emit-llvm -o - %s | FileCheck %s -// RUN: %clang_cc1 -triple i386-apple-darwin9 -emit-llvm -o - %s | FileCheck %s +// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -o - %s | FileCheck %s +// RUN: %clang_cc1 -triple i386-apple-darwin9 -fobjc-fragile-abi -emit-llvm -o - %s | FileCheck %s // rdar: //8808439 typedef struct { diff --git a/test/CodeGenObjC/mrr-autorelease.m b/test/CodeGenObjC/mrr-autorelease.m index 10f549fcec5e..f7a13fd8dcf2 100644 --- a/test/CodeGenObjC/mrr-autorelease.m +++ b/test/CodeGenObjC/mrr-autorelease.m @@ -1,5 +1,5 @@ -// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -fobjc-nonfragile-abi -o - %s | FileCheck %s -// RUN: %clang_cc1 -triple i386-apple-darwin10 -emit-llvm -o - %s | FileCheck %s +// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -o - %s | FileCheck %s +// RUN: %clang_cc1 -triple i386-apple-darwin10 -fobjc-fragile-abi -emit-llvm -o - %s | FileCheck %s // rdar://8881826 // rdar://9423507 diff --git a/test/CodeGenObjC/nested-rethrow.m b/test/CodeGenObjC/nested-rethrow.m index af5154a24c27..5576c1640d18 100644 --- a/test/CodeGenObjC/nested-rethrow.m +++ b/test/CodeGenObjC/nested-rethrow.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple i386-apple-darwin9 -emit-llvm -fobjc-exceptions %s -o - | FileCheck %s +// RUN: %clang_cc1 -triple i386-apple-darwin9 -fobjc-fragile-abi -emit-llvm -fobjc-exceptions %s -o - | FileCheck %s extern int printf(const char*, ...); diff --git a/test/CodeGenObjC/next-objc-dispatch.m b/test/CodeGenObjC/next-objc-dispatch.m index a3e8e19641eb..4288b2da0cb2 100644 --- a/test/CodeGenObjC/next-objc-dispatch.m +++ b/test/CodeGenObjC/next-objc-dispatch.m @@ -1,17 +1,17 @@ -// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -emit-llvm -o - %s \ +// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -fobjc-fragile-abi -emit-llvm -o - %s \ // RUN: -fobjc-dispatch-method=legacy | \ // RUN: FileCheck -check-prefix CHECK-FRAGILE_LEGACY %s // // RUN: %clang_cc1 -triple x86_64-apple-darwin9 -emit-llvm -o - %s \ -// RUN: -fobjc-nonfragile-abi -fobjc-dispatch-method=legacy | \ +// RUN: -fobjc-dispatch-method=legacy | \ // RUN: FileCheck -check-prefix CHECK-NONFRAGILE_LEGACY %s // // RUN: %clang_cc1 -triple x86_64-apple-darwin9 -emit-llvm -o - %s \ -// RUN: -fobjc-nonfragile-abi -fobjc-dispatch-method=non-legacy | \ +// RUN: -fobjc-dispatch-method=non-legacy | \ // RUN: FileCheck -check-prefix CHECK-NONFRAGILE_NONLEGACY %s // // RUN: %clang_cc1 -triple x86_64-apple-darwin9 -emit-llvm -o - %s \ -// RUN: -fobjc-nonfragile-abi -fobjc-dispatch-method=mixed | \ +// RUN: -fobjc-dispatch-method=mixed | \ // RUN: FileCheck -check-prefix CHECK-NONFRAGILE_MIXED %s // // <rdar://problem/7866951> diff --git a/test/CodeGenObjC/no-category-class.m b/test/CodeGenObjC/no-category-class.m index 0bd999689dd1..3969f917e2f3 100644 --- a/test/CodeGenObjC/no-category-class.m +++ b/test/CodeGenObjC/no-category-class.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple x86_64-unknown-unknown -emit-llvm -o %t %s +// RUN: %clang_cc1 -triple x86_64-unknown-unknown -fobjc-fragile-abi -emit-llvm -o %t %s @interface NSObject @end diff --git a/test/CodeGenObjC/no-vararg-messaging.m b/test/CodeGenObjC/no-vararg-messaging.m index 6747c0c9e4ef..3f9d934ec88f 100644 --- a/test/CodeGenObjC/no-vararg-messaging.m +++ b/test/CodeGenObjC/no-vararg-messaging.m @@ -1,5 +1,5 @@ // REQUIRES: x86-64-registered-target -// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-nonfragile-abi -S -o - %s | FileCheck %s +// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -S -o - %s | FileCheck %s // rdar://9048030 @interface Foo diff --git a/test/CodeGenObjC/non-lazy-classes.m b/test/CodeGenObjC/non-lazy-classes.m index 512ad897c7fe..5d8290155e32 100644 --- a/test/CodeGenObjC/non-lazy-classes.m +++ b/test/CodeGenObjC/non-lazy-classes.m @@ -1,5 +1,5 @@ // RUNX: llvm-gcc -m64 -emit-llvm -S -o %t %s && -// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-nonfragile-abi -emit-llvm -o %t %s +// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -o %t %s // RUN: grep '@".01L_OBJC_LABEL_NONLAZY_CLASS_$" = internal global \[1 x .*\] .*@"OBJC_CLASS_$_A".*, section "__DATA, __objc_nlclslist, regular, no_dead_strip", align 8' %t // RUN: grep '@".01L_OBJC_LABEL_NONLAZY_CATEGORY_$" = internal global \[1 x .*\] .*@".01l_OBJC_$_CATEGORY_A_$_Cat".*, section "__DATA, __objc_nlcatlist, regular, no_dead_strip", align 8' %t diff --git a/test/CodeGenObjC/nonlazy-msgSend.m b/test/CodeGenObjC/nonlazy-msgSend.m index 3d7ba10dc5e8..73157c77c030 100644 --- a/test/CodeGenObjC/nonlazy-msgSend.m +++ b/test/CodeGenObjC/nonlazy-msgSend.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -emit-llvm -o %t %s +// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -fobjc-fragile-abi -emit-llvm -o %t %s // RUN: grep -F 'declare i8* @objc_msgSend(i8*, i8*, ...) nonlazybind' %t void f0(id x) { diff --git a/test/CodeGenObjC/ns-constant-strings.m b/test/CodeGenObjC/ns-constant-strings.m index 389132bd05ee..d04793c8c239 100644 --- a/test/CodeGenObjC/ns-constant-strings.m +++ b/test/CodeGenObjC/ns-constant-strings.m @@ -1,7 +1,7 @@ -// RUN: %clang_cc1 -triple i386-apple-darwin9 -fno-constant-cfstrings -emit-llvm -o %t %s +// RUN: %clang_cc1 -triple i386-apple-darwin9 -fobjc-fragile-abi -fno-constant-cfstrings -emit-llvm -o %t %s // RUN: FileCheck --check-prefix CHECK-FRAGILE < %t %s -// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-nonfragile-abi -fno-constant-cfstrings -emit-llvm -o %t %s +// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fno-constant-cfstrings -emit-llvm -o %t %s // RUN: FileCheck --check-prefix CHECK-NONFRAGILE < %t %s @interface NSString @end diff --git a/test/CodeGenObjC/objc-align.m b/test/CodeGenObjC/objc-align.m index ff3f2a0a9088..f07272516f1c 100644 --- a/test/CodeGenObjC/objc-align.m +++ b/test/CodeGenObjC/objc-align.m @@ -1,7 +1,7 @@ // 32-bit // RUNX: llvm-gcc -m32 -emit-llvm -S -o %t %s && -// RUN: %clang_cc1 -triple i386-apple-darwin9 -emit-llvm -o %t %s +// RUN: %clang_cc1 -triple i386-apple-darwin9 -fobjc-fragile-abi -emit-llvm -o %t %s // RUN: grep '@"\\01L_OBJC_CATEGORY_A_Cat" = internal global .*, section "__OBJC,__category,regular,no_dead_strip", align 4' %t // RUN: grep '@"\\01L_OBJC_CLASS_A" = internal global .*, section "__OBJC,__class,regular,no_dead_strip", align 4' %t // RUN: grep '@"\\01L_OBJC_CLASS_C" = internal global .*, section "__OBJC,__class,regular,no_dead_strip", align 4' %t diff --git a/test/CodeGenObjC/objc-assign-ivar.m b/test/CodeGenObjC/objc-assign-ivar.m index aefe97d0f2a7..d0a1a0fceefe 100644 --- a/test/CodeGenObjC/objc-assign-ivar.m +++ b/test/CodeGenObjC/objc-assign-ivar.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-gc -emit-llvm -o %t %s +// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-fragile-abi -fobjc-gc -emit-llvm -o %t %s // RUN: grep -F '@objc_assign_ivar' %t | count 14 typedef struct { diff --git a/test/CodeGenObjC/objc-gc-aggr-assign.m b/test/CodeGenObjC/objc-gc-aggr-assign.m index 9fd64d5645c8..dfdf02e2a5a6 100644 --- a/test/CodeGenObjC/objc-gc-aggr-assign.m +++ b/test/CodeGenObjC/objc-gc-aggr-assign.m @@ -1,5 +1,5 @@ -// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-gc -emit-llvm -o - %s | FileCheck -check-prefix C %s -// RUN: %clang_cc1 -x objective-c++ -triple x86_64-apple-darwin10 -fobjc-gc -emit-llvm -o - %s | FileCheck -check-prefix CP %s +// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-fragile-abi -fobjc-gc -emit-llvm -o - %s | FileCheck -check-prefix C %s +// RUN: %clang_cc1 -x objective-c++ -triple x86_64-apple-darwin10 -fobjc-fragile-abi -fobjc-gc -emit-llvm -o - %s | FileCheck -check-prefix CP %s static int count; diff --git a/test/CodeGenObjC/objc-read-weak-byref.m b/test/CodeGenObjC/objc-read-weak-byref.m index c89fcd520e5e..8fe1436567b1 100644 --- a/test/CodeGenObjC/objc-read-weak-byref.m +++ b/test/CodeGenObjC/objc-read-weak-byref.m @@ -1,7 +1,7 @@ // REQUIRES: x86-registered-target,x86-64-registered-target -// RUN: %clang_cc1 -fblocks -fobjc-gc -triple x86_64-apple-darwin -S %s -o %t-64.s +// RUN: %clang_cc1 -fblocks -fobjc-gc -triple x86_64-apple-darwin -fobjc-fragile-abi -S %s -o %t-64.s // RUN: FileCheck -check-prefix LP64 --input-file=%t-64.s %s -// RUN: %clang_cc1 -fblocks -fobjc-gc -triple i386-apple-darwin -S %s -o %t-32.s +// RUN: %clang_cc1 -fblocks -fobjc-gc -triple i386-apple-darwin -fobjc-fragile-abi -S %s -o %t-32.s // RUN: FileCheck -check-prefix LP32 --input-file=%t-32.s %s @interface NSObject diff --git a/test/CodeGenObjC/objc2-assign-global.m b/test/CodeGenObjC/objc2-assign-global.m index ff3ecef72d8d..36c95f792dae 100644 --- a/test/CodeGenObjC/objc2-assign-global.m +++ b/test/CodeGenObjC/objc2-assign-global.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-gc -emit-llvm -o %t %s +// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-fragile-abi -fobjc-gc -emit-llvm -o %t %s // RUN: grep -F '@objc_assign_global' %t | count 26 @class NSObject; diff --git a/test/CodeGenObjC/objc2-ivar-assign.m b/test/CodeGenObjC/objc2-ivar-assign.m index e50cc5b53729..af768007212b 100644 --- a/test/CodeGenObjC/objc2-ivar-assign.m +++ b/test/CodeGenObjC/objc2-ivar-assign.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -fobjc-nonfragile-abi -fobjc-gc -emit-llvm -o %t %s +// RUN: %clang_cc1 -fobjc-gc -emit-llvm -o %t %s // RUN: grep objc_assign_ivar %t | count 6 @interface I @end diff --git a/test/CodeGenObjC/objc2-legacy-dispatch.m b/test/CodeGenObjC/objc2-legacy-dispatch.m index 7a99d15ba0dc..a6b20000d802 100644 --- a/test/CodeGenObjC/objc2-legacy-dispatch.m +++ b/test/CodeGenObjC/objc2-legacy-dispatch.m @@ -1,11 +1,11 @@ -// RUN: %clang_cc1 -fobjc-nonfragile-abi -fobjc-dispatch-method=mixed -triple i386-apple-darwin10 -emit-llvm -o - %s | FileCheck -check-prefix=CHECK_NEW_DISPATCH %s +// RUN: %clang_cc1 -fobjc-dispatch-method=mixed -triple i386-apple-darwin10 -emit-llvm -o - %s | FileCheck -check-prefix=CHECK_NEW_DISPATCH %s // // CHECK_NEW_DISPATCH: define void @f0 // CHECK_NEW_DISPATCH: bitcast {{.*}}objc_msgSend_fixup_alloc // CHECK_NEW_DISPATCH: define void @f1 // CHECK_NEW_DISPATCH: load {{.*}}OBJC_SELECTOR_REFERENCES // -// RUN: %clang_cc1 -fobjc-nonfragile-abi -fobjc-dispatch-method=legacy -emit-llvm -o - %s | FileCheck -check-prefix=CHECK_OLD_DISPATCH %s +// RUN: %clang_cc1 -fobjc-dispatch-method=legacy -emit-llvm -o - %s | FileCheck -check-prefix=CHECK_OLD_DISPATCH %s // // CHECK_OLD_DISPATCH: define void @f0 // CHECK_OLD_DISPATCH: load {{.*}}OBJC_SELECTOR_REFERENCES diff --git a/test/CodeGenObjC/objc2-new-gc-api-strongcast.m b/test/CodeGenObjC/objc2-new-gc-api-strongcast.m index 0413910855e5..1044ba529857 100644 --- a/test/CodeGenObjC/objc2-new-gc-api-strongcast.m +++ b/test/CodeGenObjC/objc2-new-gc-api-strongcast.m @@ -1,6 +1,6 @@ -// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fblocks -fobjc-gc -emit-llvm -o %t %s +// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-fragile-abi -fblocks -fobjc-gc -emit-llvm -o %t %s // RUN: grep -F '@objc_assign_strongCast' %t | count 4 -// RUN: %clang_cc1 -x objective-c++ -triple x86_64-apple-darwin10 -fblocks -fobjc-gc -emit-llvm -o %t %s +// RUN: %clang_cc1 -x objective-c++ -triple x86_64-apple-darwin10 -fobjc-fragile-abi -fblocks -fobjc-gc -emit-llvm -o %t %s // RUN: grep -F '@objc_assign_strongCast' %t | count 4 @interface DSATextSearch @end diff --git a/test/CodeGenObjC/objc2-no-write-barrier.m b/test/CodeGenObjC/objc2-no-write-barrier.m index a0ebc100fb2f..d439368cc608 100644 --- a/test/CodeGenObjC/objc2-no-write-barrier.m +++ b/test/CodeGenObjC/objc2-no-write-barrier.m @@ -1,6 +1,6 @@ -// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -fobjc-gc -emit-llvm -o %t %s +// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -fobjc-fragile-abi -fobjc-gc -emit-llvm -o %t %s // RUN: grep 'objc_assign' %t | count 0 -// RUN: %clang_cc1 -x objective-c++ -triple x86_64-apple-darwin9 -fobjc-gc -emit-llvm -o %t %s +// RUN: %clang_cc1 -x objective-c++ -triple x86_64-apple-darwin9 -fobjc-fragile-abi -fobjc-gc -emit-llvm -o %t %s // RUN: grep 'objc_assign' %t | count 0 typedef struct { diff --git a/test/CodeGenObjC/objc2-nonfragile-abi-impl.m b/test/CodeGenObjC/objc2-nonfragile-abi-impl.m index cb830b8dcc92..c785a5d47642 100644 --- a/test/CodeGenObjC/objc2-nonfragile-abi-impl.m +++ b/test/CodeGenObjC/objc2-nonfragile-abi-impl.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-nonfragile-abi -emit-llvm -o %t %s +// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -o %t %s // rdar://7547942. @interface Base @end diff --git a/test/CodeGenObjC/objc2-retain-codegen.m b/test/CodeGenObjC/objc2-retain-codegen.m index 9f6620619ecd..d5b473e33473 100644 --- a/test/CodeGenObjC/objc2-retain-codegen.m +++ b/test/CodeGenObjC/objc2-retain-codegen.m @@ -1,5 +1,5 @@ -// RUN: %clang_cc1 -triple x86_64-unknown-unknown -fobjc-gc-only -emit-llvm -o %t %s -// RUN: %clang_cc1 -x objective-c++ -triple x86_64-unknown-unknown -fobjc-gc-only -emit-llvm -o %t %s +// RUN: %clang_cc1 -triple x86_64-unknown-unknown -fobjc-fragile-abi -fobjc-gc-only -emit-llvm -o %t %s +// RUN: %clang_cc1 -x objective-c++ -triple x86_64-unknown-unknown -fobjc-fragile-abi -fobjc-gc-only -emit-llvm -o %t %s @interface I0 { I0 *_f0; diff --git a/test/CodeGenObjC/objc2-strong-cast-1.m b/test/CodeGenObjC/objc2-strong-cast-1.m index b79f8a00f7a3..9bb750fd0523 100644 --- a/test/CodeGenObjC/objc2-strong-cast-1.m +++ b/test/CodeGenObjC/objc2-strong-cast-1.m @@ -1,5 +1,5 @@ -// RUN: %clang_cc1 -triple x86_64-unknown-unknown -fobjc-gc -emit-llvm -o %t %s -// RUN: %clang_cc1 -x objective-c++ -triple x86_64-unknown-unknown -fobjc-gc -emit-llvm -o %t %s +// RUN: %clang_cc1 -triple x86_64-unknown-unknown -fobjc-fragile-abi -fobjc-gc -emit-llvm -o %t %s +// RUN: %clang_cc1 -x objective-c++ -triple x86_64-unknown-unknown -fobjc-fragile-abi -fobjc-gc -emit-llvm -o %t %s @interface I { __attribute__((objc_gc(strong))) int *i_IdocumentIDs; diff --git a/test/CodeGenObjC/objc2-strong-cast-block-import.m b/test/CodeGenObjC/objc2-strong-cast-block-import.m new file mode 100644 index 000000000000..adec3762012b --- /dev/null +++ b/test/CodeGenObjC/objc2-strong-cast-block-import.m @@ -0,0 +1,25 @@ +// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-gc-only -fblocks -emit-llvm -o - %s | FileCheck %s +// rdar://10150823 + +@interface Test { +@package + Test ** __strong objects; +} +@end + +id newObject(); +void runWithBlock(void(^)(int i)); + +@implementation Test + +- (void)testWithObjectInBlock { + Test **children = objects; + runWithBlock(^(int i){ + children[i] = newObject(); + }); +} + +@end +// CHECK: call i8* @objc_assign_strongCast +// CHECK: call i8* @objc_assign_strongCast + diff --git a/test/CodeGenObjC/objc2-weak-assign.m b/test/CodeGenObjC/objc2-weak-assign.m index 74c0c00c7caa..e5c67c58d64a 100644 --- a/test/CodeGenObjC/objc2-weak-assign.m +++ b/test/CodeGenObjC/objc2-weak-assign.m @@ -1,6 +1,6 @@ -// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -fobjc-gc -emit-llvm -o %t %s +// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -fobjc-fragile-abi -fobjc-gc -emit-llvm -o %t %s // RUN: grep -e "objc_assign_weak" %t | grep -e "call" | count 6 -// RUN: %clang_cc1 -x objective-c++ -triple x86_64-apple-darwin9 -fobjc-gc -emit-llvm -o %t %s +// RUN: %clang_cc1 -x objective-c++ -triple x86_64-apple-darwin9 -fobjc-fragile-abi -fobjc-gc -emit-llvm -o %t %s // RUN: grep -e "objc_assign_weak" %t | grep -e "call" | count 6 __weak id* x; diff --git a/test/CodeGenObjC/objc2-weak-block-call.m b/test/CodeGenObjC/objc2-weak-block-call.m index 8cd233e286b2..94c54e7f3ba2 100644 --- a/test/CodeGenObjC/objc2-weak-block-call.m +++ b/test/CodeGenObjC/objc2-weak-block-call.m @@ -1,5 +1,5 @@ -// RUN: %clang_cc1 -fblocks -fobjc-gc -triple x86_64-apple-darwin -emit-llvm %s -o - | FileCheck -check-prefix LP64 %s -// RUN: %clang_cc1 -fblocks -fobjc-gc -triple i386-apple-darwin -emit-llvm %s -o - | FileCheck -check-prefix LP64 %s +// RUN: %clang_cc1 -fblocks -fobjc-gc -triple x86_64-apple-darwin -fobjc-fragile-abi -emit-llvm %s -o - | FileCheck -check-prefix LP64 %s +// RUN: %clang_cc1 -fblocks -fobjc-gc -triple i386-apple-darwin -fobjc-fragile-abi -emit-llvm %s -o - | FileCheck -check-prefix LP64 %s @interface MyView - (void)MyView_sharedInit; diff --git a/test/CodeGenObjC/objc2-weak-compare.m b/test/CodeGenObjC/objc2-weak-compare.m index 8cba1a986094..75cf689737b4 100644 --- a/test/CodeGenObjC/objc2-weak-compare.m +++ b/test/CodeGenObjC/objc2-weak-compare.m @@ -1,5 +1,5 @@ -// RUN: %clang_cc1 -triple i386-apple-darwin9 -fobjc-gc -emit-llvm -o %t %s -// RUN: %clang_cc1 -x objective-c++ -triple i386-apple-darwin9 -fobjc-gc -emit-llvm -o %t %s +// RUN: %clang_cc1 -triple i386-apple-darwin9 -fobjc-fragile-abi -fobjc-gc -emit-llvm -o %t %s +// RUN: %clang_cc1 -x objective-c++ -triple i386-apple-darwin9 -fobjc-fragile-abi -fobjc-gc -emit-llvm -o %t %s @interface PBXTarget { diff --git a/test/CodeGenObjC/objc2-weak-import-attribute.m b/test/CodeGenObjC/objc2-weak-import-attribute.m index 946c79b5bcc5..201e24b9e5ec 100644 --- a/test/CodeGenObjC/objc2-weak-import-attribute.m +++ b/test/CodeGenObjC/objc2-weak-import-attribute.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -fobjc-nonfragile-abi -triple x86_64-apple-darwin10 -emit-llvm -o - %s | FileCheck -check-prefix=CHECK-X86-64 %s +// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -o - %s | FileCheck -check-prefix=CHECK-X86-64 %s __attribute__((weak_import)) @interface WeakRootClass @end diff --git a/test/CodeGenObjC/objc2-weak-ivar-debug.m b/test/CodeGenObjC/objc2-weak-ivar-debug.m index 8f7acd7619ac..83262a82a61b 100644 --- a/test/CodeGenObjC/objc2-weak-ivar-debug.m +++ b/test/CodeGenObjC/objc2-weak-ivar-debug.m @@ -1,7 +1,7 @@ -// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -fobjc-gc -g -emit-llvm -o - %s -// RUN: %clang_cc1 -triple i386-apple-darwin9 -fobjc-gc -g -emit-llvm -o - %s -// RUN: %clang_cc1 -x objective-c++ -triple x86_64-apple-darwin9 -fobjc-gc -g -emit-llvm -o - %s -// RUN: %clang_cc1 -x objective-c++ -triple i386-apple-darwin9 -fobjc-gc -g -emit-llvm -o - %s +// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -fobjc-fragile-abi -fobjc-gc -g -emit-llvm -o - %s +// RUN: %clang_cc1 -triple i386-apple-darwin9 -fobjc-fragile-abi -fobjc-gc -g -emit-llvm -o - %s +// RUN: %clang_cc1 -x objective-c++ -triple x86_64-apple-darwin9 -fobjc-fragile-abi -fobjc-gc -g -emit-llvm -o - %s +// RUN: %clang_cc1 -x objective-c++ -triple i386-apple-darwin9 -fobjc-fragile-abi -fobjc-gc -g -emit-llvm -o - %s // rdar://7252252 @interface Loop { diff --git a/test/CodeGenObjC/objc2-weak-ivar.m b/test/CodeGenObjC/objc2-weak-ivar.m index 8c91a80b6863..78ccdf8876cc 100644 --- a/test/CodeGenObjC/objc2-weak-ivar.m +++ b/test/CodeGenObjC/objc2-weak-ivar.m @@ -1,5 +1,5 @@ -// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -fobjc-gc -emit-llvm -o %t %s -// RUN: %clang_cc1 -x objective-c++ -triple x86_64-apple-darwin9 -fobjc-gc -emit-llvm -o %t %s +// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -fobjc-fragile-abi -fobjc-gc -emit-llvm -o %t %s +// RUN: %clang_cc1 -x objective-c++ -triple x86_64-apple-darwin9 -fobjc-fragile-abi -fobjc-gc -emit-llvm -o %t %s @class NSObject; @interface Foo { diff --git a/test/CodeGenObjC/objc2-write-barrier-2.m b/test/CodeGenObjC/objc2-write-barrier-2.m index 74cd7eafad4f..eae2551aa074 100644 --- a/test/CodeGenObjC/objc2-write-barrier-2.m +++ b/test/CodeGenObjC/objc2-write-barrier-2.m @@ -1,8 +1,8 @@ -// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-gc -emit-llvm -o %t %s +// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-fragile-abi -fobjc-gc -emit-llvm -o %t %s // RUN: grep -F '@objc_assign_global' %t | count 7 // RUN: grep -F '@objc_assign_ivar' %t | count 5 // RUN: grep -F '@objc_assign_strongCast' %t | count 8 -// RUN: %clang_cc1 -x objective-c++ -triple x86_64-apple-darwin10 -fobjc-gc -emit-llvm -o %t %s +// RUN: %clang_cc1 -x objective-c++ -triple x86_64-apple-darwin10 -fobjc-fragile-abi -fobjc-gc -emit-llvm -o %t %s // RUN: grep -F '@objc_assign_global' %t | count 7 // RUN: grep -F '@objc_assign_ivar' %t | count 5 // RUN: grep -F '@objc_assign_strongCast' %t | count 8 diff --git a/test/CodeGenObjC/objc2-write-barrier-3.m b/test/CodeGenObjC/objc2-write-barrier-3.m index cb72cc06e55c..4ef1b8aa1e86 100644 --- a/test/CodeGenObjC/objc2-write-barrier-3.m +++ b/test/CodeGenObjC/objc2-write-barrier-3.m @@ -1,7 +1,7 @@ -// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-nonfragile-abi -fblocks -fobjc-gc -emit-llvm -o %t %s +// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fblocks -fobjc-gc -emit-llvm -o %t %s // RUN: grep objc_assign_ivar %t | count 3 // RUN: grep objc_assign_strongCast %t | count 6 -// RUN: %clang_cc1 -x objective-c++ -triple x86_64-apple-darwin10 -fobjc-nonfragile-abi -fblocks -fobjc-gc -emit-llvm -o %t %s +// RUN: %clang_cc1 -x objective-c++ -triple x86_64-apple-darwin10 -fblocks -fobjc-gc -emit-llvm -o %t %s // RUN: grep objc_assign_ivar %t | count 3 // RUN: grep objc_assign_strongCast %t | count 6 diff --git a/test/CodeGenObjC/objc2-write-barrier-4.m b/test/CodeGenObjC/objc2-write-barrier-4.m index ab30649bec2b..4089920b0925 100644 --- a/test/CodeGenObjC/objc2-write-barrier-4.m +++ b/test/CodeGenObjC/objc2-write-barrier-4.m @@ -1,7 +1,7 @@ -// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-gc -emit-llvm -o %t %s +// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-fragile-abi -fobjc-gc -emit-llvm -o %t %s // RUN: grep objc_assign_global %t | count 3 // RUN: grep objc_assign_strongCast %t | count 2 -// RUN: %clang_cc1 -x objective-c++ -triple x86_64-apple-darwin10 -fobjc-gc -emit-llvm -o %t %s +// RUN: %clang_cc1 -x objective-c++ -triple x86_64-apple-darwin10 -fobjc-fragile-abi -fobjc-gc -emit-llvm -o %t %s // RUN: grep objc_assign_global %t | count 3 // RUN: grep objc_assign_strongCast %t | count 2 diff --git a/test/CodeGenObjC/objc2-write-barrier-5.m b/test/CodeGenObjC/objc2-write-barrier-5.m index 373df0cc16b9..122fa9f3c0b7 100644 --- a/test/CodeGenObjC/objc2-write-barrier-5.m +++ b/test/CodeGenObjC/objc2-write-barrier-5.m @@ -1,9 +1,9 @@ -// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-gc -emit-llvm -o %t %s +// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-fragile-abi -fobjc-gc -emit-llvm -o %t %s // RUN: grep objc_assign_ivar %t | count 0 -// RUN: grep objc_assign_strongCast %t | count 5 -// RUN: %clang_cc1 -x objective-c++ -triple x86_64-apple-darwin10 -fobjc-gc -emit-llvm -o %t %s +// RUN: grep objc_assign_strongCast %t | count 8 +// RUN: %clang_cc1 -x objective-c++ -triple x86_64-apple-darwin10 -fobjc-fragile-abi -fobjc-gc -emit-llvm -o %t %s // RUN: grep objc_assign_ivar %t | count 0 -// RUN: grep objc_assign_strongCast %t | count 5 +// RUN: grep objc_assign_strongCast %t | count 8 @interface TestUnarchiver { @@ -27,3 +27,20 @@ struct unarchive_list { } @end + +// rdar://10191569 +@interface I +{ + struct S { + id _timer; + } *p_animationState; +} +@end + +@implementation I +- (void) Meth { + p_animationState->_timer = 0; + (*p_animationState)._timer = 0; + (&(*p_animationState))->_timer = 0; +} +@end diff --git a/test/CodeGenObjC/objc2-write-barrier.m b/test/CodeGenObjC/objc2-write-barrier.m index 08b65deaa38d..bf2dfb9b14f9 100644 --- a/test/CodeGenObjC/objc2-write-barrier.m +++ b/test/CodeGenObjC/objc2-write-barrier.m @@ -1,7 +1,7 @@ -// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-gc -emit-llvm -o %t %s +// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-fragile-abi -fobjc-gc -emit-llvm -o %t %s // RUN: grep -F '@objc_assign_global' %t | count 21 // RUN: grep -F '@objc_assign_ivar' %t | count 11 -// RUN: %clang_cc1 -x objective-c++ -triple x86_64-apple-darwin10 -fobjc-gc -emit-llvm -o %t %s +// RUN: %clang_cc1 -x objective-c++ -triple x86_64-apple-darwin10 -fobjc-fragile-abi -fobjc-gc -emit-llvm -o %t %s // RUN: grep -F '@objc_assign_global' %t | count 21 // RUN: grep -F '@objc_assign_ivar' %t | count 11 diff --git a/test/CodeGenObjC/object-incr-decr-1.m b/test/CodeGenObjC/object-incr-decr-1.m index 6369076174b3..19c12cb315a2 100644 --- a/test/CodeGenObjC/object-incr-decr-1.m +++ b/test/CodeGenObjC/object-incr-decr-1.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple i386-apple-darwin9 -emit-llvm %s -o %t +// RUN: %clang_cc1 -triple i386-apple-darwin9 -fobjc-fragile-abi -emit-llvm %s -o %t @interface Foo { diff --git a/test/CodeGenObjC/predefined-expr.m b/test/CodeGenObjC/predefined-expr.m index 43d329e2ab1d..009bbcdb013c 100644 --- a/test/CodeGenObjC/predefined-expr.m +++ b/test/CodeGenObjC/predefined-expr.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple i386-apple-darwin9 %s -emit-llvm -o - | FileCheck %s +// RUN: %clang_cc1 -triple i386-apple-darwin9 -fobjc-fragile-abi %s -emit-llvm -o - | FileCheck %s // CHECK: @"__func__.-[Foo instanceTest1]" = private unnamed_addr constant [21 x i8] c"-[Foo instanceTest1]\00" // CHECK: @"__func__.-[Foo instanceTest2:]" = private unnamed_addr constant [22 x i8] c"-[Foo instanceTest2:]\00" diff --git a/test/CodeGenObjC/property-aggr-type.m b/test/CodeGenObjC/property-aggr-type.m deleted file mode 100644 index 8ba87de3534a..000000000000 --- a/test/CodeGenObjC/property-aggr-type.m +++ /dev/null @@ -1,50 +0,0 @@ -// RUN: %clang_cc1 -emit-llvm -o %t %s - -@interface Object -- (id) new; -@end - -typedef struct {int x, y, w, h;} st1; -typedef struct {int x, y, w, h;} st2; - -@interface bar : Object -- (void)setFrame:(st1)frameRect; -@end - -@interface bar1 : Object -- (void)setFrame:(int)frameRect; -@end - -@interface foo : Object -{ - st2 ivar; -} -@property (assign) st2 frame; -@end - -@implementation foo -@synthesize frame = ivar; -@end - -extern void abort(); - -static st2 r = {1,2,3,4}; -st2 test (void) -{ - foo *obj = [foo new]; - id objid = [foo new];; - - obj.frame = r; - - ((foo*)objid).frame = obj.frame; - - return ((foo*)objid).frame; -} - -int main () -{ - st2 res = test (); - if (res.x != 1 || res.h != 4) - abort(); - return 0; -} diff --git a/test/CodeGenObjC/property-aggregate.m b/test/CodeGenObjC/property-aggregate.m new file mode 100644 index 000000000000..f4211b6b62bd --- /dev/null +++ b/test/CodeGenObjC/property-aggregate.m @@ -0,0 +1,31 @@ +// RUN: %clang_cc1 -triple x86_64-apple-darwin -emit-llvm %s -o - | FileCheck %s + +// This structure's size is not a power of two, so the property does +// not get native atomics, even though x86-64 can do unaligned atomics +// with a lock prefix. +struct s3 { char c[3]; }; + +// This structure's size is, so it does, because it can. +// FIXME: But we don't at the moment; the backend doesn't know how to generate +// correct code. +struct s4 { char c[4]; }; + +@interface Test0 +@property struct s3 s3; +@property struct s4 s4; +@end +@implementation Test0 +@synthesize s3, s4; +@end + +// CHECK: define internal i24 @"\01-[Test0 s3]"( +// CHECK: call void @objc_copyStruct + +// CHECK: define internal void @"\01-[Test0 setS3:]"( +// CHECK: call void @objc_copyStruct + +// CHECK: define internal i32 @"\01-[Test0 s4]"( +// CHECK: call void @objc_copyStruct + +// CHECK: define internal void @"\01-[Test0 setS4:]"( +// CHECK: call void @objc_copyStruct diff --git a/test/CodeGenObjC/property-category-impl.m b/test/CodeGenObjC/property-category-impl.m index 80a18cb1daab..734f9a37a24c 100644 --- a/test/CodeGenObjC/property-category-impl.m +++ b/test/CodeGenObjC/property-category-impl.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-nonfragile-abi -emit-llvm -o - %s | FileCheck %s +// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -o - %s | FileCheck %s // rdar : // 8093297 diff --git a/test/CodeGenObjC/property-complex.m b/test/CodeGenObjC/property-complex.m index 071d0b1d24d2..3cdd2ecfd15d 100644 --- a/test/CodeGenObjC/property-complex.m +++ b/test/CodeGenObjC/property-complex.m @@ -1,5 +1,5 @@ -// RUN: %clang_cc1 -triple i386-apple-darwin9 -emit-llvm -o %t %s -// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -emit-llvm -o %t %s +// RUN: %clang_cc1 -triple i386-apple-darwin9 -fobjc-fragile-abi -emit-llvm -o %t %s +// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -fobjc-fragile-abi -emit-llvm -o %t %s @interface I0 { @public diff --git a/test/CodeGenObjC/property-list-in-class.m b/test/CodeGenObjC/property-list-in-class.m index 05210588ba9b..e8014855af7e 100644 --- a/test/CodeGenObjC/property-list-in-class.m +++ b/test/CodeGenObjC/property-list-in-class.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-nonfragile-abi -emit-llvm %s -o - | FileCheck %s +// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck %s // CHECK: l_OBJC_$_PROP_LIST_C2" = internal global { i32, i32, [3 x %struct._prop_t] } { i32 16, i32 3 @protocol P diff --git a/test/CodeGenObjC/property-ref-cast-to-void.m b/test/CodeGenObjC/property-ref-cast-to-void.m index a365aa56e84d..ad1689fd6243 100644 --- a/test/CodeGenObjC/property-ref-cast-to-void.m +++ b/test/CodeGenObjC/property-ref-cast-to-void.m @@ -1,5 +1,5 @@ -// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -emit-llvm -o - %s | FileCheck %s -// RUN: %clang_cc1 -x objective-c++ -triple x86_64-apple-darwin9 -emit-llvm -o - %s | FileCheck %s +// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -fobjc-fragile-abi -emit-llvm -o - %s | FileCheck %s +// RUN: %clang_cc1 -x objective-c++ -triple x86_64-apple-darwin9 -fobjc-fragile-abi -emit-llvm -o - %s | FileCheck %s // rdar: // 8399655 @interface TestClass diff --git a/test/CodeGenObjC/property-type-mismatch.m b/test/CodeGenObjC/property-type-mismatch.m index 7045947b1abf..b920b45aef95 100644 --- a/test/CodeGenObjC/property-type-mismatch.m +++ b/test/CodeGenObjC/property-type-mismatch.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-nonfragile-abi -emit-llvm -o - %s | FileCheck %s +// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -o - %s | FileCheck %s // rdar://8966864 @interface Foo diff --git a/test/CodeGenObjC/property.m b/test/CodeGenObjC/property.m index dd0786eb30ee..3cc9200f333c 100644 --- a/test/CodeGenObjC/property.m +++ b/test/CodeGenObjC/property.m @@ -103,3 +103,12 @@ void test4(Test4 *t) { // CHECK-NEXT: ret void test4_printf("%.2f", t.f); } + +@interface Test5 { + unsigned _x : 5; +} +@property unsigned x; +@end +@implementation Test5 +@synthesize x = _x; +@end diff --git a/test/CodeGenObjC/protocol-in-extended-class.m b/test/CodeGenObjC/protocol-in-extended-class.m index daf4d4ccf578..a92408463deb 100644 --- a/test/CodeGenObjC/protocol-in-extended-class.m +++ b/test/CodeGenObjC/protocol-in-extended-class.m @@ -1,7 +1,7 @@ // REQUIRES: x86-registered-target,x86-64-registered-target -// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-nonfragile-abi -S %s -o %t-64.s +// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -S %s -o %t-64.s // RUN: FileCheck -check-prefix LP64 --input-file=%t-64.s %s -// RUN: %clang_cc1 -triple i386-apple-darwin -S %s -o %t-32.s +// RUN: %clang_cc1 -triple i386-apple-darwin -fobjc-fragile-abi -S %s -o %t-32.s // RUN: FileCheck -check-prefix LP32 --input-file=%t-32.s %s @protocol MyProtocol diff --git a/test/CodeGenObjC/protocol-property-synth.m b/test/CodeGenObjC/protocol-property-synth.m index 8566949e5c94..c998d631677a 100644 --- a/test/CodeGenObjC/protocol-property-synth.m +++ b/test/CodeGenObjC/protocol-property-synth.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -fobjc-nonfragile-abi -emit-llvm -o %t %s +// RUN: %clang_cc1 -emit-llvm -o %t %s @interface BaseClass { id _delegate; diff --git a/test/CodeGenObjC/protocols-lazy.m b/test/CodeGenObjC/protocols-lazy.m index 2038e60c4e61..1c551fbeec11 100644 --- a/test/CodeGenObjC/protocols-lazy.m +++ b/test/CodeGenObjC/protocols-lazy.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -emit-llvm -triple=i686-apple-darwin8 -o %t %s +// RUN: %clang_cc1 -emit-llvm -triple i686-apple-darwin8 -fobjc-fragile-abi -o %t %s // RUNX: llvm-gcc -S -emit-llvm -o %t %s && // No object generated diff --git a/test/CodeGenObjC/rdr-6732143-dangling-block-reference.m b/test/CodeGenObjC/rdr-6732143-dangling-block-reference.m index fd812dd38823..a93ca033c13c 100644 --- a/test/CodeGenObjC/rdr-6732143-dangling-block-reference.m +++ b/test/CodeGenObjC/rdr-6732143-dangling-block-reference.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -emit-llvm -fobjc-exceptions %s -o - +// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -fobjc-fragile-abi -emit-llvm -fobjc-exceptions %s -o - void f0(id x) { @synchronized (x) { diff --git a/test/CodeGenObjC/simplify-exceptions.mm b/test/CodeGenObjC/simplify-exceptions.mm index a35b10d73d2d..d0baf808531c 100644 --- a/test/CodeGenObjC/simplify-exceptions.mm +++ b/test/CodeGenObjC/simplify-exceptions.mm @@ -1,5 +1,5 @@ // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm \ -// RUN: -fexceptions -fobjc-exceptions -fobjc-nonfragile-abi \ +// RUN: -fexceptions -fobjc-exceptions \ // RUN: -o %t %s // RUN: FileCheck < %t %s // diff --git a/test/CodeGenObjC/stand-alone-implementation.m b/test/CodeGenObjC/stand-alone-implementation.m index a51949578b37..8245f01028b9 100644 --- a/test/CodeGenObjC/stand-alone-implementation.m +++ b/test/CodeGenObjC/stand-alone-implementation.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -fobjc-nonfragile-abi -triple x86_64-apple-darwin10 -emit-llvm -o - %s | FileCheck -check-prefix=CHECK-X86-64 %s +// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -o - %s | FileCheck -check-prefix=CHECK-X86-64 %s // radar 7547942 // Allow injection of ivars into implementation's implicit class. diff --git a/test/CodeGenObjC/super-dotsyntax-struct-property.m b/test/CodeGenObjC/super-dotsyntax-struct-property.m index aac4c1de06a3..a7910a047be8 100644 --- a/test/CodeGenObjC/super-dotsyntax-struct-property.m +++ b/test/CodeGenObjC/super-dotsyntax-struct-property.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-nonfragile-abi -emit-llvm %s -o - | FileCheck %s +// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck %s // rdar: // 8203426 diff --git a/test/CodeGenObjC/super-message-fragileabi.m b/test/CodeGenObjC/super-message-fragileabi.m index 5efc234dcafd..0135919b8946 100644 --- a/test/CodeGenObjC/super-message-fragileabi.m +++ b/test/CodeGenObjC/super-message-fragileabi.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple i386-apple-darwin9 -emit-llvm %s -o - | FileCheck %s +// RUN: %clang_cc1 -triple i386-apple-darwin9 -fobjc-fragile-abi -emit-llvm %s -o - | FileCheck %s @class Some; diff --git a/test/CodeGenObjC/synchronized.m b/test/CodeGenObjC/synchronized.m index 2a809063fe03..4997bb77525e 100644 --- a/test/CodeGenObjC/synchronized.m +++ b/test/CodeGenObjC/synchronized.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -emit-llvm -triple=i686-apple-darwin9 -o - %s -O2 | FileCheck %s +// RUN: %clang_cc1 -emit-llvm -triple i686-apple-darwin9 -fobjc-fragile-abi -o - %s -O2 | FileCheck %s @interface MyClass { diff --git a/test/CodeGenObjC/synthesize_ivar-cont-class.m b/test/CodeGenObjC/synthesize_ivar-cont-class.m index f85320279bc4..6bc7ac8170ef 100644 --- a/test/CodeGenObjC/synthesize_ivar-cont-class.m +++ b/test/CodeGenObjC/synthesize_ivar-cont-class.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -fobjc-nonfragile-abi -emit-llvm -o %t %s +// RUN: %clang_cc1 -emit-llvm -o %t %s // RUN: grep '@"OBJC_IVAR_$_XCOrganizerDeviceNodeInfo.viewController"' %t @interface XCOrganizerNodeInfo diff --git a/test/CodeGenObjC/synthesize_ivar.m b/test/CodeGenObjC/synthesize_ivar.m index 5dd90ab618bb..e4fbe101a648 100644 --- a/test/CodeGenObjC/synthesize_ivar.m +++ b/test/CodeGenObjC/synthesize_ivar.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -fobjc-nonfragile-abi -emit-llvm -o %t %s +// RUN: %clang_cc1 -emit-llvm -o %t %s @interface I @property int IP; diff --git a/test/CodeGenObjC/terminate.m b/test/CodeGenObjC/terminate.m index f04eb6a92bb7..a86205839d45 100644 --- a/test/CodeGenObjC/terminate.m +++ b/test/CodeGenObjC/terminate.m @@ -1,5 +1,5 @@ -// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -fexceptions -fobjc-exceptions -fobjc-runtime-has-terminate -o - %s | FileCheck %s -check-prefix=CHECK-WITH -// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -fexceptions -fobjc-exceptions -o - %s | FileCheck %s -check-prefix=CHECK-WITHOUT +// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-fragile-abi -emit-llvm -fexceptions -fobjc-exceptions -fobjc-runtime-has-terminate -o - %s | FileCheck %s -check-prefix=CHECK-WITH +// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-fragile-abi -emit-llvm -fexceptions -fobjc-exceptions -o - %s | FileCheck %s -check-prefix=CHECK-WITHOUT void destroy(void**); @@ -14,8 +14,8 @@ void test0(void) { // CHECK-WITH: call void @destroy(i8** [[PTR]]) // CHECK-WITH-NEXT: ret void // CHECK-WITH: invoke void @destroy(i8** [[PTR]]) - // CHECK-WITH: call i8* @llvm.eh.exception() - // CHECK-WITH-NEXT: @llvm.eh.selector + // CHECK-WITH: landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gcc_personality_v0 to i8*) + // CHECK-WITH-NEXT: catch i8* null // CHECK-WITH-NEXT: call void @objc_terminate() // CHECK-WITHOUT: define void @test0() @@ -23,7 +23,7 @@ void test0(void) { // CHECK-WITHOUT: call void @destroy(i8** [[PTR]]) // CHECK-WITHOUT-NEXT: ret void // CHECK-WITHOUT: invoke void @destroy(i8** [[PTR]]) - // CHECK-WITHOUT: call i8* @llvm.eh.exception() - // CHECK-WITHOUT-NEXT: @llvm.eh.selector + // CHECK-WITHOUT: landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gcc_personality_v0 to i8*) + // CHECK-WITHOUT-NEXT: catch i8* null // CHECK-WITHOUT-NEXT: call void @abort() } diff --git a/test/CodeGenObjC/variadic-sends.m b/test/CodeGenObjC/variadic-sends.m index 6b04b50ca152..7e557b0178d8 100644 --- a/test/CodeGenObjC/variadic-sends.m +++ b/test/CodeGenObjC/variadic-sends.m @@ -1,5 +1,5 @@ -// RUN: %clang_cc1 -triple i386-unknown-unknown -emit-llvm -o - %s | FileCheck -check-prefix=CHECK-X86-32 %s -// RUN: %clang_cc1 -triple x86_64-unknown-unknown -emit-llvm -o - %s | FileCheck -check-prefix=CHECK-X86-64 %s +// RUN: %clang_cc1 -triple i386-unknown-unknown -fobjc-fragile-abi -emit-llvm -o - %s | FileCheck -check-prefix=CHECK-X86-32 %s +// RUN: %clang_cc1 -triple x86_64-unknown-unknown -fobjc-fragile-abi -emit-llvm -o - %s | FileCheck -check-prefix=CHECK-X86-64 %s @interface A -(void) im0; diff --git a/test/CodeGenObjC/x86_64-struct-return-gc.m b/test/CodeGenObjC/x86_64-struct-return-gc.m index 8022d5903ecf..76407d6654e0 100644 --- a/test/CodeGenObjC/x86_64-struct-return-gc.m +++ b/test/CodeGenObjC/x86_64-struct-return-gc.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-gc -emit-llvm -o - %s | FileCheck %s +// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-fragile-abi -fobjc-gc -emit-llvm -o - %s | FileCheck %s struct Coerce { id a; }; |