Mercurial > hg > CbC > CbC_llvm
comparison clang/test/CodeGenOpenCL/cast_image.cl @ 252:1f2b6ac9f198 llvm-original
LLVM16-1
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Fri, 18 Aug 2023 09:04:13 +0900 |
parents | c4bab56944e8 |
children |
comparison
equal
deleted
inserted
replaced
237:c80f45b162ad | 252:1f2b6ac9f198 |
---|---|
1 // RUN: %clang_cc1 -no-opaque-pointers -emit-llvm -o - -triple amdgcn--amdhsa %s | FileCheck --check-prefix=AMDGCN %s | 1 // RUN: %clang_cc1 -emit-llvm -o - -triple amdgcn--amdhsa %s | FileCheck --check-prefix=AMDGCN %s |
2 // RUN: %clang_cc1 -no-opaque-pointers -emit-llvm -o - -triple spir-unknown-unknown %s | FileCheck --check-prefix=SPIR %s | 2 // RUN: %clang_cc1 -emit-llvm -o - -triple x86_64-unknown-unknown %s | FileCheck --check-prefix=X86 %s |
3 | 3 |
4 #ifdef __AMDGCN__ | 4 #ifdef __AMDGCN__ |
5 | 5 |
6 constant int* convert(image2d_t img) { | 6 constant int* convert(image2d_t img) { |
7 // AMDGCN: bitcast %opencl.image2d_ro_t addrspace(4)* %img to i32 addrspace(4)* | 7 // AMDGCN: ret ptr addrspace(4) %img |
8 return __builtin_astype(img, constant int*); | 8 return __builtin_astype(img, constant int*); |
9 } | 9 } |
10 | 10 |
11 #else | 11 #else |
12 | 12 |
13 global int* convert(image2d_t img) { | 13 global int* convert(image2d_t img) { |
14 // SPIR: bitcast %opencl.image2d_ro_t addrspace(1)* %img to i32 addrspace(1)* | 14 // X86: ret ptr %img |
15 return __builtin_astype(img, global int*); | 15 return __builtin_astype(img, global int*); |
16 } | 16 } |
17 | 17 |
18 #endif | 18 #endif |