Files
clang-p2996/llvm/test/CodeGen/XCore/unaligned_load.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

35 lines
738 B
LLVM

; RUN: llc < %s -mtriple=xcore | FileCheck %s
; Byte aligned load.
; CHECK: align1
; CHECK: bl __misaligned_load
define i32 @align1(ptr %p) nounwind {
entry:
%0 = load i32, ptr %p, align 1 ; <i32> [#uses=1]
ret i32 %0
}
; Half word aligned load.
; CHECK-LABEL: align2:
; CHECK: ld16s
; CHECK: ld16s
; CHECK: or
define i32 @align2(ptr %p) nounwind {
entry:
%0 = load i32, ptr %p, align 2 ; <i32> [#uses=1]
ret i32 %0
}
@a = global [5 x i8] zeroinitializer, align 4
; Constant offset from word aligned base.
; CHECK-LABEL: align3:
; CHECK: ldw {{r[0-9]+}}, dp
; CHECK: ldw {{r[0-9]+}}, dp
; CHECK: or
define i32 @align3() nounwind {
entry:
%0 = load i32, ptr getelementptr ([5 x i8], ptr @a, i32 0, i32 1), align 1
ret i32 %0
}