[PowerPC] Recommit r314244 with refactoring and off by default
[llvm-core.git] / test / CodeGen / AMDGPU / promote-alloca-bitcast-function.ll
blobb440efc808282d3ca7032a10fd7945eeb677f222
1 ; RUN: not llc -march=amdgcn < %s 2>&1 | FileCheck %s
3 ; FIXME: Error is misleading because it's not an indirect call.
5 ; CHECK: error: <unknown>:0:0: in function crash_call_constexpr_cast void (): unsupported indirect call to function foo
7 ; Make sure that AMDGPUPromoteAlloca doesn't crash if the called
8 ; function is a constantexpr cast of a function.
10 declare void @foo(float*) #0
11 declare void @foo.varargs(...) #0
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
16   call void bitcast (void (float*)* @foo to void (i32*)*)(i32* %alloca) #0
17   ret void
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
23   call void bitcast (void (...)* @foo.varargs to void (i32*)*)(i32* %alloca) #0
24   ret void
27 attributes #0 = { nounwind }