1//RUN: %clang_cc1 %s -triple spir-unknown-unknown -cl-std=clc++ -emit-llvm -O0 -o - | FileCheck %s 2 3struct C { 4 void foo() __local; 5 void foo() __global; 6 void foo(); 7 void bar(); 8}; 9 10__global C c1; 11 12__kernel void k() { 13 __local C c2; 14 C c3; 15 __global C &c_ref = c1; 16 __global C *c_ptr; 17 18 // CHECK: call spir_func void @_ZNU3AS11C3fooEv(%struct.C addrspace(1)* 19 c1.foo(); 20 // CHECK: call spir_func void @_ZNU3AS31C3fooEv(%struct.C addrspace(3)* 21 c2.foo(); 22 // CHECK: call spir_func void @_ZNU3AS41C3fooEv(%struct.C addrspace(4)* 23 c3.foo(); 24 // CHECK: call spir_func void @_ZNU3AS11C3fooEv(%struct.C addrspace(1)* 25 c_ptr->foo(); 26 // CHECK: spir_func void @_ZNU3AS11C3fooEv(%struct.C addrspace(1)* 27 c_ref.foo(); 28 29 // CHECK: call spir_func void @_ZNU3AS41C3barEv(%struct.C addrspace(4)* {{[^,]*}} addrspacecast (%struct.C addrspace(1)* @c1 to %struct.C addrspace(4)*)) 30 c1.bar(); 31 //FIXME: Doesn't compile yet 32 //c_ptr->bar(); 33 // CHECK: call spir_func void @_ZNU3AS41C3barEv(%struct.C addrspace(4)* {{[^,]*}} addrspacecast (%struct.C addrspace(1)* @c1 to %struct.C addrspace(4)*)) 34 c_ref.bar(); 35} 36