Skip to content

Commit eabda06

Browse files
committed
add m68k filecheck test showing iselect failure for non-ARI atomic store
1 parent f4172f6 commit eabda06

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5
2+
; RUN: llc %s -o - -mtriple=m68k -mcpu=M68000 | FileCheck %s --check-prefix=NO-ATOMIC
3+
; RUN: llc %s -o - -mtriple=m68k -mcpu=M68010 | FileCheck %s --check-prefix=NO-ATOMIC
4+
; RUN: llc %s -o - -mtriple=m68k -mcpu=M68020 | FileCheck %s --check-prefix=ATOMIC
5+
; RUN: llc %s -o - -mtriple=m68k -mcpu=M68030 | FileCheck %s --check-prefix=ATOMIC
6+
; RUN: llc %s -o - -mtriple=m68k -mcpu=M68040 | FileCheck %s --check-prefix=ATOMIC
7+
8+
define void @atomic_store_i8_element_monotonic(i8 %val, ptr %base, i32 %offset) nounwind {
9+
; NO-ATOMIC-LABEL: atomic_store_i8_element_monotonic:
10+
; NO-ATOMIC: ; %bb.0:
11+
; NO-ATOMIC-NEXT: move.b (7,%sp), %d0
12+
; NO-ATOMIC-NEXT: move.l (12,%sp), %d1
13+
; NO-ATOMIC-NEXT: move.l (8,%sp), %a0
14+
; NO-ATOMIC-NEXT: move.b %d0, (0,%a0,%d1)
15+
; NO-ATOMIC-NEXT: rts
16+
;
17+
; ATOMIC-LABEL: atomic_store_i8_element_monotonic:
18+
; ATOMIC: ; %bb.0:
19+
; ATOMIC-NEXT: move.b (7,%sp), %d0
20+
; ATOMIC-NEXT: move.l (12,%sp), %d1
21+
; ATOMIC-NEXT: move.l (8,%sp), %a0
22+
; ATOMIC-NEXT: move.b %d0, (0,%a0,%d1)
23+
; ATOMIC-NEXT: rts
24+
%store_pointer = getelementptr i8, ptr %base, i32 %offset
25+
store atomic i8 %val, ptr %store_pointer monotonic, align 1
26+
ret void
27+
}
28+
29+
define i8 @atomic_load_i8_element_monotonic(ptr %base, i32 %offset) nounwind {
30+
; NO-ATOMIC-LABEL: atomic_load_i8_element_monotonic:
31+
; NO-ATOMIC: ; %bb.0:
32+
; NO-ATOMIC-NEXT: move.l (8,%sp), %d0
33+
; NO-ATOMIC-NEXT: move.l (4,%sp), %a0
34+
; NO-ATOMIC-NEXT: move.b (0,%a0,%d0), %d0
35+
; NO-ATOMIC-NEXT: rts
36+
;
37+
; ATOMIC-LABEL: atomic_load_i8_element_monotonic:
38+
; ATOMIC: ; %bb.0:
39+
; ATOMIC-NEXT: move.l (8,%sp), %d0
40+
; ATOMIC-NEXT: move.l (4,%sp), %a0
41+
; ATOMIC-NEXT: move.b (0,%a0,%d0), %d0
42+
; ATOMIC-NEXT: rts
43+
%load_pointer = getelementptr i8, ptr %base, i32 %offset
44+
%return_val = load atomic i8, ptr %load_pointer monotonic, align 1
45+
ret i8 %return_val
46+
}

0 commit comments

Comments
 (0)