summaryrefslogtreecommitdiffstats
path: root/test/CodeGenObjC/debug-info-block-type.m
diff options
context:
space:
mode:
Diffstat (limited to 'test/CodeGenObjC/debug-info-block-type.m')
-rw-r--r--test/CodeGenObjC/debug-info-block-type.m18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/CodeGenObjC/debug-info-block-type.m b/test/CodeGenObjC/debug-info-block-type.m
new file mode 100644
index 0000000..ef92bf3
--- /dev/null
+++ b/test/CodeGenObjC/debug-info-block-type.m
@@ -0,0 +1,18 @@
+// RUN: %clang_cc1 -emit-llvm -fblocks -g -triple x86_64-apple-darwin14 -x objective-c < %s -o - | FileCheck %s
+#define nil ((void*) 0)
+typedef signed char BOOL;
+// CHECK: ![[BOOL:[0-9]+]] = {{.*}} [ DW_TAG_typedef ] [BOOL] [line [[@LINE-1]]
+// CHECK: ![[ID:[0-9]+]] = {{.*}} [ DW_TAG_typedef ] [id]
+
+typedef BOOL (^SomeKindOfPredicate)(id obj);
+// CHECK: ![[PTR:[0-9]+]]} ; [ DW_TAG_member ] [__FuncPtr]
+// CHECK: ![[PTR]] = {{.*}}, ![[FNTYPE:[0-9]+]]} ; [ DW_TAG_pointer_type ]
+// CHECK: ![[FNTYPE]] = {{.*}} ![[ARGS:[0-9]+]]{{.*}} ; [ DW_TAG_subroutine_type ]
+// CHECK: ![[ARGS]] = !{![[BOOL]], ![[ID]]}
+
+int main()
+{
+ SomeKindOfPredicate p = ^BOOL(id obj) { return obj != nil; };
+ // CHECK: ![[PTR]]} ; [ DW_TAG_member ] [__FuncPtr] [line [[@LINE-1]], size 64, align 64, offset 128]
+ return p(nil);
+}
OpenPOWER on IntegriCloud