xref: /llvm-project/llvm/test/CodeGen/WebAssembly/frem.ll (revision 122b0220fd45ee71acda912b0b712bb8edb6ba46)
1; RUN: llc < %s -asm-verbose=false -disable-wasm-fallthrough-return-opt -wasm-disable-explicit-locals -wasm-keep-registers | FileCheck %s
2
3; Test that the frem instruction works.
4
5target triple = "wasm32-unknown-unknown"
6
7; CHECK-LABEL: frem32:
8; CHECK-NEXT: .functype frem32 (f32, f32) -> (f32){{$}}
9; CHECK-NEXT: {{^}} call $push0=, fmodf, $0, $1{{$}}
10; CHECK-NEXT: return $pop0{{$}}
11define float @frem32(float %x, float %y) {
12  %a = frem float %x, %y
13  ret float %a
14}
15
16; CHECK-LABEL: frem64:
17; CHECK-NEXT: .functype frem64 (f64, f64) -> (f64){{$}}
18; CHECK-NEXT: {{^}} call $push0=, fmod, $0, $1{{$}}
19; CHECK-NEXT: return $pop0{{$}}
20define double @frem64(double %x, double %y) {
21  %a = frem double %x, %y
22  ret double %a
23}
24