llvm/clang/test/CodeGenOpenCLCXX/addrspace_cast.clcpp

//RUN: %clang_cc1 %s -triple spir -emit-llvm -O0 -o - | FileCheck %s

//CHECK-LABEL: define{{.*}} spir_func void @_Z3barPU3AS1i
void bar(global int *gl) {
  //CHECK: addrspacecast ptr addrspace(1) %{{[0-9]+}} to ptr addrspace(4)
  int *gen = addrspace_cast<int *>(gl);
}