diff options
| author | John McCall <rjmccall@apple.com> | 2015-09-14 18:57:08 +0000 |
|---|---|---|
| committer | John McCall <rjmccall@apple.com> | 2015-09-14 18:57:08 +0000 |
| commit | f0f0b7a0eb7607129c50fcbccd228c69f3451c79 (patch) | |
| tree | d83355d2c5d612bb0ac8d265f1e60241246d942b /clang/test/CodeGenObjCXX/arc-exceptions.mm | |
| parent | a5f384487a7300251dd3d9331f152ec5e563de73 (diff) | |
| download | bcm5719-llvm-f0f0b7a0eb7607129c50fcbccd228c69f3451c79.tar.gz bcm5719-llvm-f0f0b7a0eb7607129c50fcbccd228c69f3451c79.zip | |
Fix a nasty bug with the partial destruction of nested arrays;
it escaped notice because it's only used for heterogeneous
initialization.
rdar://21397946
llvm-svn: 247597
Diffstat (limited to 'clang/test/CodeGenObjCXX/arc-exceptions.mm')
| -rw-r--r-- | clang/test/CodeGenObjCXX/arc-exceptions.mm | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/clang/test/CodeGenObjCXX/arc-exceptions.mm b/clang/test/CodeGenObjCXX/arc-exceptions.mm index cc2206d1a9e..0ae30694318 100644 --- a/clang/test/CodeGenObjCXX/arc-exceptions.mm +++ b/clang/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 } |

