Home | History | Annotate | Download | only in AMDGPU
      1 ; RUN: not llc -march=amdgcn < %s 2>&1 | FileCheck %s
      2 
      3 ; FIXME: Error is misleading because it's not an indirect call.
      4 
      5 ; CHECK: error: <unknown>:0:0: in function crash_call_constexpr_cast void (): unsupported indirect call to function foo
      6 
      7 ; Make sure that AMDGPUPromoteAlloca doesn't crash if the called
      8 ; function is a constantexpr cast of a function.
      9 
     10 declare void @foo(float addrspace(5)*) #0
     11 declare void @foo.varargs(...) #0
     12 
     13 ; XCHECK: in function crash_call_constexpr_cast{{.*}}: unsupported call to function foo
     14 define amdgpu_kernel void @crash_call_constexpr_cast() #0 {
     15   %alloca = alloca i32, addrspace(5)
     16   call void bitcast (void (float addrspace(5)*)* @foo to void (i32 addrspace(5)*)*)(i32 addrspace(5)* %alloca) #0
     17   ret void
     18 }
     19 
     20 ; XCHECK: in function crash_call_constexpr_cast{{.*}}: unsupported call to function foo.varargs
     21 define amdgpu_kernel void @crash_call_constexpr_cast_varargs() #0 {
     22   %alloca = alloca i32, addrspace(5)
     23   call void bitcast (void (...)* @foo.varargs to void (i32 addrspace(5)*)*)(i32 addrspace(5)* %alloca) #0
     24   ret void
     25 }
     26 
     27 attributes #0 = { nounwind }
     28