annotate clang/test/CodeGenOpenCL/cast_image.cl @ 236:c4bab56944e8 llvm-original

LLVM 16
author kono
date Wed, 09 Nov 2022 17:45:10 +0900
parents 1d019706d866
children 1f2b6ac9f198
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
236
c4bab56944e8 LLVM 16
kono
parents: 150
diff changeset
1 // RUN: %clang_cc1 -no-opaque-pointers -emit-llvm -o - -triple amdgcn--amdhsa %s | FileCheck --check-prefix=AMDGCN %s
c4bab56944e8 LLVM 16
kono
parents: 150
diff changeset
2 // RUN: %clang_cc1 -no-opaque-pointers -emit-llvm -o - -triple spir-unknown-unknown %s | FileCheck --check-prefix=SPIR %s
150
anatofuz
parents:
diff changeset
3
anatofuz
parents:
diff changeset
4 #ifdef __AMDGCN__
anatofuz
parents:
diff changeset
5
anatofuz
parents:
diff changeset
6 constant int* convert(image2d_t img) {
anatofuz
parents:
diff changeset
7 // AMDGCN: bitcast %opencl.image2d_ro_t addrspace(4)* %img to i32 addrspace(4)*
anatofuz
parents:
diff changeset
8 return __builtin_astype(img, constant int*);
anatofuz
parents:
diff changeset
9 }
anatofuz
parents:
diff changeset
10
anatofuz
parents:
diff changeset
11 #else
anatofuz
parents:
diff changeset
12
anatofuz
parents:
diff changeset
13 global int* convert(image2d_t img) {
anatofuz
parents:
diff changeset
14 // SPIR: bitcast %opencl.image2d_ro_t addrspace(1)* %img to i32 addrspace(1)*
anatofuz
parents:
diff changeset
15 return __builtin_astype(img, global int*);
anatofuz
parents:
diff changeset
16 }
anatofuz
parents:
diff changeset
17
anatofuz
parents:
diff changeset
18 #endif