diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2012-08-15 20:02:54 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2012-08-15 20:02:54 +0000 |
commit | 56d91b49b13fe55c918afbda19f6165b5fbff87a (patch) | |
tree | 9abb1a658a297776086f4e0dfa6ca533de02104e /test/CodeGenObjC | |
parent | 41e20f564abdb05101d6b2b29c59459a966c22cc (diff) | |
download | src-56d91b49b13fe55c918afbda19f6165b5fbff87a.tar.gz src-56d91b49b13fe55c918afbda19f6165b5fbff87a.zip |
Vendor import of clang trunk r161861:vendor/clang/clang-trunk-r161861
Notes
Notes:
svn path=/vendor/clang/dist/; revision=239313
svn path=/vendor/clang/clang-trunk-r161861/; revision=239314; tag=vendor/clang/clang-trunk-r161861
Diffstat (limited to 'test/CodeGenObjC')
94 files changed, 428 insertions, 159 deletions
diff --git a/test/CodeGenObjC/2008-11-12-Metadata.m b/test/CodeGenObjC/2008-11-12-Metadata.m index afd7ce035aea..afd340a067c3 100644 --- a/test/CodeGenObjC/2008-11-12-Metadata.m +++ b/test/CodeGenObjC/2008-11-12-Metadata.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -emit-llvm -triple x86_64-apple-darwin -fobjc-fragile-abi %s -o /dev/null +// RUN: %clang_cc1 -emit-llvm -triple x86_64-apple-darwin -fobjc-runtime=macosx-fragile-10.5 %s -o /dev/null @interface A @end diff --git a/test/CodeGenObjC/2008-11-24-ConstCFStrings.m b/test/CodeGenObjC/2008-11-24-ConstCFStrings.m index b37f66c29707..53eec2ab0500 100644 --- a/test/CodeGenObjC/2008-11-24-ConstCFStrings.m +++ b/test/CodeGenObjC/2008-11-24-ConstCFStrings.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -emit-llvm -triple x86_64-apple-darwin -fobjc-fragile-abi %s -o - | FileCheck %s +// RUN: %clang_cc1 -emit-llvm -triple x86_64-apple-darwin -fobjc-runtime=macosx-fragile-10.5 %s -o - | FileCheck %s // CHECK: _unnamed_cfstring_ diff --git a/test/CodeGenObjC/2010-03-17-StructRef.m b/test/CodeGenObjC/2010-03-17-StructRef.m index fd0e6462ce2e..ce24c8da575b 100644 --- a/test/CodeGenObjC/2010-03-17-StructRef.m +++ b/test/CodeGenObjC/2010-03-17-StructRef.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 %s -emit-llvm -triple x86_64-apple-darwin -fobjc-fragile-abi -o - | FileCheck %s +// RUN: %clang_cc1 %s -emit-llvm -triple x86_64-apple-darwin -fobjc-runtime=macosx-fragile-10.5 -o - | FileCheck %s // Bitfield references must not touch memory outside of the enclosing // struct. Radar 7639995 typedef signed char BOOL; diff --git a/test/CodeGenObjC/arc-blocks.m b/test/CodeGenObjC/arc-blocks.m index 06acf01ce0f7..2326bce2be25 100644 --- a/test/CodeGenObjC/arc-blocks.m +++ b/test/CodeGenObjC/arc-blocks.m @@ -124,7 +124,7 @@ void test4(void) { // CHECK-NEXT: [[T1:%.*]] = load i8** [[T0]] // CHECK-NEXT: call void @objc_release(i8* [[T1]]) - // CHECK: define internal void @__test4_block_invoke_ + // CHECK: define internal void @__test4_block_invoke // CHECK: [[SLOT:%.*]] = getelementptr inbounds {{.*}}, i32 0, i32 6 // CHECK-NEXT: [[T0:%.*]] = load i8** [[SLOT]], align 8 // CHECK-NEXT: store i8* null, i8** [[SLOT]], @@ -200,7 +200,7 @@ void test6(void) { // CHECK: [[T0:%.*]] = getelementptr inbounds [[BYREF_T]]* {{%.*}}, i32 0, i32 6 // CHECK-NEXT: call void @objc_destroyWeak(i8** [[T0]]) - // CHECK: define internal void @__test6_block_invoke_ + // CHECK: define internal void @__test6_block_invoke // CHECK: [[SLOT:%.*]] = getelementptr inbounds {{.*}}, i32 0, i32 6 // CHECK-NEXT: call i8* @objc_storeWeak(i8** [[SLOT]], i8* null) // CHECK-NEXT: ret void @@ -238,7 +238,7 @@ void test7(void) { // CHECK-NEXT: call void @objc_destroyWeak(i8** [[VAR]]) // CHECK-NEXT: ret void - // CHECK: define internal void @__test7_block_invoke_ + // CHECK: define internal void @__test7_block_invoke // CHECK: [[SLOT:%.*]] = getelementptr inbounds [[BLOCK_T]]* {{%.*}}, i32 0, i32 5 // CHECK-NEXT: [[T0:%.*]] = call i8* @objc_loadWeak(i8** [[SLOT]]) // CHECK-NEXT: call void @test7_consume(i8* [[T0]]) @@ -521,3 +521,14 @@ void test15_helper(void (^block)(void), int x); void test15(int a) { test15_helper(^{ (void) a; }, ({ a; })); } + +// rdar://11016025 +void test16() { + void (^BLKVAR)(void) = ^{ BLKVAR(); }; + + // CHECK: define void @test16( + // CHECK: [[BLKVAR:%.*]] = alloca void ()*, align 8 + // CHECK-NEXT: [[BLOCK:%.*]] = alloca [[BLOCK_T:<{.*}>]], + // CHECK-NEXT: [[SLOTREL:%.*]] = getelementptr inbounds [[BLOCK_T]]* [[BLOCK]], i32 0, i32 5 + // CHECK-NEXT: store void ()* null, void ()** [[BLKVAR]], align 8 +} diff --git a/test/CodeGenObjC/arc.m b/test/CodeGenObjC/arc.m index 2a98b10909bb..66a6a2f54b77 100644 --- a/test/CodeGenObjC/arc.m +++ b/test/CodeGenObjC/arc.m @@ -9,6 +9,9 @@ void test0(id x) { // CHECK-NEXT: [[TMP:%.*]] = load i8** [[X]] // CHECK-NEXT: call void @objc_release(i8* [[TMP]]) // CHECK-NEXT: ret void +// rdar://12040837 + // CHECK: declare extern_weak i8* @objc_retain(i8*) nonlazybind + // CHECK: declare extern_weak void @objc_release(i8*) nonlazybind } // CHECK: define i8* @test1(i8* diff --git a/test/CodeGenObjC/assign.m b/test/CodeGenObjC/assign.m index 82da800e7399..bdc99c635835 100644 --- a/test/CodeGenObjC/assign.m +++ b/test/CodeGenObjC/assign.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple x86_64 -fobjc-fragile-abi -emit-llvm -o - %s | FileCheck %s +// RUN: %clang_cc1 -triple x86_64 -fobjc-runtime=macosx-fragile-10.5 -emit-llvm -o - %s | FileCheck %s struct s0 { int x; diff --git a/test/CodeGenObjC/autorelease.m b/test/CodeGenObjC/autorelease.m index 9260c3fafe8b..830929afb2e8 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-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 +// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -fobjc-arc -fobjc-runtime=macosx-10.7 -o - %s | FileCheck %s +// RUN: %clang_cc1 -triple x86_64-apple-darwin11 -emit-llvm -fobjc-runtime=macosx-10.7 -o - %s | FileCheck %s // rdar://8881826 // rdar://9412038 diff --git a/test/CodeGenObjC/bitfield-1.m b/test/CodeGenObjC/bitfield-1.m index 648ab2a374db..ad52d8f4789c 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 -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 +// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -fobjc-runtime=macosx-fragile-10.5 -emit-llvm -o %t %s +// RUN: %clang_cc1 -triple i386-apple-darwin9 -fobjc-runtime=macosx-fragile-10.5 -emit-llvm -o %t %s +// RUN: %clang_cc1 -triple i386-pc-linux-gnu -fobjc-runtime=macosx-fragile-10.5 -emit-llvm -o %t %s @interface Object - (id) alloc; diff --git a/test/CodeGenObjC/bitfield-access.m b/test/CodeGenObjC/bitfield-access.m index 521d2e52a6fa..6d4c82a9b17c 100644 --- a/test/CodeGenObjC/bitfield-access.m +++ b/test/CodeGenObjC/bitfield-access.m @@ -1,7 +1,7 @@ -// RUN: %clang_cc1 -triple i386-apple-darwin10 -fobjc-fragile-abi -emit-llvm -o %t1 %s +// RUN: %clang_cc1 -triple i386-apple-darwin10 -fobjc-runtime=macosx-fragile-10.5 -emit-llvm -o %t1 %s // RUN: FileCheck -check-prefix=CHECK-I386 < %t1 %s -// RUN: %clang_cc1 -triple armv6-apple-darwin10 -fobjc-fragile-abi -target-abi apcs-gnu -emit-llvm -o %t2 %s +// RUN: %clang_cc1 -triple armv6-apple-darwin10 -fobjc-runtime=macosx-fragile-10.5 -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-gnu.m b/test/CodeGenObjC/bitfield-gnu.m index 7935bdaacf04..383907f15c51 100644 --- a/test/CodeGenObjC/bitfield-gnu.m +++ b/test/CodeGenObjC/bitfield-gnu.m @@ -1,4 +1,4 @@ -// RUN: %clang -S -emit-llvm -fgnu-runtime -o %t %s +// RUN: %clang -S -emit-llvm -fobjc-runtime=gcc -o %t %s typedef enum { A1, A2 } A; typedef struct { A a : 1; } B; @interface Obj { B *b; } @end diff --git a/test/CodeGenObjC/bitfield_encoding.m b/test/CodeGenObjC/bitfield_encoding.m index 17fd4a4108b7..1a516aaf8619 100644 --- a/test/CodeGenObjC/bitfield_encoding.m +++ b/test/CodeGenObjC/bitfield_encoding.m @@ -1,6 +1,6 @@ -// RUN: %clang_cc1 -triple i386-unknown-unknown -fobjc-fragile-abi -emit-llvm -o %t %s +// RUN: %clang_cc1 -triple i386-unknown-unknown -fobjc-runtime=macosx-fragile-10.5 -emit-llvm -o %t %s // RUN: grep "ib1b14" %t | count 1 -// RUN: %clang_cc1 -triple i386-unknown-unknown -fobjc-fragile-abi -fgnu-runtime -emit-llvm -o %t %s +// RUN: %clang_cc1 -triple i386-unknown-unknown -fobjc-runtime=macosx-fragile-10.5 -fobjc-runtime=gcc -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 140fa8831937..57b9ea3fa6ea 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 -fobjc-fragile-abi | FileCheck %s +// RUN: %clang_cc1 %s -emit-llvm -o - -fblocks -triple x86_64-apple-darwin10 -fobjc-runtime=macosx-fragile-10.5 | FileCheck %s // rdar://8893785 void MYFUNC() { diff --git a/test/CodeGenObjC/block-var-layout.m b/test/CodeGenObjC/block-var-layout.m index 1d0ce2d373ad..c8065be88c76 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 -fobjc-fragile-abi -O0 -emit-llvm %s -o %t-64.s +// RUN: %clang_cc1 -fblocks -fobjc-gc -triple x86_64-apple-darwin -fobjc-runtime=macosx-fragile-10.5 -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 64da3594c271..99a11f91e4cd 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 -fobjc-fragile-abi +// RUN: %clang_cc1 %s -emit-llvm -o %t -fobjc-gc -fblocks -triple i386-apple-darwin10 -fobjc-runtime=macosx-fragile-10.5 // 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 -fobjc-fragile-abi +// RUN: %clang_cc1 -x objective-c++ %s -emit-llvm -o %t -fobjc-gc -fblocks -triple i386-apple-darwin10 -fobjc-runtime=macosx-fragile-10.5 // 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 591d63bf37da..b04fa008b275 100644 --- a/test/CodeGenObjC/blocks-2.m +++ b/test/CodeGenObjC/blocks-2.m @@ -1,10 +1,10 @@ // 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 -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 +// RUN: %clang_cc1 %s -emit-llvm -o - -fobjc-gc -fblocks -fexceptions -triple i386-apple-darwin10 -fobjc-runtime=macosx-fragile-10.5 | FileCheck %s +// RUN: %clang_cc1 %s -emit-llvm -o - -fobjc-gc -fblocks -fexceptions -triple i386-apple-darwin10 -fobjc-runtime=macosx-fragile-10.5 -x objective-c++ | FileCheck %s // CHECK: define i8* @{{.*}}test0 -// CHECK: define internal void @__test0_block_invoke_0( +// CHECK: define internal void @{{.*}}_block_invoke( // CHECK: call i8* @objc_assign_strongCast( // CHECK-NEXT: ret void id test0(id x) { diff --git a/test/CodeGenObjC/blocks-3.m b/test/CodeGenObjC/blocks-3.m index 55e215c7e6ab..a7edc1243cf5 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 -fobjc-fragile-abi -emit-llvm -fblocks -o %t %s +// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -fobjc-runtime=macosx-fragile-10.5 -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 b3d099811cf0..f5af9bc39eb8 100644 --- a/test/CodeGenObjC/blocks-4.m +++ b/test/CodeGenObjC/blocks-4.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple i386-apple-darwin9 -fobjc-fragile-abi -emit-llvm -fobjc-exceptions -fblocks -o %t %s +// RUN: %clang_cc1 -triple i386-apple-darwin9 -fobjc-runtime=macosx-fragile-10.5 -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 caa8d664455e..18adb0fed9b1 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 -fobjc-fragile-abi -emit-llvm -fblocks -o %t %s +// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -fobjc-runtime=macosx-fragile-10.5 -emit-llvm -fblocks -o %t %s // rdar: // 8064140 diff --git a/test/CodeGenObjC/blocks.m b/test/CodeGenObjC/blocks.m index f478c07f78fb..6c85da9f895c 100644 --- a/test/CodeGenObjC/blocks.m +++ b/test/CodeGenObjC/blocks.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple i386-apple-darwin9 -fobjc-fragile-abi -emit-llvm -fblocks -o - %s | FileCheck %s +// RUN: %clang_cc1 -triple i386-apple-darwin9 -fobjc-runtime=macosx-fragile-10.5 -emit-llvm -fblocks -o - %s | FileCheck %s // test1. All of this is somehow testing rdar://6676764 struct S { @@ -18,7 +18,7 @@ void foo(T *P) { -(void) im0; @end -// CHECK: define internal i32 @"__8-[A im0]_block_invoke_0"( +// CHECK: define internal i32 @"__8-[A im0]_block_invoke"( @implementation A -(void) im0 { (void) ^{ return 1; }(); @@ -91,7 +91,7 @@ void test2(Test2 *x) { // rdar://problem/9124263 // In the test above, check that the use in the invocation function // doesn't require a read barrier. -// CHECK: define internal void @__test2_block_invoke_ +// CHECK: define internal void @__test2_block_invoke // CHECK: [[BLOCK:%.*]] = bitcast i8* {{%.*}} to [[BLOCK_T]]* // CHECK-NEXT: [[T0:%.*]] = getelementptr inbounds [[BLOCK_T]]* [[BLOCK]], i32 0, i32 5 // CHECK-NEXT: [[T1:%.*]] = load i8** [[T0]] diff --git a/test/CodeGenObjC/boxing.m b/test/CodeGenObjC/boxing.m new file mode 100644 index 000000000000..9664298154dc --- /dev/null +++ b/test/CodeGenObjC/boxing.m @@ -0,0 +1,95 @@ +// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -o - %s | FileCheck %s + +typedef long NSInteger; +typedef unsigned long NSUInteger; +typedef signed char BOOL; +#define nil ((void*) 0) + +@interface NSObject ++ (id)alloc; +@end + +@interface NSNumber : NSObject +@end + +@interface NSNumber (NSNumberCreation) +- (id)initWithChar:(char)value; +- (id)initWithUnsignedChar:(unsigned char)value; +- (id)initWithShort:(short)value; +- (id)initWithUnsignedShort:(unsigned short)value; +- (id)initWithInt:(int)value; +- (id)initWithUnsignedInt:(unsigned int)value; +- (id)initWithLong:(long)value; +- (id)initWithUnsignedLong:(unsigned long)value; +- (id)initWithLongLong:(long long)value; +- (id)initWithUnsignedLongLong:(unsigned long long)value; +- (id)initWithFloat:(float)value; +- (id)initWithDouble:(double)value; +- (id)initWithBool:(BOOL)value; +- (id)initWithInteger:(NSInteger)value; +- (id)initWithUnsignedInteger:(NSUInteger)value; + ++ (NSNumber *)numberWithChar:(char)value; ++ (NSNumber *)numberWithUnsignedChar:(unsigned char)value; ++ (NSNumber *)numberWithShort:(short)value; ++ (NSNumber *)numberWithUnsignedShort:(unsigned short)value; ++ (NSNumber *)numberWithInt:(int)value; ++ (NSNumber *)numberWithUnsignedInt:(unsigned int)value; ++ (NSNumber *)numberWithLong:(long)value; ++ (NSNumber *)numberWithUnsignedLong:(unsigned long)value; ++ (NSNumber *)numberWithLongLong:(long long)value; ++ (NSNumber *)numberWithUnsignedLongLong:(unsigned long long)value; ++ (NSNumber *)numberWithFloat:(float)value; ++ (NSNumber *)numberWithDouble:(double)value; ++ (NSNumber *)numberWithBool:(BOOL)value; ++ (NSNumber *)numberWithInteger:(NSInteger)value; ++ (NSNumber *)numberWithUnsignedInteger:(NSUInteger)value; +@end + +@interface NSString : NSObject +@end + +@interface NSString (NSStringExtensionMethods) ++ (id)stringWithUTF8String:(const char *)nullTerminatedCString; +@end + +// CHECK: [[WithIntMeth:@".*"]] = internal global [15 x i8] c"numberWithInt:\00" +// CHECK: [[WithIntSEL:@".*"]] = internal global i8* getelementptr inbounds ([15 x i8]* [[WithIntMeth]] +// CHECK: [[WithCharMeth:@".*"]] = internal global [16 x i8] c"numberWithChar:\00" +// CHECK: [[WithCharSEL:@".*"]] = internal global i8* getelementptr inbounds ([16 x i8]* [[WithCharMeth]] +// CHECK: [[WithBoolMeth:@".*"]] = internal global [16 x i8] c"numberWithBool:\00" +// CHECK: [[WithBoolSEL:@".*"]] = internal global i8* getelementptr inbounds ([16 x i8]* [[WithBoolMeth]] +// CHECK: [[WithIntegerMeth:@".*"]] = internal global [19 x i8] c"numberWithInteger:\00" +// CHECK: [[WithIntegerSEL:@".*"]] = internal global i8* getelementptr inbounds ([19 x i8]* [[WithIntegerMeth]] +// CHECK: [[WithUnsignedIntegerMeth:@".*"]] = internal global [27 x i8] c"numberWithUnsignedInteger:\00" +// CHECK: [[WithUnsignedIntegerSEL:@".*"]] = internal global i8* getelementptr inbounds ([27 x i8]* [[WithUnsignedIntegerMeth]] +// CHECK: [[stringWithUTF8StringMeth:@".*"]] = internal global [22 x i8] c"stringWithUTF8String:\00" +// CHECK: [[stringWithUTF8StringSEL:@".*"]] = internal global i8* getelementptr inbounds ([22 x i8]* [[stringWithUTF8StringMeth]] + +int main() { + // CHECK: load i8** [[WithIntSEL]] + int i; @(i); + // CHECK: load i8** [[WithCharSEL]] + signed char sc; @(sc); + // CHECK: load i8** [[WithBoolSEL]] + BOOL b; @(b); + // CHECK: load i8** [[WithBoolSEL]] + typeof(b) b2; @(b2); + // CHECK: load i8** [[WithBoolSEL]] + typedef const typeof(b) MyBOOL; MyBOOL b3; @(b3); + // CHECK: load i8** [[WithBoolSEL]] + @((BOOL)i); + // CHECK: load i8** [[WithIntegerSEL]] + @((NSInteger)i); + // CHECK: load i8** [[WithUnsignedIntegerSEL]] + @((NSUInteger)i); + // CHECK: load i8** [[stringWithUTF8StringSEL]] + const char *s; @(s); + + typedef enum : NSInteger { Red, Green, Blue } Color; + // CHECK: load i8** [[WithIntegerSEL]] + @(Red); + Color col = Red; + // CHECK: load i8** [[WithIntegerSEL]] + @(col); +} diff --git a/test/CodeGenObjC/builtins.m b/test/CodeGenObjC/builtins.m index cb2995da52a5..0c5744805e6d 100644 --- a/test/CodeGenObjC/builtins.m +++ b/test/CodeGenObjC/builtins.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-fragile-abi -emit-llvm -o - %s | FileCheck %s +// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-runtime=macosx-fragile-10.5 -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); diff --git a/test/CodeGenObjC/category-class.m b/test/CodeGenObjC/category-class.m index 5a82c1425504..92fd36cbe406 100644 --- a/test/CodeGenObjC/category-class.m +++ b/test/CodeGenObjC/category-class.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple i386-apple-darwin9 -fobjc-fragile-abi -emit-llvm -o - %s | FileCheck %s +// RUN: %clang_cc1 -triple i386-apple-darwin9 -fobjc-runtime=macosx-fragile-10.5 -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 45aae254bd33..4eae1ae6eab6 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 -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 +// RUN: %clang_cc1 -triple x86_64-unknown-unknown -fobjc-runtime=macosx-fragile-10.5 -emit-llvm -o - %s +// RUN: %clang_cc1 -triple i386-apple-darwin9 -fobjc-runtime=macosx-fragile-10.5 -emit-llvm -o - %s +// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -fobjc-runtime=macosx-fragile-10.5 -emit-llvm -o - %s @interface I0 { diff --git a/test/CodeGenObjC/constant-string-class.m b/test/CodeGenObjC/constant-string-class.m index ea049a51e12b..adad6b012623 100644 --- a/test/CodeGenObjC/constant-string-class.m +++ b/test/CodeGenObjC/constant-string-class.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple i386-apple-darwin9 -fobjc-fragile-abi -fno-constant-cfstrings -fconstant-string-class Foo -emit-llvm -o %t %s +// RUN: %clang_cc1 -triple i386-apple-darwin9 -fobjc-runtime=macosx-fragile-10.5 -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 -fno-constant-cfstrings -fconstant-string-class Foo -emit-llvm -o %t %s diff --git a/test/CodeGenObjC/constant-strings.m b/test/CodeGenObjC/constant-strings.m index c308d7a475dc..cad634a4b103 100644 --- a/test/CodeGenObjC/constant-strings.m +++ b/test/CodeGenObjC/constant-strings.m @@ -5,11 +5,11 @@ // // CHECK-NEXT: @.str = {{.*}}constant [13 x i8] c"Hello World!\00", align 1 -// RUN: %clang_cc1 -fgnu-runtime -emit-llvm -o %t %s +// RUN: %clang_cc1 -fobjc-runtime=gcc -emit-llvm -o %t %s // RUN: FileCheck --check-prefix=CHECK-GNU < %t %s // CHECK-GNU: NXConstantString -// RUN: %clang_cc1 -fgnu-runtime -fconstant-string-class NSConstantString -emit-llvm -o %t %s +// RUN: %clang_cc1 -fobjc-runtime=gcc -fconstant-string-class NSConstantString -emit-llvm -o %t %s // RUN: FileCheck --check-prefix=CHECK-GNU-WITH-CLASS < %t %s // CHECK-GNU-WITH-CLASS: NSConstantString id a = @"Hello World!"; diff --git a/test/CodeGenObjC/deadcode_strip_used_var.m b/test/CodeGenObjC/deadcode_strip_used_var.m index 3137ceb22298..b8a703487aa8 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 -fobjc-fragile-abi +// RUN: %clang_cc1 %s -emit-llvm -o %t -triple i386-apple-darwin10 -fobjc-runtime=macosx-fragile-10.5 // RUN: grep "llvm.used" %t | count 1 -// RUN: %clang_cc1 %s -emit-llvm -o %t -triple x86_64-apple-darwin10 -fobjc-fragile-abi +// RUN: %clang_cc1 %s -emit-llvm -o %t -triple x86_64-apple-darwin10 -fobjc-runtime=macosx-fragile-10.5 // 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 83db0c97e5a8..cf8c2a2a9684 100644 --- a/test/CodeGenObjC/debug-info-block-helper.m +++ b/test/CodeGenObjC/debug-info-block-helper.m @@ -1,8 +1,8 @@ // REQUIRES: x86-64-registered-target -// RUN: %clang_cc1 -emit-llvm -fblocks -g -triple x86_64-apple-darwin10 -fobjc-fragile-abi %s -o - | FileCheck %s +// RUN: %clang_cc1 -emit-llvm -fblocks -g -triple x86_64-apple-darwin10 -fobjc-runtime=macosx-fragile-10.5 %s -o - | FileCheck %s extern void foo(void(^)(void)); -// CHECK: metadata !{i32 786478, i32 0, metadata !27, metadata !"__destroy_helper_block_", metadata !"__destroy_helper_block_", metadata !"", metadata !27, i32 24, metadata !43, i1 true, i1 true, i32 0, i32 0, null, i32 0, i1 false, void (i8*)* @__destroy_helper_block_, null, null, metadata !45, i32 24} ; [ DW_TAG_subprogram ] +// CHECK: metadata !{i32 786478, i32 0, metadata !27, metadata !"__destroy_helper_block_", metadata !"__destroy_helper_block_", metadata !"", metadata !27, i32 24, metadata !37, i1 true, i1 true, i32 0, i32 0, null, i32 0, i1 false, void (i8*)* @__destroy_helper_block_, null, null, metadata !5, i32 24} ; [ DW_TAG_subprogram ] @interface NSObject { struct objc_object *isa; diff --git a/test/CodeGenObjC/debug-info-crash.m b/test/CodeGenObjC/debug-info-crash.m index 5504356d2e3a..abbe2eb651c6 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 -fobjc-fragile-abi -fblocks -g -S %s -o - +// RUN: %clang_cc1 -triple i386-apple-darwin10 -fobjc-runtime=macosx-fragile-10.5 -fblocks -g -S %s -o - // rdar://7556129 @implementation test diff --git a/test/CodeGenObjC/debug-info-static-var.m b/test/CodeGenObjC/debug-info-static-var.m index c65e77c4d8d4..8602ffb78e46 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 -fobjc-fragile-abi -S -masm-verbose -o - %s | FileCheck %s +// RUN: %clang_cc1 -g -triple x86_64-apple-darwin10 -fobjc-runtime=macosx-fragile-10.5 -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/debug-info-synthesis.m b/test/CodeGenObjC/debug-info-synthesis.m index 7e263cf74c6e..bf8e6d104924 100644 --- a/test/CodeGenObjC/debug-info-synthesis.m +++ b/test/CodeGenObjC/debug-info-synthesis.m @@ -31,4 +31,4 @@ int main(int argc, char *argv[]) { } // CHECK: !7 = metadata !{i32 {{.*}}, metadata !"./foo.h" -// CHECK: !31 = metadata !{i32 {{.*}}, i32 0, metadata !7, metadata !"-[Foo dict]", metadata !"-[Foo dict]", metadata !"", metadata !7, i32 8, metadata !32, i1 true, i1 true, i32 0, i32 0, null, i32 320, i1 false, %1* (%0*, i8*)* @"\01-[Foo dict]", null, null, metadata !34, i32 8} ; [ DW_TAG_subprogram ] +// CHECK: !29 = metadata !{i32 {{.*}}, i32 0, metadata !7, metadata !"-[Foo dict]", metadata !"-[Foo dict]", metadata !"", metadata !7, i32 8, metadata !30, i1 true, i1 true, i32 0, i32 0, null, i32 320, i1 false, %1* (%0*, i8*)* @"\01-[Foo dict]", null, null, metadata !1, i32 8} ; [ DW_TAG_subprogram ] diff --git a/test/CodeGenObjC/encode-cstyle-method.m b/test/CodeGenObjC/encode-cstyle-method.m index ea630230b541..f3243a31487f 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 -fobjc-fragile-abi -emit-llvm -o - %s | FileCheck -check-prefix LP64 %s +// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-runtime=macosx-fragile-10.5 -emit-llvm -o - %s | FileCheck -check-prefix LP64 %s // rdar: // 7445205 @interface Foo diff --git a/test/CodeGenObjC/encode-test-6.m b/test/CodeGenObjC/encode-test-6.m new file mode 100644 index 000000000000..10681dbcc592 --- /dev/null +++ b/test/CodeGenObjC/encode-test-6.m @@ -0,0 +1,19 @@ +// RUN: %clang_cc1 -triple x86_64-apple-darwin -emit-llvm -o %t %s +// RUN: FileCheck < %t %s +// rdar://11777609 + +typedef struct {} Z; + +@interface A +-(void)bar:(Z)a; +-(void)foo:(Z)a : (char*)b : (Z)c : (double) d; +@end + +@implementation A +-(void)bar:(Z)a {} +-(void)foo:(Z)a: (char*)b : (Z)c : (double) d {} +@end + +// CHECK: internal global [14 x i8] c"v16@0:8{?=}16 +// CHECK: internal global [26 x i8] c"v32@0:8{?=}16*16{?=}24d24 + diff --git a/test/CodeGenObjC/encode-test.m b/test/CodeGenObjC/encode-test.m index 02af5daa2265..3780068e6178 100644 --- a/test/CodeGenObjC/encode-test.m +++ b/test/CodeGenObjC/encode-test.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple i686-apple-darwin9 -fobjc-fragile-abi -emit-llvm -o %t %s +// RUN: %clang_cc1 -triple i686-apple-darwin9 -fobjc-runtime=macosx-fragile-10.5 -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.m b/test/CodeGenObjC/exceptions.m index 24fb6575e440..25780fd518fe 100644 --- a/test/CodeGenObjC/exceptions.m +++ b/test/CodeGenObjC/exceptions.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-fragile-abi -emit-llvm -fexceptions -fobjc-exceptions -O2 -o - %s | FileCheck %s +// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-runtime=macosx-fragile-10.5 -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/fp2ret.m b/test/CodeGenObjC/fp2ret.m index 9c956aec9b3f..2e65332ec974 100644 --- a/test/CodeGenObjC/fp2ret.m +++ b/test/CodeGenObjC/fp2ret.m @@ -1,10 +1,10 @@ -// RUN: %clang_cc1 -triple i386-apple-darwin9 -fobjc-fragile-abi -emit-llvm -o - %s | \ +// RUN: %clang_cc1 -triple i386-apple-darwin9 -fobjc-runtime=macosx-fragile-10.5 -emit-llvm -o - %s | \ // RUN: FileCheck --check-prefix=CHECK-X86_32 %s // -// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-fragile-abi -emit-llvm -o - %s | \ +// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-runtime=macosx-fragile-10.5 -emit-llvm -o - %s | \ // RUN: FileCheck --check-prefix=CHECK-X86_64 %s // -// RUN: %clang_cc1 -triple armv7-apple-darwin10 -fobjc-fragile-abi -emit-llvm -target-abi apcs-gnu -o - %s | \ +// RUN: %clang_cc1 -triple armv7-apple-darwin10 -fobjc-runtime=macosx-fragile-10.5 -emit-llvm -target-abi apcs-gnu -o - %s | \ // RUN: FileCheck --check-prefix=CHECK-ARMV7 %s @interface A diff --git a/test/CodeGenObjC/fpret.m b/test/CodeGenObjC/fpret.m index bf111e001d04..cabef108df48 100644 --- a/test/CodeGenObjC/fpret.m +++ b/test/CodeGenObjC/fpret.m @@ -1,10 +1,10 @@ -// RUN: %clang_cc1 -triple i386-apple-darwin9 -fobjc-fragile-abi -emit-llvm -o - %s | \ +// RUN: %clang_cc1 -triple i386-apple-darwin9 -fobjc-runtime=macosx-fragile-10.5 -emit-llvm -o - %s | \ // RUN: FileCheck --check-prefix=CHECK-X86_32 %s // -// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-fragile-abi -emit-llvm -o - %s | \ +// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-runtime=macosx-fragile-10.5 -emit-llvm -o - %s | \ // RUN: FileCheck --check-prefix=CHECK-X86_64 %s // -// RUN: %clang_cc1 -triple armv7-apple-darwin10 -fobjc-fragile-abi -emit-llvm -target-abi apcs-gnu -o - %s | \ +// RUN: %clang_cc1 -triple armv7-apple-darwin10 -fobjc-runtime=macosx-fragile-10.5 -emit-llvm -target-abi apcs-gnu -o - %s | \ // RUN: FileCheck --check-prefix=CHECK-ARMV7 %s @interface A diff --git a/test/CodeGenObjC/getter-property-mismatch.m b/test/CodeGenObjC/getter-property-mismatch.m new file mode 100644 index 000000000000..21ed6eea68e8 --- /dev/null +++ b/test/CodeGenObjC/getter-property-mismatch.m @@ -0,0 +1,20 @@ +// RUN: %clang_cc1 %s -emit-llvm -triple x86_64-apple-darwin -o - | FileCheck %s +// rdar://11323676 + +@interface NSDictionary @end +@interface NSMutableDictionary : NSDictionary@end@interface CalDAVAddManagedAttachmentsTaskGroup { + NSMutableDictionary *_filenamesToServerLocation; +} +- (NSDictionary *)filenamesToServerLocation; +@property (readwrite, retain) NSMutableDictionary *filenamesToServerLocation; +@end + +@implementation CalDAVAddManagedAttachmentsTaskGroup +@synthesize filenamesToServerLocation=_filenamesToServerLocation; +@end + +// CHECK: [[CALL:%.*]] = call i8* @objc_getProperty +// CHECK: [[ONE:%.*]] = bitcast i8* [[CALL:%.*]] to [[T1:%.*]]* +// CHECK: [[TWO:%.*]] = bitcast [[T1]]* [[ONE]] to [[T2:%.*]]* +// CHECK: ret [[T2]]* [[TWO]] + diff --git a/test/CodeGenObjC/getter-property-type-mismatch.m b/test/CodeGenObjC/getter-property-type-mismatch.m new file mode 100644 index 000000000000..c7e1c1a96a42 --- /dev/null +++ b/test/CodeGenObjC/getter-property-type-mismatch.m @@ -0,0 +1,35 @@ +// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -o - %s | FileCheck %s +// rdar://11515196 + +@interface NSArray @end + +@interface NSMutableArray : NSArray +- (void) addObject; +@end + +@interface BPXLAppDelegate + +- (NSArray *)arrayOfThings; + +@end + + +@interface BPXLAppDelegate () +@property (retain, nonatomic) NSMutableArray *arrayOfThings; +@end + +@implementation BPXLAppDelegate + +@synthesize arrayOfThings=_arrayOfThings; + +- (void)applicationDidFinishLaunching +{ + [self.arrayOfThings addObject]; +} + +@end + +// CHECK: define internal [[RET:%.*]]* @"\01-[BPXLAppDelegate arrayOfThings +// CHECK: [[THREE:%.*]] = bitcast [[OPQ:%.*]]* [[TWO:%.*]] to [[RET]]* +// CHECK: ret [[RET]]* [[THREE]] + diff --git a/test/CodeGenObjC/gnu-exceptions.m b/test/CodeGenObjC/gnu-exceptions.m index 8917bf3120da..141747ec8d3d 100644 --- a/test/CodeGenObjC/gnu-exceptions.m +++ b/test/CodeGenObjC/gnu-exceptions.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -emit-llvm -fexceptions -fobjc-exceptions -fgnu-runtime -o - %s | FileCheck %s +// RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -emit-llvm -fexceptions -fobjc-exceptions -fobjc-runtime=gcc -o - %s | FileCheck %s void opaque(void); void log(int i); diff --git a/test/CodeGenObjC/id-isa-codegen.m b/test/CodeGenObjC/id-isa-codegen.m index 8cac750773c4..8717ce2d0abb 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 -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 +// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-runtime=macosx-fragile-10.5 -emit-llvm -o - %s | FileCheck -check-prefix LP64 %s +// RUN: %clang_cc1 -triple i386-apple-darwin9 -fobjc-runtime=macosx-fragile-10.5 -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 613b272bdea2..030bcaed1a38 100644 --- a/test/CodeGenObjC/image-info.m +++ b/test/CodeGenObjC/image-info.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple i386-apple-darwin9 -fobjc-fragile-abi -emit-llvm -o %t %s +// RUN: %clang_cc1 -triple i386-apple-darwin9 -fobjc-runtime=macosx-fragile-10.5 -emit-llvm -o %t %s // RUN: FileCheck --check-prefix CHECK-FRAGILE < %t %s // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -o %t %s diff --git a/test/CodeGenObjC/implicit-objc_msgSend.m b/test/CodeGenObjC/implicit-objc_msgSend.m index aff0fe45a009..6fc3d46d50d9 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 -fobjc-fragile-abi -emit-llvm -o %t %s +// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -fobjc-runtime=macosx-fragile-10.5 -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/interface-layout-64.m b/test/CodeGenObjC/interface-layout-64.m index 4fdda4559d14..16361a21b67e 100644 --- a/test/CodeGenObjC/interface-layout-64.m +++ b/test/CodeGenObjC/interface-layout-64.m @@ -1,33 +1,32 @@ -// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -o %t %s +// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -o - %s | FileCheck %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 -// RUN: grep '@"OBJC_IVAR_$_I3._iv3" = global i64 12, section "__DATA, __objc_ivar", align 8' %t -// RUN: grep '@"OBJC_IVAR_$_I4._iv4" = global i64 13, section "__DATA, __objc_ivar", align 8' %t -// RUN: grep '@"OBJC_IVAR_$_I5._iv5" = global i64 14, section "__DATA, __objc_ivar", align 8' %t -// RUN: grep '@"OBJC_IVAR_$_I5._iv6_synth" = hidden global i64 16, section "__DATA, __objc_ivar", align 8' %t -// RUN: grep '@"OBJC_IVAR_$_I5._iv7_synth" = hidden global i64 20, section "__DATA, __objc_ivar", align 8' %t -// RUN: grep '@"OBJC_IVAR_$_I6.iv0" = global i64 0, section "__DATA, __objc_ivar", align 8' %t -// RUN: grep '@"OBJC_IVAR_$_I8.b" = global i64 8, section "__DATA, __objc_ivar", align 8' %t -// RUN: grep '@"OBJC_IVAR_$_I9.iv0" = global i64 0, section "__DATA, __objc_ivar", align 8' %t -// RUN: grep '@"OBJC_IVAR_$_I10.iv1" = global i64 4, section "__DATA, __objc_ivar", align 8' %t -// RUN: grep '@"OBJC_IVAR_$_I12.iv2" = global i64 8, section "__DATA, __objc_ivar", align 8' %t -// RUN: grep '_OBJC_CLASS_RO_$_I3" = internal global .* { i32 0, i32 8, i32 13, .*' %t -// RUN: grep '_OBJC_CLASS_RO_$_I4" = internal global .* { i32 0, i32 13, i32 14, .*' %t -// RUN: grep '_OBJC_CLASS_RO_$_I5" = internal global .* { i32 0, i32 14, i32 24, .*' %t -// RUN: grep '_OBJC_CLASS_RO_$_I6" = internal global .* { i32 2, i32 0, i32 1, .*' %t -// RUN: grep '_OBJC_CLASS_RO_$_I8" = internal global .* { i32 0, i32 8, i32 16, .*' %t -// RUN: grep '_OBJC_CLASS_RO_$_I9" = internal global .* { i32 2, i32 0, i32 4, .*' %t -// RUN: grep '_OBJC_CLASS_RO_$_I10" = internal global .* { i32 0, i32 4, i32 5, .*' %t -// RUN: grep '_OBJC_CLASS_RO_$_I11" = internal global .* { i32 0, i32 5, i32 5, .*' %t -// RUN: grep '_OBJC_CLASS_RO_$_I12" = internal global .* { i32 0, i32 8, i32 12, .*' %t - +// CHECK: @"OBJC_IVAR_$_I3._iv2" = global i64 8, section "__DATA, __objc_ivar", align 8 +// CHECK: @"OBJC_IVAR_$_I3._iv3" = global i64 12, section "__DATA, __objc_ivar", align 8 +// CHECK: _OBJC_CLASS_RO_$_I3" = internal global {{.*}} { i32 0, i32 8, i32 13 +// CHECK: @"OBJC_IVAR_$_I4._iv4" = global i64 13, section "__DATA, __objc_ivar", align 8 +// CHECK: _OBJC_CLASS_RO_$_I4" = internal global {{.*}} { i32 0, i32 13, i32 14, {{.*}} +// CHECK: @"OBJC_IVAR_$_I5._iv6_synth" = hidden global i64 16, section "__DATA, __objc_ivar", align 8 +// CHECK: @"OBJC_IVAR_$_I5._iv7_synth" = hidden global i64 20, section "__DATA, __objc_ivar", align 8 +// CHECK: @"OBJC_IVAR_$_I5._iv5" = global i64 14, section "__DATA, __objc_ivar", align 8 +// CHECK: _OBJC_CLASS_RO_$_I5" = internal global {{.*}} { i32 0, i32 14, i32 24, {{.*}} +// CHECK: @"OBJC_IVAR_$_I6.iv0" = global i64 0, section "__DATA, __objc_ivar", align 8 +// CHECK: _OBJC_CLASS_RO_$_I6" = internal global {{.*}} { i32 2, i32 0, i32 1, {{.*}} +// CHECK: @"OBJC_IVAR_$_I8.b" = global i64 8, section "__DATA, __objc_ivar", align 8 +// CHECK: _OBJC_CLASS_RO_$_I8" = internal global {{.*}} { i32 0, i32 8, i32 16, {{.*}} +// CHECK: @"OBJC_IVAR_$_I9.iv0" = global i64 0, section "__DATA, __objc_ivar", align 8 +// CHECK: _OBJC_CLASS_RO_$_I9" = internal global {{.*}} { i32 2, i32 0, i32 4, {{.*}} +// CHECK: @"OBJC_IVAR_$_I10.iv1" = global i64 4, section "__DATA, __objc_ivar", align 8 +// CHECK: _OBJC_CLASS_RO_$_I10" = internal global {{.*}} { i32 0, i32 4, i32 5, {{.*}} +// CHECK: _OBJC_CLASS_RO_$_I11" = internal global {{.*}} { i32 0, i32 5, i32 5, {{.*}} +// CHECK: @"OBJC_IVAR_$_I12.iv2" = global i64 8, section "__DATA, __objc_ivar", align 8 +// CHECK: _OBJC_CLASS_RO_$_I12" = internal global {{.*}} { i32 0, i32 8, i32 12, {{.*}} /* Compare to: - gcc -m64 -S -o - interface-layout-64.m | grep '^_OBJC_IVAR_$_*.*' -A 1 + gcc -m64 -S -o - interface-layout-64.m | grep '^_OBJC_IVAR_$_*{{.*}}' -A 1 and - gcc -m64 -S -o - interface-layout-64.m | grep '^l.*_CLASS_RO_$_I[0-9]*' -A 3 + gcc -m64 -S -o - interface-layout-64.m | grep '^l{{.*}}_CLASS_RO_$_I[0-9]*' -A 3 */ struct s0 { diff --git a/test/CodeGenObjC/interface.m b/test/CodeGenObjC/interface.m index 0ca64ecd3ffc..4adc926141b2 100644 --- a/test/CodeGenObjC/interface.m +++ b/test/CodeGenObjC/interface.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple i386-apple-darwin9 -fobjc-fragile-abi -O3 -emit-llvm -o %t %s +// RUN: %clang_cc1 -triple i386-apple-darwin9 -fobjc-runtime=macosx-fragile-10.5 -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 acc734a575de..f2f05931d913 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-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 +// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -fobjc-runtime=macosx-fragile-10.5 -fobjc-gc -emit-llvm -o %t %s +// RUN: %clang_cc1 -x objective-c++ -triple x86_64-apple-darwin9 -fobjc-runtime=macosx-fragile-10.5 -fobjc-gc -emit-llvm -o %t %s #ifdef __cplusplus typedef bool _Bool; diff --git a/test/CodeGenObjC/ivar-layout-array0-struct.m b/test/CodeGenObjC/ivar-layout-array0-struct.m index 7ef32f634237..267f947f42b6 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 -fobjc-fragile-abi -O0 -S %s -o %t-64.s +// RUN: %clang_cc1 -fobjc-gc -triple x86_64-apple-darwin -fobjc-runtime=macosx-fragile-10.5 -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 85bba8abaaa9..46a7034a2249 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 -fobjc-fragile-abi -O0 -S %s -o %t-64.s +// RUN: %clang_cc1 -fobjc-gc -triple x86_64-apple-darwin -fobjc-runtime=macosx-fragile-10.5 -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 -fobjc-fragile-abi -O0 -S %s -o %t-64.s +// RUN: %clang_cc1 -x objective-c++ -fobjc-gc -triple x86_64-apple-darwin -fobjc-runtime=macosx-fragile-10.5 -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/ivars.m b/test/CodeGenObjC/ivars.m index 6c8a72d0f100..1ccfa36345c5 100644 --- a/test/CodeGenObjC/ivars.m +++ b/test/CodeGenObjC/ivars.m @@ -1,5 +1,5 @@ -// 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 -triple x86_64-apple-darwin9 -fobjc-runtime=macosx-fragile-10.5 -emit-llvm -o - %s +// RUN: %clang_cc1 -triple i386-apple-darwin9 -fobjc-runtime=macosx-fragile-10.5 -emit-llvm -o - %s // RUN: %clang_cc1 -fobjc-gc -emit-llvm -o - %s // rdar://6800926 diff --git a/test/CodeGenObjC/layout-bitfield-crash.m b/test/CodeGenObjC/layout-bitfield-crash.m new file mode 100644 index 000000000000..5d0e7bfd2e7f --- /dev/null +++ b/test/CodeGenObjC/layout-bitfield-crash.m @@ -0,0 +1,35 @@ +// RUN: %clang_cc1 -triple x86_64-apple-darwin11 -fobjc-gc -emit-llvm -g -o - %s +// Check that this doesn't crash when compiled with debugging on. +@class Foo; +typedef struct Bar *BarRef; + +@interface Baz +@end + +@interface Foo +- (void) setFlag; +@end + +@implementation Baz + +- (void) a:(BarRef)b +{ + Foo* view = (Foo*)self; + [view setFlag]; +} + +@end + + +@implementation Foo +{ + int flag : 1; +} + +- (void) setFlag +{ + if (!flag) + flag = 1; +} + +@end diff --git a/test/CodeGenObjC/link-errors.m b/test/CodeGenObjC/link-errors.m index 0d19681ec109..f2d9ddba883b 100644 --- a/test/CodeGenObjC/link-errors.m +++ b/test/CodeGenObjC/link-errors.m @@ -1,8 +1,8 @@ -// RUN: %clang_cc1 -triple i386-apple-darwin9 -fobjc-fragile-abi -emit-llvm -o %t %s +// RUN: %clang_cc1 -triple i386-apple-darwin9 -fobjc-runtime=macosx-fragile-10.5 -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 -fobjc-fragile-abi -DWITH_IMPL -emit-llvm -o %t %s +// RUN: %clang_cc1 -triple i386-apple-darwin9 -fobjc-runtime=macosx-fragile-10.5 -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 7a7b6f6e087b..deea8bac13ea 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 -fobjc-fragile-abi -emit-llvm %s -o %t-64.ll +// RUN: %clang_cc1 -fblocks -triple x86_64-apple-darwin -fobjc-runtime=macosx-fragile-10.5 -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 7c9d81cc9d71..ce6624ad5a0a 100644 --- a/test/CodeGenObjC/messages-2.m +++ b/test/CodeGenObjC/messages-2.m @@ -1,4 +1,4 @@ -// 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 -fobjc-runtime=macosx-fragile-10.5 -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 6f39602d9c96..a42677ef7849 100644 --- a/test/CodeGenObjC/messages.m +++ b/test/CodeGenObjC/messages.m @@ -1,7 +1,7 @@ -// RUN: %clang_cc1 -fobjc-fragile-abi -emit-llvm -o - %s | FileCheck %s -check-prefix=CHECK-MAC +// RUN: %clang_cc1 -fobjc-runtime=macosx-fragile-10.5 -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 +// RUN: %clang_cc1 -fobjc-runtime=gcc -emit-llvm -o - %s | FileCheck %s -check-prefix=CHECK-GNU +// RUN: %clang_cc1 -fobjc-runtime=gnustep -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 a7bcf01926b2..1df1560d8fcc 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 -fobjc-fragile-abi -emit-llvm -o %t %s +// RUN: %clang_cc1 -triple i386-apple-darwin9 -fobjc-runtime=macosx-fragile-10.5 -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/misc-atomic-property.m b/test/CodeGenObjC/misc-atomic-property.m index f2645dcaef84..4c8cc669705d 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 -emit-llvm -o - %s | FileCheck %s -// RUN: %clang_cc1 -triple i386-apple-darwin9 -fobjc-fragile-abi -emit-llvm -o - %s | FileCheck %s +// RUN: %clang_cc1 -triple i386-apple-darwin9 -fobjc-runtime=macosx-fragile-10.5 -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 f7a13fd8dcf2..773fdbc96854 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 -o - %s | FileCheck %s -// RUN: %clang_cc1 -triple i386-apple-darwin10 -fobjc-fragile-abi -emit-llvm -o - %s | FileCheck %s +// RUN: %clang_cc1 -triple i386-apple-darwin10 -fobjc-runtime=macosx-fragile-10.5 -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 5576c1640d18..bff52c3b2494 100644 --- a/test/CodeGenObjC/nested-rethrow.m +++ b/test/CodeGenObjC/nested-rethrow.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple i386-apple-darwin9 -fobjc-fragile-abi -emit-llvm -fobjc-exceptions %s -o - | FileCheck %s +// RUN: %clang_cc1 -triple i386-apple-darwin9 -fobjc-runtime=macosx-fragile-10.5 -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 4288b2da0cb2..6afd658e03a7 100644 --- a/test/CodeGenObjC/next-objc-dispatch.m +++ b/test/CodeGenObjC/next-objc-dispatch.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -fobjc-fragile-abi -emit-llvm -o - %s \ +// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -fobjc-runtime=macosx-fragile-10.5 -emit-llvm -o - %s \ // RUN: -fobjc-dispatch-method=legacy | \ // RUN: FileCheck -check-prefix CHECK-FRAGILE_LEGACY %s // diff --git a/test/CodeGenObjC/no-category-class.m b/test/CodeGenObjC/no-category-class.m index 3969f917e2f3..0c672f7894a6 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 -fobjc-fragile-abi -emit-llvm -o %t %s +// RUN: %clang_cc1 -triple x86_64-unknown-unknown -fobjc-runtime=macosx-fragile-10.5 -emit-llvm -o %t %s @interface NSObject @end diff --git a/test/CodeGenObjC/nonlazy-msgSend.m b/test/CodeGenObjC/nonlazy-msgSend.m index 73157c77c030..7c349b293807 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 -fobjc-fragile-abi -emit-llvm -o %t %s +// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -fobjc-runtime=macosx-fragile-10.5 -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 d04793c8c239..ccaacaf53e76 100644 --- a/test/CodeGenObjC/ns-constant-strings.m +++ b/test/CodeGenObjC/ns-constant-strings.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple i386-apple-darwin9 -fobjc-fragile-abi -fno-constant-cfstrings -emit-llvm -o %t %s +// RUN: %clang_cc1 -triple i386-apple-darwin9 -fobjc-runtime=macosx-fragile-10.5 -fno-constant-cfstrings -emit-llvm -o %t %s // RUN: FileCheck --check-prefix CHECK-FRAGILE < %t %s // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fno-constant-cfstrings -emit-llvm -o %t %s diff --git a/test/CodeGenObjC/objc-align.m b/test/CodeGenObjC/objc-align.m index f3c586eeb214..324740c8aefc 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 -fobjc-fragile-abi -emit-llvm -o %t %s +// RUN: %clang_cc1 -triple i386-apple-darwin9 -fobjc-runtime=macosx-fragile-10.5 -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 d0a1a0fceefe..0dc9ec292d71 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-fragile-abi -fobjc-gc -emit-llvm -o %t %s +// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-runtime=macosx-fragile-10.5 -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 dfdf02e2a5a6..6c2baac0504b 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-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 +// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-runtime=macosx-fragile-10.5 -fobjc-gc -emit-llvm -o - %s | FileCheck -check-prefix C %s +// RUN: %clang_cc1 -x objective-c++ -triple x86_64-apple-darwin10 -fobjc-runtime=macosx-fragile-10.5 -fobjc-gc -emit-llvm -o - %s | FileCheck -check-prefix CP %s static int count; diff --git a/test/CodeGenObjC/objc-literal-debugger-test.m b/test/CodeGenObjC/objc-literal-debugger-test.m index 389ef2248a48..5f69fd5ba889 100644 --- a/test/CodeGenObjC/objc-literal-debugger-test.m +++ b/test/CodeGenObjC/objc-literal-debugger-test.m @@ -1,7 +1,29 @@ // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fdebugger-objc-literal -emit-llvm -o - %s | FileCheck %s +// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fdebugger-objc-literal -emit-llvm -o - %s -DINCLUDE_INTERFACES=1 | FileCheck %s + +// We need two different RUN lines here because the first time a class/method is absent, +// it will be added for -fdebugger-objc-literal. + +#ifdef INCLUDE_INTERFACES +@interface NSObject +@end + +@interface NSNumber : NSObject +@end + +@interface NSArray : NSObject +@end + +@interface NSDictionary : NSObject +@end + +@interface NSString : NSObject +@end +#endif int main() { - id l = @'a'; + // object literals. + id l; l = @'a'; l = @42; l = @-42; @@ -11,6 +33,21 @@ int main() { l = @__objc_no; l = @{ @"name":@666 }; l = @[ @"foo", @"bar" ]; + +#if __has_feature(objc_boxed_expressions) + // boxed expressions. + id b; + b = @('a'); + b = @(42); + b = @(-42); + b = @(42u); + b = @(3.141592654f); + b = @(__objc_yes); + b = @(__objc_no); + b = @("hello"); +#else +#error "boxed expressions not supported" +#endif } // CHECK: declare i8* @objc_msgSend(i8*, i8*, ...) nonlazybind diff --git a/test/CodeGenObjC/objc-read-weak-byref.m b/test/CodeGenObjC/objc-read-weak-byref.m index 8fe1436567b1..94eca2899d9b 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 -fobjc-fragile-abi -S %s -o %t-64.s +// RUN: %clang_cc1 -fblocks -fobjc-gc -triple x86_64-apple-darwin -fobjc-runtime=macosx-fragile-10.5 -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 -fobjc-fragile-abi -S %s -o %t-32.s +// RUN: %clang_cc1 -fblocks -fobjc-gc -triple i386-apple-darwin -fobjc-runtime=macosx-fragile-10.5 -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 36c95f792dae..147aa3d3e3f2 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-fragile-abi -fobjc-gc -emit-llvm -o %t %s +// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-runtime=macosx-fragile-10.5 -fobjc-gc -emit-llvm -o %t %s // RUN: grep -F '@objc_assign_global' %t | count 26 @class NSObject; diff --git a/test/CodeGenObjC/objc2-new-gc-api-strongcast.m b/test/CodeGenObjC/objc2-new-gc-api-strongcast.m index 1044ba529857..5619ab3d3d49 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 -fobjc-fragile-abi -fblocks -fobjc-gc -emit-llvm -o %t %s +// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-runtime=macosx-fragile-10.5 -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 -fobjc-fragile-abi -fblocks -fobjc-gc -emit-llvm -o %t %s +// RUN: %clang_cc1 -x objective-c++ -triple x86_64-apple-darwin10 -fobjc-runtime=macosx-fragile-10.5 -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 d439368cc608..ece6b9d582b7 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-fragile-abi -fobjc-gc -emit-llvm -o %t %s +// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -fobjc-runtime=macosx-fragile-10.5 -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-fragile-abi -fobjc-gc -emit-llvm -o %t %s +// RUN: %clang_cc1 -x objective-c++ -triple x86_64-apple-darwin9 -fobjc-runtime=macosx-fragile-10.5 -fobjc-gc -emit-llvm -o %t %s // RUN: grep 'objc_assign' %t | count 0 typedef struct { diff --git a/test/CodeGenObjC/objc2-retain-codegen.m b/test/CodeGenObjC/objc2-retain-codegen.m index d5b473e33473..594e3dfcd06b 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-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 +// RUN: %clang_cc1 -triple x86_64-unknown-unknown -fobjc-runtime=macosx-fragile-10.5 -fobjc-gc-only -emit-llvm -o %t %s +// RUN: %clang_cc1 -x objective-c++ -triple x86_64-unknown-unknown -fobjc-runtime=macosx-fragile-10.5 -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 9bb750fd0523..4417084ebb9f 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-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 +// RUN: %clang_cc1 -triple x86_64-unknown-unknown -fobjc-runtime=macosx-fragile-10.5 -fobjc-gc -emit-llvm -o %t %s +// RUN: %clang_cc1 -x objective-c++ -triple x86_64-unknown-unknown -fobjc-runtime=macosx-fragile-10.5 -fobjc-gc -emit-llvm -o %t %s @interface I { __attribute__((objc_gc(strong))) int *i_IdocumentIDs; diff --git a/test/CodeGenObjC/objc2-weak-assign.m b/test/CodeGenObjC/objc2-weak-assign.m index e5c67c58d64a..13ce3386c034 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-fragile-abi -fobjc-gc -emit-llvm -o %t %s +// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -fobjc-runtime=macosx-fragile-10.5 -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-fragile-abi -fobjc-gc -emit-llvm -o %t %s +// RUN: %clang_cc1 -x objective-c++ -triple x86_64-apple-darwin9 -fobjc-runtime=macosx-fragile-10.5 -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 94c54e7f3ba2..25434947d104 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 -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 +// RUN: %clang_cc1 -fblocks -fobjc-gc -triple x86_64-apple-darwin -fobjc-runtime=macosx-fragile-10.5 -emit-llvm %s -o - | FileCheck -check-prefix LP64 %s +// RUN: %clang_cc1 -fblocks -fobjc-gc -triple i386-apple-darwin -fobjc-runtime=macosx-fragile-10.5 -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 75cf689737b4..d8d5459aee23 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-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 +// RUN: %clang_cc1 -triple i386-apple-darwin9 -fobjc-runtime=macosx-fragile-10.5 -fobjc-gc -emit-llvm -o %t %s +// RUN: %clang_cc1 -x objective-c++ -triple i386-apple-darwin9 -fobjc-runtime=macosx-fragile-10.5 -fobjc-gc -emit-llvm -o %t %s @interface PBXTarget { diff --git a/test/CodeGenObjC/objc2-weak-ivar-debug.m b/test/CodeGenObjC/objc2-weak-ivar-debug.m index 83262a82a61b..8c323b75213e 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-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 +// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -fobjc-runtime=macosx-fragile-10.5 -fobjc-gc -g -emit-llvm -o - %s +// RUN: %clang_cc1 -triple i386-apple-darwin9 -fobjc-runtime=macosx-fragile-10.5 -fobjc-gc -g -emit-llvm -o - %s +// RUN: %clang_cc1 -x objective-c++ -triple x86_64-apple-darwin9 -fobjc-runtime=macosx-fragile-10.5 -fobjc-gc -g -emit-llvm -o - %s +// RUN: %clang_cc1 -x objective-c++ -triple i386-apple-darwin9 -fobjc-runtime=macosx-fragile-10.5 -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 78ccdf8876cc..0c8503ed2ee4 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-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 +// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -fobjc-runtime=macosx-fragile-10.5 -fobjc-gc -emit-llvm -o %t %s +// RUN: %clang_cc1 -x objective-c++ -triple x86_64-apple-darwin9 -fobjc-runtime=macosx-fragile-10.5 -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 eae2551aa074..6bc2f509083b 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-fragile-abi -fobjc-gc -emit-llvm -o %t %s +// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-runtime=macosx-fragile-10.5 -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-fragile-abi -fobjc-gc -emit-llvm -o %t %s +// RUN: %clang_cc1 -x objective-c++ -triple x86_64-apple-darwin10 -fobjc-runtime=macosx-fragile-10.5 -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-4.m b/test/CodeGenObjC/objc2-write-barrier-4.m index 4089920b0925..d01ed1934b39 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-fragile-abi -fobjc-gc -emit-llvm -o %t %s +// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-runtime=macosx-fragile-10.5 -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-fragile-abi -fobjc-gc -emit-llvm -o %t %s +// RUN: %clang_cc1 -x objective-c++ -triple x86_64-apple-darwin10 -fobjc-runtime=macosx-fragile-10.5 -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 122fa9f3c0b7..65a71a5a1d35 100644 --- a/test/CodeGenObjC/objc2-write-barrier-5.m +++ b/test/CodeGenObjC/objc2-write-barrier-5.m @@ -1,7 +1,7 @@ -// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-fragile-abi -fobjc-gc -emit-llvm -o %t %s +// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-runtime=macosx-fragile-10.5 -fobjc-gc -emit-llvm -o %t %s // RUN: grep objc_assign_ivar %t | count 0 // 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: %clang_cc1 -x objective-c++ -triple x86_64-apple-darwin10 -fobjc-runtime=macosx-fragile-10.5 -fobjc-gc -emit-llvm -o %t %s // RUN: grep objc_assign_ivar %t | count 0 // RUN: grep objc_assign_strongCast %t | count 8 diff --git a/test/CodeGenObjC/objc2-write-barrier.m b/test/CodeGenObjC/objc2-write-barrier.m index bf2dfb9b14f9..7634dc97412a 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-fragile-abi -fobjc-gc -emit-llvm -o %t %s +// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-runtime=macosx-fragile-10.5 -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-fragile-abi -fobjc-gc -emit-llvm -o %t %s +// RUN: %clang_cc1 -x objective-c++ -triple x86_64-apple-darwin10 -fobjc-runtime=macosx-fragile-10.5 -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 19c12cb315a2..c1181a21c720 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 -fobjc-fragile-abi -emit-llvm %s -o %t +// RUN: %clang_cc1 -triple i386-apple-darwin9 -fobjc-runtime=macosx-fragile-10.5 -emit-llvm %s -o %t @interface Foo { diff --git a/test/CodeGenObjC/objfw.m b/test/CodeGenObjC/objfw.m new file mode 100644 index 000000000000..98e3fb02652d --- /dev/null +++ b/test/CodeGenObjC/objfw.m @@ -0,0 +1,15 @@ +// RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -fobjc-runtime=objfw -emit-llvm -o - %s | FileCheck %s + +// Test the ObjFW runtime. + +@interface Test0 ++ (void) test; +@end +void test0(void) { + [Test0 test]; +} +// CHECK: define void @test0() +// CHECK: [[T0:%.*]] = call i8* (i8*, i8*, ...)* (i8*, i8*)* @objc_msg_lookup(i8* bitcast (i64* @_OBJC_CLASS_Test0 to i8*), +// CHECK-NEXT: [[T1:%.*]] = bitcast i8* (i8*, i8*, ...)* [[T0]] to void (i8*, i8*)* +// CHECK-NEXT: call void [[T1]](i8* bitcast (i64* @_OBJC_CLASS_Test0 to i8*), +// CHECK-NEXT: ret void diff --git a/test/CodeGenObjC/predefined-expr.m b/test/CodeGenObjC/predefined-expr.m index 009bbcdb013c..d5866bbdbed5 100644 --- a/test/CodeGenObjC/predefined-expr.m +++ b/test/CodeGenObjC/predefined-expr.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple i386-apple-darwin9 -fobjc-fragile-abi %s -emit-llvm -o - | FileCheck %s +// RUN: %clang_cc1 -triple i386-apple-darwin9 -fobjc-runtime=macosx-fragile-10.5 %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-complex.m b/test/CodeGenObjC/property-complex.m index 3cdd2ecfd15d..027f6d632686 100644 --- a/test/CodeGenObjC/property-complex.m +++ b/test/CodeGenObjC/property-complex.m @@ -1,5 +1,5 @@ -// 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 +// RUN: %clang_cc1 -triple i386-apple-darwin9 -fobjc-runtime=macosx-fragile-10.5 -emit-llvm -o %t %s +// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -fobjc-runtime=macosx-fragile-10.5 -emit-llvm -o %t %s @interface I0 { @public diff --git a/test/CodeGenObjC/property-ref-cast-to-void.m b/test/CodeGenObjC/property-ref-cast-to-void.m index ad1689fd6243..ae2a4583629b 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 -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 +// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -fobjc-runtime=macosx-fragile-10.5 -emit-llvm -o - %s | FileCheck %s +// RUN: %clang_cc1 -x objective-c++ -triple x86_64-apple-darwin9 -fobjc-runtime=macosx-fragile-10.5 -emit-llvm -o - %s | FileCheck %s // rdar: // 8399655 @interface TestClass diff --git a/test/CodeGenObjC/protocol-in-extended-class.m b/test/CodeGenObjC/protocol-in-extended-class.m index a92408463deb..b919d5fd234a 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 -S %s -o %t-64.s // RUN: FileCheck -check-prefix LP64 --input-file=%t-64.s %s -// RUN: %clang_cc1 -triple i386-apple-darwin -fobjc-fragile-abi -S %s -o %t-32.s +// RUN: %clang_cc1 -triple i386-apple-darwin -fobjc-runtime=macosx-fragile-10.5 -S %s -o %t-32.s // RUN: FileCheck -check-prefix LP32 --input-file=%t-32.s %s @protocol MyProtocol diff --git a/test/CodeGenObjC/protocols-lazy.m b/test/CodeGenObjC/protocols-lazy.m index 1c551fbeec11..877d4923f387 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 -fobjc-fragile-abi -o %t %s +// RUN: %clang_cc1 -emit-llvm -triple i686-apple-darwin8 -fobjc-runtime=macosx-fragile-10.5 -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 a93ca033c13c..fb808b3b771b 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 -fobjc-fragile-abi -emit-llvm -fobjc-exceptions %s -o - +// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -fobjc-runtime=macosx-fragile-10.5 -emit-llvm -fobjc-exceptions %s -o - void f0(id x) { @synchronized (x) { diff --git a/test/CodeGenObjC/super-message-fragileabi.m b/test/CodeGenObjC/super-message-fragileabi.m index 0135919b8946..b6c908624ef6 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 -fobjc-fragile-abi -emit-llvm %s -o - | FileCheck %s +// RUN: %clang_cc1 -triple i386-apple-darwin9 -fobjc-runtime=macosx-fragile-10.5 -emit-llvm %s -o - | FileCheck %s @class Some; diff --git a/test/CodeGenObjC/synchronized.m b/test/CodeGenObjC/synchronized.m index 4997bb77525e..1f012820f9ba 100644 --- a/test/CodeGenObjC/synchronized.m +++ b/test/CodeGenObjC/synchronized.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -emit-llvm -triple i686-apple-darwin9 -fobjc-fragile-abi -o - %s -O2 | FileCheck %s +// RUN: %clang_cc1 -emit-llvm -triple i686-apple-darwin9 -fobjc-runtime=macosx-fragile-10.5 -o - %s -O2 | FileCheck %s @interface MyClass { diff --git a/test/CodeGenObjC/terminate.m b/test/CodeGenObjC/terminate.m index a86205839d45..8728ec4598bf 100644 --- a/test/CodeGenObjC/terminate.m +++ b/test/CodeGenObjC/terminate.m @@ -1,5 +1,5 @@ -// 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 +// RUN: %clang_cc1 -triple x86_64-apple-darwin -fobjc-runtime=macosx-fragile-10.8 -emit-llvm -fexceptions -fobjc-exceptions -o - %s | FileCheck %s -check-prefix=CHECK-WITH +// RUN: %clang_cc1 -triple x86_64-apple-darwin -fobjc-runtime=macosx-fragile-10.7 -emit-llvm -fexceptions -fobjc-exceptions -o - %s | FileCheck %s -check-prefix=CHECK-WITHOUT void destroy(void**); diff --git a/test/CodeGenObjC/undefined-protocol.m b/test/CodeGenObjC/undefined-protocol.m index d87a5c999ee9..e5a72ab602f0 100644 --- a/test/CodeGenObjC/undefined-protocol.m +++ b/test/CodeGenObjC/undefined-protocol.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -emit-llvm-only -fgnu-runtime %s +// RUN: %clang_cc1 -emit-llvm-only -fobjc-runtime=gcc %s @protocol MadeUpProtocol; diff --git a/test/CodeGenObjC/variadic-sends.m b/test/CodeGenObjC/variadic-sends.m index 94d7bafba472..726b497b21b4 100644 --- a/test/CodeGenObjC/variadic-sends.m +++ b/test/CodeGenObjC/variadic-sends.m @@ -1,5 +1,5 @@ -// 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 +// RUN: %clang_cc1 -triple i386-unknown-unknown -fobjc-runtime=macosx-fragile-10.5 -emit-llvm -o - %s | FileCheck -check-prefix=CHECK-X86-32 %s +// RUN: %clang_cc1 -triple x86_64-unknown-unknown -fobjc-runtime=macosx-fragile-10.5 -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 76407d6654e0..dab5b15e284e 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-fragile-abi -fobjc-gc -emit-llvm -o - %s | FileCheck %s +// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-runtime=macosx-fragile-10.5 -fobjc-gc -emit-llvm -o - %s | FileCheck %s struct Coerce { id a; }; |