Diana Picus | e440f99 | 2016-06-23 09:19:16 +0000 | [diff] [blame] | 1 | ; RUN: not llc -march=amdgcn < %s 2>&1 | FileCheck %s |
Matt Arsenault | fdcd39a | 2015-07-28 18:29:14 +0000 | [diff] [blame] | 2 | |
| 3 | ; Make sure that AMDGPUPromoteAlloca doesn't crash if the called |
| 4 | ; function is a constantexpr cast of a function. |
| 5 | |
| 6 | declare void @foo(float*) #0 |
| 7 | declare void @foo.varargs(...) #0 |
| 8 | |
Oliver Stannard | 7e7d983 | 2016-02-02 13:52:43 +0000 | [diff] [blame] | 9 | ; CHECK: in function crash_call_constexpr_cast{{.*}}: unsupported call to function foo |
Matt Arsenault | 3dbeefa | 2017-03-21 21:39:51 +0000 | [diff] [blame^] | 10 | define amdgpu_kernel void @crash_call_constexpr_cast() #0 { |
Matt Arsenault | fdcd39a | 2015-07-28 18:29:14 +0000 | [diff] [blame] | 11 | %alloca = alloca i32 |
| 12 | call void bitcast (void (float*)* @foo to void (i32*)*)(i32* %alloca) #0 |
| 13 | ret void |
| 14 | } |
| 15 | |
Diana Picus | e440f99 | 2016-06-23 09:19:16 +0000 | [diff] [blame] | 16 | ; CHECK: in function crash_call_constexpr_cast{{.*}}: unsupported call to function foo.varargs |
Matt Arsenault | 3dbeefa | 2017-03-21 21:39:51 +0000 | [diff] [blame^] | 17 | define amdgpu_kernel void @crash_call_constexpr_cast_varargs() #0 { |
Matt Arsenault | fdcd39a | 2015-07-28 18:29:14 +0000 | [diff] [blame] | 18 | %alloca = alloca i32 |
| 19 | call void bitcast (void (...)* @foo.varargs to void (i32*)*)(i32* %alloca) #0 |
| 20 | ret void |
| 21 | } |
| 22 | |
| 23 | attributes #0 = { nounwind } |