summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenObjC/debug-info-blocks.m
diff options
context:
space:
mode:
authorAdrian Prantl <aprantl@apple.com>2013-03-29 19:20:35 +0000
committerAdrian Prantl <aprantl@apple.com>2013-03-29 19:20:35 +0000
commit0f6df00e4d64e74ebb9621edf9beb0ced42e1697 (patch)
tree8ddd4cc1132bd9eac56902b7fc859c4b6b6c8e85 /clang/test/CodeGenObjC/debug-info-blocks.m
parentde17db30d8448db181dadbeb9f5e2479cbf17cca (diff)
downloadbcm5719-llvm-0f6df00e4d64e74ebb9621edf9beb0ced42e1697.tar.gz
bcm5719-llvm-0f6df00e4d64e74ebb9621edf9beb0ced42e1697.zip
Bugfix/Followup for r177086.
* Store the .block_descriptor (instead of self) in the alloca so we can guarantee that all captured variables are available at -O0. * Add the missing OpDeref for the alloca. rdar://problem/12767564 llvm-svn: 178361
Diffstat (limited to 'clang/test/CodeGenObjC/debug-info-blocks.m')
-rw-r--r--clang/test/CodeGenObjC/debug-info-blocks.m20
1 files changed, 14 insertions, 6 deletions
diff --git a/clang/test/CodeGenObjC/debug-info-blocks.m b/clang/test/CodeGenObjC/debug-info-blocks.m
index 71ae8a610ee..faddfd2d730 100644
--- a/clang/test/CodeGenObjC/debug-info-blocks.m
+++ b/clang/test/CodeGenObjC/debug-info-blocks.m
@@ -1,9 +1,17 @@
-// REQUIRES: x86-64-registered-target
-// RUN: %clang_cc1 -masm-verbose -S -fblocks -g -triple x86_64-apple-darwin10 -fobjc-dispatch-method=mixed %s -o - | FileCheck %s
-
-//Radar 9279956
-//CHECK: ## DW_OP_deref
-//CHECK-NEXT: ## DW_OP_plus_uconst
+// RUN: %clang_cc1 -emit-llvm -fblocks -g -triple x86_64-apple-darwin10 -fobjc-dispatch-method=mixed %s -o - | FileCheck %s
+
+// rdar://problem/9279956
+// Test that we generate the proper debug location for a captured self.
+// The second half of this patch is in llvm/tests/DebugInfo/debug-info-blocks.ll
+
+// CHECK: define {{.*}}_block_invoke
+// CHECK: %[[BLOCK:.*]] = bitcast i8* %.block_descriptor to <{ i8*, i32, i32, i8*, %struct.__block_descriptor*, %0* }>*, !dbg !88
+// CHECK-NEXT: store <{ i8*, i32, i32, i8*, %struct.__block_descriptor*, %0* }>* %[[BLOCK]], <{ i8*, i32, i32, i8*, %struct.__block_descriptor*, %0* }>** %[[ALLOCA:.*]], align
+// CHECK-NEXT: getelementptr inbounds <{ i8*, i32, i32, i8*, %struct.__block_descriptor*, %0* }>* %[[BLOCK]], i32 0, i32 5
+// CHECK-NEXT: call void @llvm.dbg.declare(metadata !{<{ i8*, i32, i32, i8*, %struct.__block_descriptor*, %0* }>** %[[ALLOCA]]}, metadata ![[SELF:[0-9]+]])
+// CHECK-NEXT: call void @llvm.dbg.declare(metadata !{%1** %d}, metadata ![[D:[0-9]+]])
+// CHECK: ![[SELF]] = {{.*}} [ DW_TAG_auto_variable ] [self] [line 52]
+// CHECK: ![[D]] = {{.*}} [d] [line 50]
typedef unsigned int NSUInteger;
OpenPOWER on IntegriCloud