summaryrefslogtreecommitdiffstats
path: root/test/CodeGen/blocks.c
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2013-12-22 00:07:40 +0000
committerdim <dim@FreeBSD.org>2013-12-22 00:07:40 +0000
commit952eddef9aff85b1e92626e89baaf7a360e2ac85 (patch)
treedf8df0b0067b381eab470a3b8f28d14a552a6340 /test/CodeGen/blocks.c
parentea266cad53e3d49771fa38103913d3ec7a166694 (diff)
downloadFreeBSD-src-952eddef9aff85b1e92626e89baaf7a360e2ac85.zip
FreeBSD-src-952eddef9aff85b1e92626e89baaf7a360e2ac85.tar.gz
Vendor import of clang release_34 branch r197841 (effectively, 3.4 RC3):
https://llvm.org/svn/llvm-project/cfe/branches/release_34@197841
Diffstat (limited to 'test/CodeGen/blocks.c')
-rw-r--r--test/CodeGen/blocks.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/test/CodeGen/blocks.c b/test/CodeGen/blocks.c
index 71f7171..5871e8c 100644
--- a/test/CodeGen/blocks.c
+++ b/test/CodeGen/blocks.c
@@ -45,7 +45,7 @@ void f3() {
// The bool can fill in between the header and the long long.
// Add the appropriate amount of padding between them.
void f4_helper(long long (^)(void));
-// CHECK: define void @f4()
+// CHECK-LABEL: define void @f4()
void f4(void) {
_Bool b = 0;
long long ll = 0;
@@ -60,9 +60,21 @@ struct F5 {
char buffer[32] __attribute((aligned));
};
void f5_helper(void (^)(struct F5 *));
-// CHECK: define void @f5()
+// CHECK-LABEL: define void @f5()
void f5(void) {
struct F5 value;
// CHECK: alloca <{ i8*, i32, i32, i8*, {{%.*}}*, [12 x i8], [[F5:%.*]] }>, align 16
f5_helper(^(struct F5 *slot) { *slot = value; });
}
+
+// rdar://14085217
+void (^b)() = ^{};
+int main() {
+ (b?: ^{})();
+}
+// CHECK: [[ZERO:%.*]] = load void (...)** @b
+// CHECK-NEXT: [[TB:%.*]] = icmp ne void (...)* [[ZERO]], null
+// CHECK-NEXT: br i1 [[TB]], label [[CT:%.*]], label [[CF:%.*]]
+// CHECK: [[ONE:%.*]] = bitcast void (...)* [[ZERO]] to void ()*
+// CHECK-NEXT: br label [[CE:%.*]]
+
OpenPOWER on IntegriCloud