1 // RUN: %clang_cc1 %s -triple spir -emit-llvm -O0 -o - | FileCheck %s
9 int getmb() { return mb; }
15 //CHECK: addrspacecast ptr %d to ptr addrspace(4)
16 //CHECK: call spir_func noundef i32 @_ZNU3AS41D5getmbEv(ptr addrspace(4)
20 //Derived and Base are in the same address space.
22 //CHECK: define linkonce_odr spir_func noundef i32 @_ZNU3AS41D5getmbEv(ptr addrspace(4) {{[^,]*}} %this)
25 // Calling base method through multiple inheritance.
29 void baseMethod() const { }
30 int &getRef() { return bb; }
34 class Derived : public B, public B2 {
36 void work() const { baseMethod(); }
40 void pr43145(const Derived *argDerived) {
44 // Casting from base to derived.
46 void pr43145_2(B *argB) {
47 Derived *x = (Derived*)argB;
48 // CHECK-LABEL: @_Z9pr43145_2
51 // Assigning to reference returned by base class method through derived class.
53 void pr43145_3(int n) {
57 // CHECK-LABEL: @_Z9pr43145_3
58 // CHECK: addrspacecast ptr %d to ptr addrspace(4)
59 // CHECK: call {{.*}} @_ZNU3AS42B26getRefEv
61 private Derived *pd = &d;
64 // CHECK: addrspacecast ptr %2 to ptr addrspace(4)
65 // CHECK: call {{.*}} @_ZNU3AS42B26getRefEv
68 // Implicit conversion of derived to base.
70 void functionWithBaseArgPtr(class B2 *b) {}
71 void functionWithBaseArgRef(class B2 &b) {}
75 functionWithBaseArgPtr(&d);
76 functionWithBaseArgRef(d);