llvm-project/llvm/test/CodeGen/AVR/unaligned-atomic-ops.ll
Fangrui Song 9ef1d37ffb [AVR,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, 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 avr-apple-darwin as ELF instead
of rejecting it outrightly.
2024-12-15 10:26:33 -08:00

21 lines
588 B
LLVM

; RUN: llc -mattr=addsubiw < %s -mtriple=avr | FileCheck %s
; This verifies that the backend can handle an unaligned atomic load and store.
;
; In the past, an assertion inside the SelectionDAGBuilder would always
; hit an assertion for unaligned loads and stores.
%AtomicI16 = type { %CellI16, [0 x i8] }
%CellI16 = type { i16, [0 x i8] }
; CHECK-LABEL: foo
; CHECK: ret
define void @foo(ptr %self) {
start:
%a = getelementptr inbounds %AtomicI16, ptr %self, i16 0, i32 0, i32 0
load atomic i16, ptr %a seq_cst, align 1
store atomic i16 5, ptr %a seq_cst, align 1
ret void
}