diff options
Diffstat (limited to 'test/CodeGenObjCXX/lambda-to-block.mm')
-rw-r--r-- | test/CodeGenObjCXX/lambda-to-block.mm | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test/CodeGenObjCXX/lambda-to-block.mm b/test/CodeGenObjCXX/lambda-to-block.mm new file mode 100644 index 0000000000000..a8d0718b1244c --- /dev/null +++ b/test/CodeGenObjCXX/lambda-to-block.mm @@ -0,0 +1,18 @@ +// RUN: %clang_cc1 -x objective-c++ -fblocks -triple x86_64-apple-darwin10 -fobjc-runtime=macosx-fragile-10.5 -std=c++1z -emit-llvm -o - %s | FileCheck %s + +// rdar://31385153 +// Shouldn't crash! + +void takesBlock(void (^)(void)); + +struct Copyable { + Copyable(const Copyable &x); +}; + +void hasLambda(Copyable x) { + takesBlock([x] () { }); +} +// CHECK-LABEL: define internal void @__copy_helper_block_ +// CHECK: call void @"_ZZ9hasLambda8CopyableEN3$_0C1ERKS0_" +// CHECK-LABEL: define internal void @"_ZZ9hasLambda8CopyableEN3$_0C2ERKS0_" +// CHECK: call void @_ZN8CopyableC1ERKS_ |