annotate clang/test/CodeGenCXX/block-byref-cxx-objc.cpp @ 206:f17a3b42b08b

Added tag before-12 for changeset b7591485f4cd
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 07 Jun 2021 21:25:57 +0900
parents 1d019706d866
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
150
anatofuz
parents:
diff changeset
1 // RUN: %clang_cc1 %s -std=c++11 -emit-llvm -triple %itanium_abi_triple -o - -fblocks -fexceptions | FileCheck %s
anatofuz
parents:
diff changeset
2 // rdar://8594790
anatofuz
parents:
diff changeset
3
anatofuz
parents:
diff changeset
4 struct A {
anatofuz
parents:
diff changeset
5 int x;
anatofuz
parents:
diff changeset
6 A(const A &);
anatofuz
parents:
diff changeset
7 A();
anatofuz
parents:
diff changeset
8 ~A() noexcept(false);
anatofuz
parents:
diff changeset
9 };
anatofuz
parents:
diff changeset
10
anatofuz
parents:
diff changeset
11 struct B {
anatofuz
parents:
diff changeset
12 int x;
anatofuz
parents:
diff changeset
13 B(const B &);
anatofuz
parents:
diff changeset
14 B();
anatofuz
parents:
diff changeset
15 ~B();
anatofuz
parents:
diff changeset
16 };
anatofuz
parents:
diff changeset
17
anatofuz
parents:
diff changeset
18 int testA() {
anatofuz
parents:
diff changeset
19 __block A a0, a1;
anatofuz
parents:
diff changeset
20 ^{ a0.x = 1234; a1.x = 5678; };
anatofuz
parents:
diff changeset
21 return 0;
anatofuz
parents:
diff changeset
22 }
anatofuz
parents:
diff changeset
23
anatofuz
parents:
diff changeset
24 // CHECK-LABEL: define internal void @__Block_byref_object_copy_
anatofuz
parents:
diff changeset
25 // CHECK: call {{.*}} @_ZN1AC1ERKS_
anatofuz
parents:
diff changeset
26 // CHECK-LABEL: define internal void @__Block_byref_object_dispose_
anatofuz
parents:
diff changeset
27 // CHECK: call {{.*}} @_ZN1AD1Ev
anatofuz
parents:
diff changeset
28
anatofuz
parents:
diff changeset
29 // CHECK-LABEL: define linkonce_odr hidden void @__copy_helper_block_e{{4|8}}_{{20|32}}rc{{24|40}}rc(
anatofuz
parents:
diff changeset
30 // CHECK: call void @_Block_object_assign(
anatofuz
parents:
diff changeset
31 // CHECK: invoke void @_Block_object_assign(
anatofuz
parents:
diff changeset
32 // CHECK: call void @_Block_object_dispose({{.*}}) #[[NOUNWIND_ATTR:[0-9]+]]
anatofuz
parents:
diff changeset
33
anatofuz
parents:
diff changeset
34 // CHECK-LABEL: define linkonce_odr hidden void @__destroy_helper_block_e{{4|8}}_{{20|32}}rd{{24|40}}rd(
anatofuz
parents:
diff changeset
35 // CHECK: invoke void @_Block_object_dispose(
anatofuz
parents:
diff changeset
36 // CHECK: call void @_Block_object_dispose(
anatofuz
parents:
diff changeset
37 // CHECK: invoke void @_Block_object_dispose(
anatofuz
parents:
diff changeset
38
anatofuz
parents:
diff changeset
39 int testB() {
anatofuz
parents:
diff changeset
40 __block B b0, b1;
anatofuz
parents:
diff changeset
41 ^{ b0.x = 1234; b1.x = 5678; };
anatofuz
parents:
diff changeset
42 return 0;
anatofuz
parents:
diff changeset
43 }
anatofuz
parents:
diff changeset
44
anatofuz
parents:
diff changeset
45 // CHECK-LABEL: define internal void @__Block_byref_object_copy_
anatofuz
parents:
diff changeset
46 // CHECK: call {{.*}} @_ZN1BC1ERKS_
anatofuz
parents:
diff changeset
47 // CHECK-LABEL: define internal void @__Block_byref_object_dispose_
anatofuz
parents:
diff changeset
48 // CHECK: call {{.*}} @_ZN1BD1Ev
anatofuz
parents:
diff changeset
49
anatofuz
parents:
diff changeset
50 // CHECK-NOT: define{{.*}}@__copy_helper_block
anatofuz
parents:
diff changeset
51 // CHECK: define linkonce_odr hidden void @__destroy_helper_block_e{{4|8}}_{{20|32}}r{{24|40}}r(
anatofuz
parents:
diff changeset
52
anatofuz
parents:
diff changeset
53 // CHECK: attributes #[[NOUNWIND_ATTR]] = {{{.*}}nounwind{{.*}}}
anatofuz
parents:
diff changeset
54
anatofuz
parents:
diff changeset
55 // rdar://problem/11135650
anatofuz
parents:
diff changeset
56 namespace test1 {
anatofuz
parents:
diff changeset
57 struct A { int x; A(); ~A(); };
anatofuz
parents:
diff changeset
58
anatofuz
parents:
diff changeset
59 void test() {
anatofuz
parents:
diff changeset
60 return;
anatofuz
parents:
diff changeset
61 __block A a;
anatofuz
parents:
diff changeset
62 }
anatofuz
parents:
diff changeset
63 }