xref: /llvm-project/llvm/test/CodeGen/X86/ldexp-wrong-signature.ll (revision eece6ba283bd763e6d7109ae9e155e81cfee0651)
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 2
2; RUN: llc < %s -mtriple=x86_64-unknown-unknown | FileCheck %s
3; RUN: llc < %s -mtriple=i386-pc-win32 | FileCheck %s -check-prefix=CHECK-WIN
4
5define float @ldexpf_too_many_args(float %a, i32 %b, i32 %c) {
6; CHECK-LABEL: ldexpf_too_many_args:
7; CHECK:       # %bb.0:
8; CHECK-NEXT:    pushq %rax
9; CHECK-NEXT:    .cfi_def_cfa_offset 16
10; CHECK-NEXT:    callq ldexpf@PLT
11; CHECK-NEXT:    popq %rax
12; CHECK-NEXT:    .cfi_def_cfa_offset 8
13; CHECK-NEXT:    retq
14;
15; CHECK-WIN-LABEL: ldexpf_too_many_args:
16; CHECK-WIN:       # %bb.0:
17; CHECK-WIN-NEXT:    subl $12, %esp
18; CHECK-WIN-NEXT:    flds {{[0-9]+}}(%esp)
19; CHECK-WIN-NEXT:    movl {{[0-9]+}}(%esp), %eax
20; CHECK-WIN-NEXT:    movl {{[0-9]+}}(%esp), %ecx
21; CHECK-WIN-NEXT:    movl %ecx, {{[0-9]+}}(%esp)
22; CHECK-WIN-NEXT:    movl %eax, {{[0-9]+}}(%esp)
23; CHECK-WIN-NEXT:    fstps (%esp)
24; CHECK-WIN-NEXT:    calll _ldexpf
25; CHECK-WIN-NEXT:    addl $12, %esp
26; CHECK-WIN-NEXT:    retl
27  %result = call float @ldexpf(float %a, i32 %b, i32 %c) #0
28  ret float %result
29}
30
31define float @ldexp_wrong_fp_type(float %a, i32 %b) {
32; CHECK-LABEL: ldexp_wrong_fp_type:
33; CHECK:       # %bb.0:
34; CHECK-NEXT:    pushq %rax
35; CHECK-NEXT:    .cfi_def_cfa_offset 16
36; CHECK-NEXT:    callq ldexp@PLT
37; CHECK-NEXT:    popq %rax
38; CHECK-NEXT:    .cfi_def_cfa_offset 8
39; CHECK-NEXT:    retq
40;
41; CHECK-WIN-LABEL: ldexp_wrong_fp_type:
42; CHECK-WIN:       # %bb.0:
43; CHECK-WIN-NEXT:    subl $8, %esp
44; CHECK-WIN-NEXT:    flds {{[0-9]+}}(%esp)
45; CHECK-WIN-NEXT:    movl {{[0-9]+}}(%esp), %eax
46; CHECK-WIN-NEXT:    movl %eax, {{[0-9]+}}(%esp)
47; CHECK-WIN-NEXT:    fstps (%esp)
48; CHECK-WIN-NEXT:    calll _ldexp
49; CHECK-WIN-NEXT:    addl $8, %esp
50; CHECK-WIN-NEXT:    retl
51  %result = call float @ldexp(float %a, i32 %b) #0
52  ret float %result
53}
54
55declare float @ldexpf(float, i32, i32) #0
56declare float @ldexp(float, i32) #0
57
58attributes #0 = { nounwind readnone }
59