xref: /llvm-project/llvm/test/CodeGen/Hexagon/atomic-store-byte.ll (revision a96f691985c8546e826012fdc3481c88f034a194)
1; RUN: llc -mtriple=hexagon < %s | FileCheck %s
2
3; Test that the address for a store conditional for a byte is aligned
4; correctly to use the memw_locked instruction.
5
6; CHECK: [[REG:(r[0-9]+)]] = and(r{{[0-9]+}},#-4)
7; CHECK: = memw_locked([[REG]])
8; CHECK: memw_locked([[REG]],p{{[0-4]}}) =
9
10@foo.a00 = internal global i8 0, align 1
11
12; Function Attrs: nofree norecurse nounwind
13define dso_local void @foo() local_unnamed_addr #0 {
14entry:
15  %0 = cmpxchg volatile ptr @foo.a00, i8 0, i8 1 seq_cst seq_cst
16  ret void
17}
18
19