Fangrui Song 728490257e [Sparc,test] Change llc -march= to -mtriple=
Similar to 806761a7629df268c8aed49657aeccffa6bca449

-mtriple= specifies the full target triple while -march= merely sets the
architecture part of the default target triple (e.g. Windows, macOS),
leaving a target triple which may not make sense.

Therefore, -march= is error-prone and not recommended for tests without a target
triple. The issue has been benign as we recognize sparc*-apple-darwin as ELF instead
of rejecting it outrightly.
2024-12-15 10:29:34 -08:00

107 lines
2.2 KiB
LLVM

; RUN: llc -mtriple=sparc -mcpu=v7 -O0 < %s | FileCheck %s
define i32 @test_mul32(i32 %a, i32 %b) #0 {
; CHECK-LABEL: test_mul32
; CHECK: call .umul
%m = mul i32 %a, %b
ret i32 %m
}
define i16 @test_mul16(i16 %a, i16 %b) #0 {
; CHECK-LABEL: test_mul16
; CHECK: call .umul
%m = mul i16 %a, %b
ret i16 %m
}
define i8 @test_mul8(i8 %a, i8 %b) #0 {
; CHECK-LABEL: test_mul8
; CHECK: call .umul
%m = mul i8 %a, %b
ret i8 %m
}
define i32 @test_sdiv32(i32 %a, i32 %b) #0 {
; CHECK-LABEL: test_sdiv32
; CHECK: call .div
%d = sdiv i32 %a, %b
ret i32 %d
}
define i16 @test_sdiv16(i16 %a, i16 %b) #0 {
; CHECK-LABEL: test_sdiv16
; CHECK: call .div
%d = sdiv i16 %a, %b
ret i16 %d
}
define i8 @test_sdiv8(i8 %a, i8 %b) #0 {
; CHECK-LABEL: test_sdiv8
; CHECK: call .div
%d = sdiv i8 %a, %b
ret i8 %d
}
define i32 @test_udiv32(i32 %a, i32 %b) #0 {
; CHECK-LABEL: test_udiv32
; CHECK: call .udiv
%d = udiv i32 %a, %b
ret i32 %d
}
define i16 @test_udiv16(i16 %a, i16 %b) #0 {
; CHECK-LABEL: test_udiv16
; CHECK: call .udiv
%d = udiv i16 %a, %b
ret i16 %d
}
define i8 @test_udiv8(i8 %a, i8 %b) #0 {
; CHECK-LABEL: test_udiv8
; CHECK: call .udiv
%d = udiv i8 %a, %b
ret i8 %d
}
define i32 @test_srem32(i32 %a, i32 %b) #0 {
; CHECK-LABEL: test_srem32
; CHECK: call .rem
%d = srem i32 %a, %b
ret i32 %d
}
define i16 @test_srem16(i16 %a, i16 %b) #0 {
; CHECK-LABEL: test_srem16
; CHECK: call .rem
%d = srem i16 %a, %b
ret i16 %d
}
define i8 @test_srem8(i8 %a, i8 %b) #0 {
; CHECK-LABEL: test_srem8
; CHECK: call .rem
%d = srem i8 %a, %b
ret i8 %d
}
define i32 @test_urem32(i32 %a, i32 %b) #0 {
; CHECK-LABEL: test_urem32
; CHECK: call .urem
%d = urem i32 %a, %b
ret i32 %d
}
define i16 @test_urem16(i16 %a, i16 %b) #0 {
; CHECK-LABEL: test_urem16
; CHECK: call .urem
%d = urem i16 %a, %b
ret i16 %d
}
define i8 @test_urem8(i8 %a, i8 %b) #0 {
; CHECK-LABEL: test_urem8
; CHECK: call .urem
%d = urem i8 %a, %b
ret i8 %d
}