1; RUN: llc < %s -asm-verbose=false -wasm-temporary-workarounds=false | FileCheck %s
2
3; Test that function pointer casts casting away varargs are replaced with
4; wrappers.
5
6target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
7target triple = "wasm32-unknown-unknown"
8
9define void @callWithArgs() {
10entry:
11  call void bitcast (void (...)* @underspecified to void (i32, i32)*)(i32 0, i32 1)
12  call void(...) bitcast (void (i32, i32)* @specified to void (...)*)(i32 0, i32 1)
13  ret void
14}
15
16declare void @underspecified(...)
17declare void @specified(i32, i32)
18
19; CHECK: callWithArgs:
20; CHECK: i32.const	$push1=, 0
21; CHECK-NEXT: i32.const	$push0=, 1
22; CHECK-NEXT: call    	.Lbitcast@FUNCTION, $pop1, $pop0
23; CHECK: call    	.Lbitcast.1@FUNCTION, $pop{{[0-9]+$}}
24
25; CHECK: .Lbitcast:
26; CHECK-NEXT: .param  	i32, i32{{$}}
27; CHECK: call    	underspecified@FUNCTION, $pop{{[0-9]+$}}
28
29; CHECK: .Lbitcast.1:
30; CHECK-NEXT: .param  	i32{{$}}
31; CHECK: call    	specified@FUNCTION, $pop{{[0-9]+}}, $pop{{[0-9]+$}}
32