annotate clang/test/CodeGenCXX/address-space-cast.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 2e18cbf3894f
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
150
anatofuz
parents:
diff changeset
1 // RUN: %clang_cc1 %s -triple=amdgcn-amd-amdhsa -emit-llvm -o - | FileCheck %s
anatofuz
parents:
diff changeset
2
anatofuz
parents:
diff changeset
3 #define __private__ __attribute__((address_space(5)))
anatofuz
parents:
diff changeset
4
anatofuz
parents:
diff changeset
5 void func_pchar(__private__ char *x);
anatofuz
parents:
diff changeset
6 void func_pvoid(__private__ void *x);
anatofuz
parents:
diff changeset
7 void func_pint(__private__ int *x);
anatofuz
parents:
diff changeset
8
anatofuz
parents:
diff changeset
9 void test_cast(char *gen_char_ptr, void *gen_void_ptr, int *gen_int_ptr) {
anatofuz
parents:
diff changeset
10 // CHECK: %[[cast:.*]] = addrspacecast i8* %{{.*}} to i8 addrspace(5)*
anatofuz
parents:
diff changeset
11 // CHECK-NEXT: store i8 addrspace(5)* %[[cast]]
anatofuz
parents:
diff changeset
12 __private__ char *priv_char_ptr = (__private__ char *)gen_char_ptr;
anatofuz
parents:
diff changeset
13
anatofuz
parents:
diff changeset
14 // CHECK: %[[cast:.*]] = addrspacecast i8* %{{.*}} to i8 addrspace(5)*
anatofuz
parents:
diff changeset
15 // CHECK-NEXT: store i8 addrspace(5)* %[[cast]]
anatofuz
parents:
diff changeset
16 priv_char_ptr = (__private__ char *)gen_void_ptr;
anatofuz
parents:
diff changeset
17
anatofuz
parents:
diff changeset
18 // CHECK: %[[cast:.*]] = addrspacecast i32* %{{.*}} to i8 addrspace(5)*
anatofuz
parents:
diff changeset
19 // CHECK-NEXT: store i8 addrspace(5)* %[[cast]]
anatofuz
parents:
diff changeset
20 priv_char_ptr = (__private__ char *)gen_int_ptr;
anatofuz
parents:
diff changeset
21
anatofuz
parents:
diff changeset
22 // CHECK: %[[cast:.*]] = addrspacecast i8* %{{.*}} to i8 addrspace(5)*
anatofuz
parents:
diff changeset
23 // CHECK-NEXT: store i8 addrspace(5)* %[[cast]]
anatofuz
parents:
diff changeset
24 __private__ void *priv_void_ptr = (__private__ void *)gen_char_ptr;
anatofuz
parents:
diff changeset
25
anatofuz
parents:
diff changeset
26 // CHECK: %[[cast:.*]] = addrspacecast i8* %{{.*}} to i8 addrspace(5)*
anatofuz
parents:
diff changeset
27 // CHECK-NEXT: store i8 addrspace(5)* %[[cast]]
anatofuz
parents:
diff changeset
28 priv_void_ptr = (__private__ void *)gen_void_ptr;
anatofuz
parents:
diff changeset
29
anatofuz
parents:
diff changeset
30 // CHECK: %[[cast:.*]] = addrspacecast i32* %{{.*}} to i8 addrspace(5)*
anatofuz
parents:
diff changeset
31 // CHECK-NEXT: store i8 addrspace(5)* %[[cast]]
anatofuz
parents:
diff changeset
32 priv_void_ptr = (__private__ void *)gen_int_ptr;
anatofuz
parents:
diff changeset
33
anatofuz
parents:
diff changeset
34 // CHECK: %[[cast:.*]] = addrspacecast i8* %{{.*}} to i32 addrspace(5)*
anatofuz
parents:
diff changeset
35 // CHECK-NEXT: store i32 addrspace(5)* %[[cast]]
anatofuz
parents:
diff changeset
36 __private__ int *priv_int_ptr = (__private__ int *)gen_void_ptr;
anatofuz
parents:
diff changeset
37
anatofuz
parents:
diff changeset
38 // CHECK: %[[cast:.*]] = addrspacecast i8* %{{.*}} to i8 addrspace(5)*
anatofuz
parents:
diff changeset
39 // CHECK-NEXT: call void @_Z10func_pcharPU3AS5c(i8 addrspace(5)* %[[cast]])
anatofuz
parents:
diff changeset
40 func_pchar((__private__ char *)gen_char_ptr);
anatofuz
parents:
diff changeset
41
anatofuz
parents:
diff changeset
42 // CHECK: %[[cast:.*]] = addrspacecast i8* %{{.*}} to i8 addrspace(5)*
anatofuz
parents:
diff changeset
43 // CHECK-NEXT: call void @_Z10func_pcharPU3AS5c(i8 addrspace(5)* %[[cast]])
anatofuz
parents:
diff changeset
44 func_pchar((__private__ char *)gen_void_ptr);
anatofuz
parents:
diff changeset
45
anatofuz
parents:
diff changeset
46 // CHECK: %[[cast:.*]] = addrspacecast i32* %{{.*}} to i8 addrspace(5)*
anatofuz
parents:
diff changeset
47 // CHECK-NEXT: call void @_Z10func_pcharPU3AS5c(i8 addrspace(5)* %[[cast]])
anatofuz
parents:
diff changeset
48 func_pchar((__private__ char *)gen_int_ptr);
anatofuz
parents:
diff changeset
49
anatofuz
parents:
diff changeset
50 // CHECK: %[[cast:.*]] = addrspacecast i8* %{{.*}} to i8 addrspace(5)*
anatofuz
parents:
diff changeset
51 // CHECK-NEXT: call void @_Z10func_pvoidPU3AS5v(i8 addrspace(5)* %[[cast]])
anatofuz
parents:
diff changeset
52 func_pvoid((__private__ void *)gen_char_ptr);
anatofuz
parents:
diff changeset
53
anatofuz
parents:
diff changeset
54 // CHECK: %[[cast:.*]] = addrspacecast i8* %{{.*}} to i8 addrspace(5)*
anatofuz
parents:
diff changeset
55 // CHECK-NEXT: call void @_Z10func_pvoidPU3AS5v(i8 addrspace(5)* %[[cast]])
anatofuz
parents:
diff changeset
56 func_pvoid((__private__ void *)gen_void_ptr);
anatofuz
parents:
diff changeset
57
anatofuz
parents:
diff changeset
58 // CHECK: %[[cast:.*]] = addrspacecast i32* %{{.*}} to i8 addrspace(5)*
anatofuz
parents:
diff changeset
59 // CHECK-NEXT: call void @_Z10func_pvoidPU3AS5v(i8 addrspace(5)* %[[cast]])
anatofuz
parents:
diff changeset
60 func_pvoid((__private__ void *)gen_int_ptr);
anatofuz
parents:
diff changeset
61
anatofuz
parents:
diff changeset
62 // CHECK: %[[cast:.*]] = addrspacecast i8* %{{.*}} to i32 addrspace(5)*
anatofuz
parents:
diff changeset
63 // CHECK-NEXT: call void @_Z9func_pintPU3AS5i(i32 addrspace(5)* %[[cast]])
anatofuz
parents:
diff changeset
64 func_pint((__private__ int *)gen_void_ptr);
anatofuz
parents:
diff changeset
65 }