1 ; RUN: opt -passes=instcombine -S < %s | FileCheck %s
2 ; RUN: opt -debugify-each -passes=instcombine -S < %s | FileCheck %s
4 ; These are both direct calls, but make sure instcombine leaves the casts
7 define i32 @call_thunk(i32 %x, i32 %y) {
8 %r = call i32 @inc_first_arg_thunk(i32 %x, i32 %y)
12 ; CHECK-LABEL: define i32 @call_thunk(i32 %x, i32 %y)
13 ; CHECK: %r = call i32 @inc_first_arg_thunk(i32 %x, i32 %y)
16 define internal void @inc_first_arg_thunk(i32 %arg1, ...) #0 {
18 %inc = add i32 %arg1, 1
19 musttail call void (i32, ...) @plus(i32 %inc, ...)
23 ; CHECK-LABEL: define internal void @inc_first_arg_thunk(i32 %arg1, ...) #0
24 ; CHECK: %inc = add i32 %arg1, 1
25 ; CHECK: musttail call void (i32, ...) @plus(i32 %inc, ...)
28 define internal i32 @plus(i32 %x, i32 %y) {
33 attributes #0 = { "thunk" }