aboutsummaryrefslogtreecommitdiff
path: root/test/CXX/expr/expr.prim/expr.prim.lambda
diff options
context:
space:
mode:
Diffstat (limited to 'test/CXX/expr/expr.prim/expr.prim.lambda')
-rw-r--r--test/CXX/expr/expr.prim/expr.prim.lambda/blocks-irgen.mm29
-rw-r--r--test/CXX/expr/expr.prim/expr.prim.lambda/blocks.mm22
2 files changed, 29 insertions, 22 deletions
diff --git a/test/CXX/expr/expr.prim/expr.prim.lambda/blocks-irgen.mm b/test/CXX/expr/expr.prim/expr.prim.lambda/blocks-irgen.mm
new file mode 100644
index 0000000000..9adecd0ee3
--- /dev/null
+++ b/test/CXX/expr/expr.prim/expr.prim.lambda/blocks-irgen.mm
@@ -0,0 +1,29 @@
+// RUN: %clang_cc1 -std=c++11 -fblocks -emit-llvm -o - -triple x86_64-apple-darwin11.3 %s | FileCheck %s
+
+namespace PR12746 {
+ // CHECK: define zeroext i1 @_ZN7PR127462f1EPi
+ bool f1(int *x) {
+ // CHECK: store i8* bitcast (i1 (i8*)* @__f1_block_invoke_0 to i8*)
+ bool (^outer)() = ^ {
+ auto inner = [&]() -> bool {
+ return x == 0;
+ };
+ return inner();
+ };
+ return outer();
+ }
+
+ // CHECK: define internal zeroext i1 @__f1_block_invoke_0
+ // CHECK: call zeroext i1 @"_ZNK7PR127462f119__f1_block_invoke_03$_0clEv"
+
+ bool f2(int *x) {
+ auto outer = [&]() -> bool {
+ bool (^inner)() = ^ {
+ return x == 0;
+ };
+ return inner();
+ };
+ return outer();
+ }
+}
+
diff --git a/test/CXX/expr/expr.prim/expr.prim.lambda/blocks.mm b/test/CXX/expr/expr.prim/expr.prim.lambda/blocks.mm
index 941443a0d6..0c3fdb2d80 100644
--- a/test/CXX/expr/expr.prim/expr.prim.lambda/blocks.mm
+++ b/test/CXX/expr/expr.prim/expr.prim.lambda/blocks.mm
@@ -86,25 +86,3 @@ namespace overloading {
int &ir = accept_lambda_conv([](int x) { return x + 1; });
}
}
-
-namespace PR12746 {
- bool f1(int *x) {
- bool (^outer)() = ^ {
- auto inner = [&]() -> bool {
- return x == 0;
- };
- return inner();
- };
- return outer();
- }
-
- bool f2(int *x) {
- auto outer = [&]() -> bool {
- bool (^inner)() = ^ {
- return x == 0;
- };
- return inner();
- };
- return outer();
- }
-}