summaryrefslogtreecommitdiff
path: root/test/CodeGenObjC
diff options
context:
space:
mode:
Diffstat (limited to 'test/CodeGenObjC')
-rw-r--r--test/CodeGenObjC/autorelease.m2
-rw-r--r--test/CodeGenObjC/blocks-2.m2
-rw-r--r--test/CodeGenObjC/exceptions.m22
-rw-r--r--test/CodeGenObjC/gnu-exceptions.m5
-rw-r--r--test/CodeGenObjC/objc-asm-attribute-test.m16
-rw-r--r--test/CodeGenObjC/synchronized.m2
-rw-r--r--test/CodeGenObjC/terminate.m6
7 files changed, 36 insertions, 19 deletions
diff --git a/test/CodeGenObjC/autorelease.m b/test/CodeGenObjC/autorelease.m
index 6bb80fd2bd8fb..ab65f8088d1f9 100644
--- a/test/CodeGenObjC/autorelease.m
+++ b/test/CodeGenObjC/autorelease.m
@@ -46,7 +46,7 @@ int tryTo(int (*f)(void)) {
// CHECK-NEXT: [[T2:%.*]] = invoke i32 [[T1]]()
// CHECK: store i32 [[T2]], i32* [[RET]]
// CHECK: invoke void @objc_autoreleasePoolPop(i8* [[T0]])
-// CHECK: landingpad { i8*, i32 } personality
+// CHECK: landingpad { i8*, i32 }
// CHECK-NEXT: catch i8* null
// CHECK: call i8* @objc_begin_catch
// CHECK-NEXT: store i32 0, i32* [[RET]]
diff --git a/test/CodeGenObjC/blocks-2.m b/test/CodeGenObjC/blocks-2.m
index 0c6bd562b5393..b9562ad6d64e9 100644
--- a/test/CodeGenObjC/blocks-2.m
+++ b/test/CodeGenObjC/blocks-2.m
@@ -30,7 +30,7 @@ void test1() {
// CHECK-NEXT: call void @_Block_object_dispose(i8* [[T1]], i32 8)
// CHECK-NEXT: ret void
- // CHECK: landingpad { i8*, i32 } personality
+ // CHECK: landingpad { i8*, i32 }
// CHECK-NEXT: cleanup
// CHECK: [[T1:%.*]] = bitcast [[N_T]]* [[N]] to i8*
// CHECK-NEXT: call void @_Block_object_dispose(i8* [[T1]], i32 8)
diff --git a/test/CodeGenObjC/exceptions.m b/test/CodeGenObjC/exceptions.m
index f27892dc7893d..075b714f29e2a 100644
--- a/test/CodeGenObjC/exceptions.m
+++ b/test/CodeGenObjC/exceptions.m
@@ -55,14 +55,14 @@ int f2() {
@try {
// CHECK: store i32 6, i32* [[X]]
x++;
- // CHECK-NEXT: call void asm sideeffect "", "*m,*m"(i32* [[X]]
+ // CHECK-NEXT: call void asm sideeffect "", "*m,*m"(i32* nonnull [[X]]
// CHECK-NEXT: call void @foo()
// CHECK-NEXT: call void @objc_exception_try_exit
// CHECK-NEXT: [[T:%.*]] = load i32, i32* [[X]]
foo();
} @catch (id) {
// Landing pad. Note that we elide the re-enter.
- // CHECK: call void asm sideeffect "", "=*m,=*m"(i32* [[X]]
+ // CHECK: call void asm sideeffect "", "=*m,=*m"(i32* nonnull [[X]]
// CHECK-NEXT: call i8* @objc_exception_extract
// CHECK-NEXT: [[T1:%.*]] = load i32, i32* [[X]]
// CHECK-NEXT: [[T2:%.*]] = add nsw i32 [[T1]], -1
@@ -93,7 +93,7 @@ void f3() {
// CHECK-NEXT: br i1
@try {
- // CHECK: call void @f3_helper(i32 0, i32* [[X]])
+ // CHECK: call void @f3_helper(i32 0, i32* nonnull [[X]])
// CHECK: call void @objc_exception_try_exit(
f3_helper(0, &x);
} @finally {
@@ -101,12 +101,12 @@ void f3() {
// CHECK: call void @objc_exception_try_enter
// CHECK: call i32 @_setjmp
@try {
- // CHECK: call void @f3_helper(i32 1, i32* [[X]])
+ // CHECK: call void @f3_helper(i32 1, i32* nonnull [[X]])
// CHECK: call void @objc_exception_try_exit(
f3_helper(1, &x);
} @finally {
// CHECK: [[DEST2:%.*]] = phi i32 [ 0, {{%.*}} ], [ 5, {{%.*}} ]
- // CHECK: call void @f3_helper(i32 2, i32* [[X]])
+ // CHECK: call void @f3_helper(i32 2, i32* nonnull [[X]])
f3_helper(2, &x);
// This loop is large enough to dissuade the optimizer from just
@@ -123,7 +123,7 @@ void f3() {
// CHECK: [[DEST1]]
}
- // CHECK: call void @f3_helper(i32 4, i32* [[X]])
+ // CHECK: call void @f3_helper(i32 4, i32* nonnull [[X]])
// CHECK-NEXT: call void @llvm.lifetime.end(i64 4, i8* [[XPTR]])
// CHECK-NEXT: ret void
f3_helper(4, &x);
@@ -135,7 +135,7 @@ void f4() {
// CHECK-LABEL: define void @f4()
// CHECK: [[EXNDATA:%.*]] = alloca [[EXNDATA_T:%.*]], align
- // CHECK: call void @objc_exception_try_enter([[EXNDATA_T]]* [[EXNDATA]])
+ // CHECK: call void @objc_exception_try_enter([[EXNDATA_T]]* nonnull [[EXNDATA]])
// CHECK: call i32 @_setjmp
@try {
// CHECK: call void @f4_help(i32 0)
@@ -144,7 +144,7 @@ void f4() {
// The finally cleanup has two threaded entrypoints after optimization:
// finally.no-call-exit: Predecessor is when the catch throws.
- // CHECK: call i8* @objc_exception_extract([[EXNDATA_T]]* [[EXNDATA]])
+ // CHECK: call i8* @objc_exception_extract([[EXNDATA_T]]* nonnull [[EXNDATA]])
// CHECK-NEXT: call void @f4_help(i32 2)
// CHECK-NEXT: br label
// -> rethrow
@@ -154,7 +154,7 @@ void f4() {
// to rethrow and should be true only in the last case.
// CHECK: phi i8*
// CHECK-NEXT: phi i1
- // CHECK-NEXT: call void @objc_exception_try_exit([[EXNDATA_T]]* [[EXNDATA]])
+ // CHECK-NEXT: call void @objc_exception_try_exit([[EXNDATA_T]]* nonnull [[EXNDATA]])
// CHECK-NEXT: call void @f4_help(i32 2)
// CHECK-NEXT: br i1
// -> ret, rethrow
@@ -163,8 +163,8 @@ void f4() {
// CHECK: ret void
// Catch mechanism:
- // CHECK: call i8* @objc_exception_extract([[EXNDATA_T]]* [[EXNDATA]])
- // CHECK-NEXT: call void @objc_exception_try_enter([[EXNDATA_T]]* [[EXNDATA]])
+ // CHECK: call i8* @objc_exception_extract([[EXNDATA_T]]* nonnull [[EXNDATA]])
+ // CHECK-NEXT: call void @objc_exception_try_enter([[EXNDATA_T]]* nonnull [[EXNDATA]])
// CHECK: call i32 @_setjmp
// -> next, finally.no-call-exit
// CHECK: call i32 @objc_exception_match
diff --git a/test/CodeGenObjC/gnu-exceptions.m b/test/CodeGenObjC/gnu-exceptions.m
index 82eb6cb7bd5fa..76e9e1ded3c45 100644
--- a/test/CodeGenObjC/gnu-exceptions.m
+++ b/test/CodeGenObjC/gnu-exceptions.m
@@ -6,7 +6,8 @@ void log(int i);
@class C;
-// CHECK: define void @test0() [[TF:#[0-9]+]] {
+// CHECK: define void @test0() [[TF:#[0-9]+]]
+// CHECK-SAME: personality i8* bitcast (i32 (...)* @__gnu_objc_personality_v0 to i8*)
void test0() {
@try {
// CHECK: invoke void @opaque()
@@ -15,7 +16,7 @@ void test0() {
// CHECK: call void @log(i32 1)
} @catch (C *c) {
- // CHECK: landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gnu_objc_personality_v0 to i8*)
+ // CHECK: landingpad { i8*, i32 }
// CHECK-NEXT: catch i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i64 0, i64 0)
// CHECK: br i1
diff --git a/test/CodeGenObjC/objc-asm-attribute-test.m b/test/CodeGenObjC/objc-asm-attribute-test.m
index 589b08ae0eef0..7b3a64deb74c6 100644
--- a/test/CodeGenObjC/objc-asm-attribute-test.m
+++ b/test/CodeGenObjC/objc-asm-attribute-test.m
@@ -13,10 +13,19 @@ __attribute__((objc_runtime_name("MySecretNamespace.Protocol2")))
+ (void) ClsMethodP2;
@end
+__attribute__((objc_runtime_name("MySecretNamespace.Protocol3")))
+@protocol Protocol3
+@end
+
__attribute__((objc_runtime_name("MySecretNamespace.Message")))
@interface Message <Protocol, Protocol2> {
id MyIVAR;
}
+
+@property(retain) Message *msgProp;
+@property(retain) Message<Protocol3> *msgProtoProp;
+@property(retain) id<Protocol3> idProtoProp;
+
@end
@implementation Message
@@ -46,9 +55,14 @@ id Test16877359() {
return [SLREarth alloc];
}
-// CHECK: @"OBJC_IVAR_$_MySecretNamespace.Message.MyIVAR" = global i64
+// CHECK: @"OBJC_IVAR_$_MySecretNamespace.Message.MyIVAR" = global i64 0
// CHECK: @"OBJC_CLASS_$_MySecretNamespace.Message" = global %struct._class_t
// CHECK: @"OBJC_METACLASS_$_MySecretNamespace.Message" = global %struct._class_t
+
+// CHECK: private global [42 x i8] c"T@\22MySecretNamespace.Message\22,&,V_msgProp\00"
+// CHECK: private global [76 x i8] c"T@\22MySecretNamespace.Message<MySecretNamespace.Protocol3>\22,&,V_msgProtoProp\00"
+// CHECK: private global [50 x i8] c"T@\22<MySecretNamespace.Protocol3>\22,&,V_idProtoProp\00"
+
// CHECK: @"OBJC_CLASS_$_foo" = external global %struct._class_t
// CHECK: define internal i8* @"\01-[Message MyMethod]"
// CHECK: [[IVAR:%.*]] = load i64, i64* @"OBJC_IVAR_$_MySecretNamespace.Message.MyIVAR"
diff --git a/test/CodeGenObjC/synchronized.m b/test/CodeGenObjC/synchronized.m
index 212d98a6bc81b..0ce179ccc0367 100644
--- a/test/CodeGenObjC/synchronized.m
+++ b/test/CodeGenObjC/synchronized.m
@@ -32,7 +32,7 @@ void foo(id a) {
// CHECK: call i32 @_setjmp
@synchronized(a) {
// This is unreachable, but the optimizers can't know that.
- // CHECK: call void asm sideeffect "", "=*m,=*m,=*m"(i8** [[A]], i8** [[SYNC]]
+ // CHECK: call void asm sideeffect "", "=*m,=*m,=*m"(i8** nonnull [[A]], i8** nonnull [[SYNC]]
// CHECK: call i32 @objc_sync_exit
// CHECK: call i8* @objc_exception_extract
// CHECK: call void @objc_exception_throw
diff --git a/test/CodeGenObjC/terminate.m b/test/CodeGenObjC/terminate.m
index 4992b998b3952..a756bfba417c8 100644
--- a/test/CodeGenObjC/terminate.m
+++ b/test/CodeGenObjC/terminate.m
@@ -10,20 +10,22 @@ void test0(void) {
test0_helper();
// CHECK-WITH-LABEL: define void @test0()
+ // CHECK-WITH-SAME: personality i8* bitcast (i32 (...)* @__gcc_personality_v0 to i8*)
// CHECK-WITH: [[PTR:%.*]] = alloca i8*,
// CHECK-WITH: call void @destroy(i8** [[PTR]])
// CHECK-WITH-NEXT: ret void
// CHECK-WITH: invoke void @destroy(i8** [[PTR]])
- // CHECK-WITH: landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gcc_personality_v0 to i8*)
+ // CHECK-WITH: landingpad { i8*, i32 }
// CHECK-WITH-NEXT: catch i8* null
// CHECK-WITH-NEXT: call void @objc_terminate()
// CHECK-WITHOUT-LABEL: define void @test0()
+ // CHECK-WITHOUT-SAME: personality i8* bitcast (i32 (...)* @__gcc_personality_v0 to i8*)
// CHECK-WITHOUT: [[PTR:%.*]] = alloca i8*,
// CHECK-WITHOUT: call void @destroy(i8** [[PTR]])
// CHECK-WITHOUT-NEXT: ret void
// CHECK-WITHOUT: invoke void @destroy(i8** [[PTR]])
- // CHECK-WITHOUT: landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gcc_personality_v0 to i8*)
+ // CHECK-WITHOUT: landingpad { i8*, i32 }
// CHECK-WITHOUT-NEXT: catch i8* null
// CHECK-WITHOUT-NEXT: call void @abort()
}