blob: 82030f377d9f8384e93634f9ef308c5b94ee9623 [file] [log] [blame]
Diana Picuse440f992016-06-23 09:19:16 +00001; RUN: not llc -march=amdgcn < %s 2>&1 | FileCheck %s
Matt Arsenaultfdcd39a2015-07-28 18:29:14 +00002
3; Make sure that AMDGPUPromoteAlloca doesn't crash if the called
4; function is a constantexpr cast of a function.
5
6declare void @foo(float*) #0
7declare void @foo.varargs(...) #0
8
Oliver Stannard7e7d9832016-02-02 13:52:43 +00009; CHECK: in function crash_call_constexpr_cast{{.*}}: unsupported call to function foo
Matt Arsenaultfdcd39a2015-07-28 18:29:14 +000010define void @crash_call_constexpr_cast() #0 {
11 %alloca = alloca i32
12 call void bitcast (void (float*)* @foo to void (i32*)*)(i32* %alloca) #0
13 ret void
14}
15
Diana Picuse440f992016-06-23 09:19:16 +000016; CHECK: in function crash_call_constexpr_cast{{.*}}: unsupported call to function foo.varargs
Matt Arsenaultfdcd39a2015-07-28 18:29:14 +000017define void @crash_call_constexpr_cast_varargs() #0 {
18 %alloca = alloca i32
19 call void bitcast (void (...)* @foo.varargs to void (i32*)*)(i32* %alloca) #0
20 ret void
21}
22
23attributes #0 = { nounwind }