1 // RUN: %clang_cc1 %s -emit-llvm -triple %itanium_abi_triple -o - -fblocks | FileCheck %s
2 // rdar://8594790
3
4 struct A {
5 int x;
6 A(const A &);
7 A();
8 ~A();
9 };
10
main()11 int main()
12 {
13 __block A BYREF_VAR;
14 ^{ BYREF_VAR.x = 1234; };
15 return 0;
16 }
17
18 // CHECK-LABEL: define internal void @__Block_byref_object_copy_
19 // CHECK: call {{.*}} @_ZN1AC1ERKS_
20 // CHECK-LABEL: define internal void @__Block_byref_object_dispose_
21 // CHECK: call {{.*}} @_ZN1AD1Ev
22 // CHECK-LABEL: define internal void @__copy_helper_block_
23 // CHECK: call void @_Block_object_assign
24 // CHECK-LABEL: define internal void @__destroy_helper_block_
25 // CHECK: call void @_Block_object_dispose
26
27 // rdar://problem/11135650
28 namespace test1 {
29 struct A { int x; A(); ~A(); };
30
test()31 void test() {
32 return;
33 __block A a;
34 }
35 }
36