aboutsummaryrefslogtreecommitdiff
path: root/test/CodeGen/AMDGPU/promote-alloca-bitcast-function.ll
blob: a5eb92de9e4b526e9ed574c4915810494fc004b7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
; RUN: not llc -march=amdgcn < %s 2>&1 | FileCheck %s

; Make sure that AMDGPUPromoteAlloca doesn't crash if the called
; function is a constantexpr cast of a function.

declare void @foo(float*) #0
declare void @foo.varargs(...) #0

; CHECK: in function crash_call_constexpr_cast{{.*}}: unsupported call to function foo
define amdgpu_kernel void @crash_call_constexpr_cast() #0 {
  %alloca = alloca i32
  call void bitcast (void (float*)* @foo to void (i32*)*)(i32* %alloca) #0
  ret void
}

; CHECK: in function crash_call_constexpr_cast{{.*}}: unsupported call to function foo.varargs
define amdgpu_kernel void @crash_call_constexpr_cast_varargs() #0 {
  %alloca = alloca i32
  call void bitcast (void (...)* @foo.varargs to void (i32*)*)(i32* %alloca) #0
  ret void
}

attributes #0 = { nounwind }