1 ; RUN: llc < %s -asm-verbose=false -wasm-keep-registers | FileCheck %s
3 ; Test that function pointer casts casting away varargs are replaced with
6 target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
7 target triple = "wasm32-unknown-unknown"
9 define void @callWithArgs() {
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)
16 declare void @underspecified(...)
17 declare void @specified(i32, i32)
19 ; CHECK: callWithArgs:
20 ; CHECK: i32.const $push1=, 0
21 ; CHECK-NEXT: i32.const $push0=, 1
22 ; CHECK-NEXT: call .Lunderspecified_bitcast, $pop1, $pop0
23 ; CHECK: call .Lspecified_bitcast, $pop{{[0-9]+$}}
25 ; CHECK: .Lunderspecified_bitcast:
26 ; CHECK-NEXT: .functype .Lunderspecified_bitcast (i32, i32) -> (){{$}}
27 ; CHECK: call underspecified, $pop{{[0-9]+$}}
29 ; CHECK: .Lspecified_bitcast:
30 ; CHECK-NEXT: .functype .Lspecified_bitcast (i32) -> (){{$}}
31 ; CHECK: call specified, $pop{{[0-9]+}}, $pop{{[0-9]+$}}