diff options
| author | Adrian Prantl <aprantl@apple.com> | 2016-04-18 23:48:16 +0000 |
|---|---|---|
| committer | Adrian Prantl <aprantl@apple.com> | 2016-04-18 23:48:16 +0000 |
| commit | 2526fca8d891dad669e3a425b84d30bc7aaeb234 (patch) | |
| tree | a32bc14b1328346ef49e810790bb799fb4d7e4a0 /clang/test/CodeGenObjCXX | |
| parent | 6dd330504b237046886ea569708a2ab687d44a2c (diff) | |
| download | bcm5719-llvm-2526fca8d891dad669e3a425b84d30bc7aaeb234.tar.gz bcm5719-llvm-2526fca8d891dad669e3a425b84d30bc7aaeb234.zip | |
[ObjC++] Fix crash when emitting debug info for a block member capturing this.
rdar://problem/23871824
llvm-svn: 266698
Diffstat (limited to 'clang/test/CodeGenObjCXX')
| -rw-r--r-- | clang/test/CodeGenObjCXX/debug-info-block-capture-this.mm | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/clang/test/CodeGenObjCXX/debug-info-block-capture-this.mm b/clang/test/CodeGenObjCXX/debug-info-block-capture-this.mm new file mode 100644 index 00000000000..a1b120608cd --- /dev/null +++ b/clang/test/CodeGenObjCXX/debug-info-block-capture-this.mm @@ -0,0 +1,19 @@ +// RUN: %clang_cc1 -triple x86_64-apple-darwin -std=c++14 -fblocks -debug-info-kind=standalone -emit-llvm %s -o - | FileCheck %s +struct test +{ + int func() { return 1; } + int (^block)() = ^{ return func(); }; +}; + +int main(int argc, const char * argv[]) { + test t; + return t.block(); +} + +// CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "__block_literal_1", +// CHECK-SAME: elements: ![[ELEMS:.*]]) +// CHECK: ![[ELEMS]] = !{{{.*}}, ![[THIS:[0-9]+]]} +// CHECK: ![[THIS]] = !DIDerivedType(tag: DW_TAG_member, name: "this", +// CHECK-SAME: baseType: !"_ZTS4test", + + |

