diff options
author | dim <dim@FreeBSD.org> | 2015-12-30 11:49:41 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2015-12-30 11:49:41 +0000 |
commit | 3176e97f130184ece0e1a21352c8124cc83ff24a (patch) | |
tree | 0a5b74c0b9ca73aded34df95c91fcaf3815230d8 /test/CodeGenObjCXX/arc-exceptions.mm | |
parent | 1e9b8d38881c3213d1e67b0c47ab9b2c00721a5c (diff) | |
download | FreeBSD-src-3176e97f130184ece0e1a21352c8124cc83ff24a.zip FreeBSD-src-3176e97f130184ece0e1a21352c8124cc83ff24a.tar.gz |
Vendor import of clang trunk r256633:
https://llvm.org/svn/llvm-project/cfe/trunk@256633
Diffstat (limited to 'test/CodeGenObjCXX/arc-exceptions.mm')
-rw-r--r-- | test/CodeGenObjCXX/arc-exceptions.mm | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/test/CodeGenObjCXX/arc-exceptions.mm b/test/CodeGenObjCXX/arc-exceptions.mm index cc2206d..0ae3069 100644 --- a/test/CodeGenObjCXX/arc-exceptions.mm +++ b/test/CodeGenObjCXX/arc-exceptions.mm @@ -121,4 +121,37 @@ namespace test4 { // CHECK: resume } +// rdar://21397946 +__attribute__((ns_returns_retained)) id test5_helper(unsigned); +void test5(void) { + id array[][2] = { + test5_helper(0), + test5_helper(1), + test5_helper(2), + test5_helper(3) + }; +} +// CHECK-LABEL: define void @_Z5test5v() +// CHECK: [[ARRAY:%.*]] = alloca [2 x [2 x i8*]], align +// CHECK: [[A0:%.*]] = getelementptr inbounds [2 x [2 x i8*]], [2 x [2 x i8*]]* [[ARRAY]], i64 0, i64 0 +// CHECK-NEXT: store [2 x i8*]* [[A0]], +// CHECK-NEXT: [[A00:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[A0]], i64 0, i64 0 +// CHECK-NEXT: store i8** [[A00]], +// CHECK-NEXT: [[T0:%.*]] = invoke i8* @_Z12test5_helperj(i32 0) +// CHECK: store i8* [[T0]], i8** [[A00]], align +// CHECK-NEXT: [[A01:%.*]] = getelementptr inbounds i8*, i8** [[A00]], i64 1 +// CHECK-NEXT: store i8** [[A01]], +// CHECK-NEXT: [[T0:%.*]] = invoke i8* @_Z12test5_helperj(i32 1) +// CHECK: store i8* [[T0]], i8** [[A01]], align +// CHECK-NEXT: [[A1:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[A0]], i64 1 +// CHECK-NEXT: store [2 x i8*]* [[A1]], +// CHECK-NEXT: [[A10:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[A1]], i64 0, i64 0 +// CHECK-NEXT: store i8** [[A10]], +// CHECK-NEXT: [[T0:%.*]] = invoke i8* @_Z12test5_helperj(i32 2) +// CHECK: store i8* [[T0]], i8** [[A10]], align +// CHECK-NEXT: [[A11:%.*]] = getelementptr inbounds i8*, i8** [[A10]], i64 1 +// CHECK-NEXT: store i8** [[A11]], +// CHECK-NEXT: [[T0:%.*]] = invoke i8* @_Z12test5_helperj(i32 3) +// CHECK: store i8* [[T0]], i8** [[A11]], align + // CHECK: attributes [[NUW]] = { nounwind } |