[clang] Handle __declspec() attributes in using
[llvm-project.git] / clang / test / CodeGenOpenCLCXX / address-space-castoperators.cpp
blob4aaa05e2606496ffef6fa7aa8d2c4f9c45c14b18
1 // RUN: %clang_cc1 %s -triple spir-unknown-unknown -cl-std=clc++ -emit-llvm -O0 -o - | FileCheck %s
3 void test_reinterpret_cast(){
4 __private float x;
5 __private float& y = x;
6 // We don't need bitcast to cast pointer type and
7 // address space at the same time.
8 //CHECK: addrspacecast ptr %x to ptr addrspace(4)
9 //CHECK: [[REG:%[0-9]+]] = load ptr, ptr %y
10 //CHECK: addrspacecast ptr [[REG]] to ptr addrspace(4)
11 //CHECK-NOT: bitcast
12 __generic int& rc1 = reinterpret_cast<__generic int&>(x);
13 __generic int& rc2 = reinterpret_cast<__generic int&>(y);