annotate clang/test/PCH/block-helpers.cpp @ 150:1d019706d866

LLVM10
author anatofuz
date Thu, 13 Feb 2020 15:10:13 +0900
parents
children c4bab56944e8
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
150
anatofuz
parents:
diff changeset
1 // RUN: %clang_cc1 -x c++-header -triple x86_64-apple-darwin11 -emit-pch -fblocks -fexceptions -o %t %S/block-helpers.h
anatofuz
parents:
diff changeset
2 // RUN: %clang_cc1 -triple x86_64-apple-darwin11 -include-pch %t -emit-llvm -fblocks -fexceptions -o - %s | FileCheck %s
anatofuz
parents:
diff changeset
3
anatofuz
parents:
diff changeset
4 // CHECK: %[[STRUCT_BLOCK_BYREF_X:.*]] = type { i8*, %[[STRUCT_BLOCK_BYREF_X]]*, i32, i32, i8*, i8*, %[[STRUCT_S0:.*]] }
anatofuz
parents:
diff changeset
5 // CHECK: %[[STRUCT_S0]] = type { i32 }
anatofuz
parents:
diff changeset
6 // CHECK: %[[STRUCT_BLOCK_BYREF_Y:.*]] = type { i8*, %[[STRUCT_BLOCK_BYREF_Y]]*, i32, i32, i8*, i8*, %[[STRUCT_S0]] }
anatofuz
parents:
diff changeset
7 // CHECK: %[[STRUCT_BLOCK_DESCRIPTOR:.*]] = type { i64, i64 }
anatofuz
parents:
diff changeset
8
anatofuz
parents:
diff changeset
9 // Check that byref structs are allocated for x and y.
anatofuz
parents:
diff changeset
10
anatofuz
parents:
diff changeset
11 // CHECK-LABEL: define linkonce_odr void @_ZN1S1mEv(
anatofuz
parents:
diff changeset
12 // CHECK: %[[X:.*]] = alloca %[[STRUCT_BLOCK_BYREF_X]], align 8
anatofuz
parents:
diff changeset
13 // CHECK: %[[Y:.*]] = alloca %[[STRUCT_BLOCK_BYREF_Y]], align 8
anatofuz
parents:
diff changeset
14 // CHECK: %[[BLOCK:.*]] = alloca <{ i8*, i32, i32, i8*, %[[STRUCT_BLOCK_DESCRIPTOR]]*, i8*, i8* }>, align 8
anatofuz
parents:
diff changeset
15 // CHECK: %[[BLOCK_CAPTURED:.*]] = getelementptr inbounds <{ i8*, i32, i32, i8*, %[[STRUCT_BLOCK_DESCRIPTOR]]*, i8*, i8* }>, <{ i8*, i32, i32, i8*, %[[STRUCT_BLOCK_DESCRIPTOR]]*, i8*, i8* }>* %[[BLOCK]], i32 0, i32 5
anatofuz
parents:
diff changeset
16 // CHECK: %[[V0:.*]] = bitcast %[[STRUCT_BLOCK_BYREF_X]]* %[[X]] to i8*
anatofuz
parents:
diff changeset
17 // CHECK: store i8* %[[V0]], i8** %[[BLOCK_CAPTURED]], align 8
anatofuz
parents:
diff changeset
18 // CHECK: %[[BLOCK_CAPTURED10:.*]] = getelementptr inbounds <{ i8*, i32, i32, i8*, %[[STRUCT_BLOCK_DESCRIPTOR]]*, i8*, i8* }>, <{ i8*, i32, i32, i8*, %[[STRUCT_BLOCK_DESCRIPTOR]]*, i8*, i8* }>* %[[BLOCK]], i32 0, i32 6
anatofuz
parents:
diff changeset
19 // CHECK: %[[V1:.*]] = bitcast %[[STRUCT_BLOCK_BYREF_Y]]* %[[Y]] to i8*
anatofuz
parents:
diff changeset
20 // CHECK: store i8* %[[V1]], i8** %[[BLOCK_CAPTURED10]], align 8
anatofuz
parents:
diff changeset
21
anatofuz
parents:
diff changeset
22 // CHECK-LABEL: define internal void @___ZN1S1mEv_block_invoke(
anatofuz
parents:
diff changeset
23
anatofuz
parents:
diff changeset
24 // The second call to block_object_assign should be an invoke.
anatofuz
parents:
diff changeset
25
anatofuz
parents:
diff changeset
26 // CHECK-LABEL: define linkonce_odr hidden void @__copy_helper_block_e8_32rc40rc(
anatofuz
parents:
diff changeset
27 // CHECK: call void @_Block_object_assign(
anatofuz
parents:
diff changeset
28 // CHECK: invoke void @_Block_object_assign(
anatofuz
parents:
diff changeset
29 // CHECK: call void @_Block_object_dispose(
anatofuz
parents:
diff changeset
30
anatofuz
parents:
diff changeset
31 // CHECK-LABEL: define linkonce_odr hidden void @__destroy_helper_block_e8_32r40r(
anatofuz
parents:
diff changeset
32 void test() {
anatofuz
parents:
diff changeset
33 S s;
anatofuz
parents:
diff changeset
34 s.m();
anatofuz
parents:
diff changeset
35 }