1 ; RUN: llc < %s -asm-verbose=false -wasm-keep-registers | FileCheck %s
3 ; Test that integer div and rem by constant are optimized appropriately.
5 target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
6 target triple = "wasm32-unknown-unknown"
8 ; CHECK-LABEL: test_udiv_2:
10 define i32 @test_udiv_2(i32 %x) {
15 ; CHECK-LABEL: test_udiv_5:
17 define i32 @test_udiv_5(i32 %x) {
22 ; CHECK-LABEL: test_sdiv_2:
24 define i32 @test_sdiv_2(i32 %x) {
29 ; CHECK-LABEL: test_sdiv_5:
31 define i32 @test_sdiv_5(i32 %x) {
36 ; CHECK-LABEL: test_urem_2:
38 define i32 @test_urem_2(i32 %x) {
43 ; CHECK-LABEL: test_urem_5:
45 define i32 @test_urem_5(i32 %x) {
50 ; CHECK-LABEL: test_srem_2:
52 define i32 @test_srem_2(i32 %x) {
57 ; CHECK-LABEL: test_srem_5:
59 define i32 @test_srem_5(i32 %x) {