19 lines · plain
1// RUN: %clang_cc1 -emit-llvm -o - -triple amdgcn--amdhsa %s | FileCheck --check-prefix=AMDGCN %s2// RUN: %clang_cc1 -emit-llvm -o - -triple x86_64-unknown-unknown %s | FileCheck --check-prefix=X86 %s3 4#ifdef __AMDGCN__5 6constant int* convert(image2d_t img) {7 // AMDGCN: ret ptr addrspace(4) %img8 return __builtin_astype(img, constant int*);9}10 11#else12 13global int* convert(image2d_t img) {14 // X86: ret ptr %img15 return __builtin_astype(img, global int*);16}17 18#endif19