Files
clang-p2996/llvm/test/CodeGen/XCore/store.ll
Fangrui Song f1987c74ee [XCore,test] Change llc -march= to -mtriple=
Similar to 806761a762

-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 xcore-apple-darwin as ELF instead
of rejecting it outrightly.
2024-12-15 10:31:38 -08:00

38 lines
868 B
LLVM

; RUN: llc < %s -mtriple=xcore | FileCheck %s
define void @store32(ptr %p, i32 %offset, i32 %val) nounwind {
entry:
; CHECK-LABEL: store32:
; CHECK: stw r2, r0[r1]
%0 = getelementptr i32, ptr %p, i32 %offset
store i32 %val, ptr %0, align 4
ret void
}
define void @store32_imm(ptr %p, i32 %val) nounwind {
entry:
; CHECK-LABEL: store32_imm:
; CHECK: stw r1, r0[11]
%0 = getelementptr i32, ptr %p, i32 11
store i32 %val, ptr %0, align 4
ret void
}
define void @store16(ptr %p, i32 %offset, i16 %val) nounwind {
entry:
; CHECK-LABEL: store16:
; CHECK: st16 r2, r0[r1]
%0 = getelementptr i16, ptr %p, i32 %offset
store i16 %val, ptr %0, align 2
ret void
}
define void @store8(ptr %p, i32 %offset, i8 %val) nounwind {
entry:
; CHECK-LABEL: store8:
; CHECK: st8 r2, r0[r1]
%0 = getelementptr i8, ptr %p, i32 %offset
store i8 %val, ptr %0, align 1
ret void
}