summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/CodeGenCXX/stmtexpr.cpp7
-rw-r--r--clang/test/CodeGenObjC/arc.m12
2 files changed, 16 insertions, 3 deletions
diff --git a/clang/test/CodeGenCXX/stmtexpr.cpp b/clang/test/CodeGenCXX/stmtexpr.cpp
index 1f0e4ac4bf2..5d4d6bcce45 100644
--- a/clang/test/CodeGenCXX/stmtexpr.cpp
+++ b/clang/test/CodeGenCXX/stmtexpr.cpp
@@ -73,3 +73,10 @@ int* foo5() {
return (({ a; }));
}
+// <rdar://problem/14074868>
+// Make sure this doesn't crash.
+int foo5(bool b) {
+ int y = 0;
+ y = ({ A a(1); if (b) goto G; a.i; });
+ G: return y;
+}
diff --git a/clang/test/CodeGenObjC/arc.m b/clang/test/CodeGenObjC/arc.m
index 7262dc8d7b1..21ff43128cc 100644
--- a/clang/test/CodeGenObjC/arc.m
+++ b/clang/test/CodeGenObjC/arc.m
@@ -1115,11 +1115,14 @@ id test52(void) {
// CHECK: define i8* @test52()
// CHECK: [[X:%.*]] = alloca i32
+// CHECK-NEXT: [[TMPALLOCA:%.*]] = alloca i8*
// CHECK-NEXT: store i32 5, i32* [[X]],
// CHECK-NEXT: [[T0:%.*]] = load i32* [[X]],
// CHECK-NEXT: [[T1:%.*]] = call i8* @test52_helper(i32 [[T0]])
-// CHECK-NEXT: [[T2:%.*]] = tail call i8* @objc_autoreleaseReturnValue(i8* [[T1]])
-// CHECK-NEXT: ret i8* [[T2]]
+// CHECK-NEXT: store i8* [[T1]], i8** [[TMPALLOCA]]
+// CHECK-NEXT: [[T2:%.*]] = load i8** [[TMPALLOCA]]
+// CHECK-NEXT: [[T3:%.*]] = tail call i8* @objc_autoreleaseReturnValue(i8* [[T2]])
+// CHECK-NEXT: ret i8* [[T3]]
}
// rdar://problem/9400644
@@ -1130,14 +1133,17 @@ void test53(void) {
// CHECK: define void @test53()
// CHECK: [[X:%.*]] = alloca i8*,
// CHECK-NEXT: [[Y:%.*]] = alloca i8*,
+// CHECK-NEXT: [[TMPALLOCA:%.*]] = alloca i8*,
// CHECK-NEXT: [[T0:%.*]] = call i8* @test53_helper()
// CHECK-NEXT: [[T1:%.*]] = call i8* @objc_retainAutoreleasedReturnValue(i8* [[T0]])
// CHECK-NEXT: store i8* [[T1]], i8** [[Y]],
// CHECK-NEXT: [[T0:%.*]] = load i8** [[Y]],
// CHECK-NEXT: [[T1:%.*]] = call i8* @objc_retain(i8* [[T0]])
+// CHECK-NEXT: store i8* [[T1]], i8** [[TMPALLOCA]]
// CHECK-NEXT: [[T2:%.*]] = load i8** [[Y]]
// CHECK-NEXT: call void @objc_release(i8* [[T2]])
-// CHECK-NEXT: store i8* [[T1]], i8** [[X]],
+// CHECK-NEXT: [[T3:%.*]] = load i8** [[TMPALLOCA]]
+// CHECK-NEXT: store i8* [[T3]], i8** [[X]],
// CHECK-NEXT: load i8** [[X]],
// CHECK-NEXT: [[T0:%.*]] = load i8** [[X]]
// CHECK-NEXT: call void @objc_release(i8* [[T0]])
OpenPOWER on IntegriCloud