blob: 30f1f074b9b36c59d52473e8a3154c7cc2f85491 [file] [log] [blame]
Fariborz Jahanian25755852010-12-02 17:58:10 +00001// RUN: %clang_cc1 %s -emit-llvm -o - -fblocks | FileCheck %s
2// rdar://8594790
3
4struct A {
5 int x;
6 A(const A &);
7 A();
8 ~A();
9};
10
11int main()
12{
13 __block A BYREF_VAR;
14 ^{ BYREF_VAR.x = 1234; };
15 return 0;
16}
17
18// CHECK: define internal void @__Block_byref_object_copy_
Eli Friedman41f1fd42011-06-13 22:51:21 +000019// CHECK: call {{.*}} @_ZN1AC1ERKS_
Fariborz Jahanian25755852010-12-02 17:58:10 +000020// CHECK: define internal void @__Block_byref_object_dispose_
Eli Friedman41f1fd42011-06-13 22:51:21 +000021// CHECK: call {{.*}} @_ZN1AD1Ev
Fariborz Jahanian25755852010-12-02 17:58:10 +000022// CHECK: define internal void @__copy_helper_block_
23// CHECK: call void @_Block_object_assign
24// CHECK: define internal void @__destroy_helper_block_
25// CHECK: call void @_Block_object_dispose
John McCall38baeab2012-04-13 18:44:05 +000026
27// rdar://problem/11135650
28namespace test1 {
29 struct A { int x; A(); ~A(); };
30
31 void test() {
32 return;
33 __block A a;
34 }
35}