1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2; RUN: llc -mtriple=riscv32 -verify-machineinstrs < %s \
3; RUN:   | FileCheck -check-prefix=RV32I %s
4; RUN: llc -mtriple=riscv32 -mattr=+a -verify-machineinstrs < %s \
5; RUN:   | FileCheck -check-prefix=RV32I %s
6; RUN: llc -mtriple=riscv64 -verify-machineinstrs < %s \
7; RUN:   | FileCheck -check-prefix=RV64I %s
8; RUN: llc -mtriple=riscv64 -mattr=+a -verify-machineinstrs < %s \
9; RUN:   | FileCheck -check-prefix=RV64I %s
10
11define void @fence_acquire() nounwind {
12; RV32I-LABEL: fence_acquire:
13; RV32I:       # %bb.0:
14; RV32I-NEXT:    fence r, rw
15; RV32I-NEXT:    ret
16;
17; RV64I-LABEL: fence_acquire:
18; RV64I:       # %bb.0:
19; RV64I-NEXT:    fence r, rw
20; RV64I-NEXT:    ret
21  fence acquire
22  ret void
23}
24
25define void @fence_release() nounwind {
26; RV32I-LABEL: fence_release:
27; RV32I:       # %bb.0:
28; RV32I-NEXT:    fence rw, w
29; RV32I-NEXT:    ret
30;
31; RV64I-LABEL: fence_release:
32; RV64I:       # %bb.0:
33; RV64I-NEXT:    fence rw, w
34; RV64I-NEXT:    ret
35  fence release
36  ret void
37}
38
39define void @fence_acq_rel() nounwind {
40; RV32I-LABEL: fence_acq_rel:
41; RV32I:       # %bb.0:
42; RV32I-NEXT:    fence.tso
43; RV32I-NEXT:    ret
44;
45; RV64I-LABEL: fence_acq_rel:
46; RV64I:       # %bb.0:
47; RV64I-NEXT:    fence.tso
48; RV64I-NEXT:    ret
49  fence acq_rel
50  ret void
51}
52
53define void @fence_seq_cst() nounwind {
54; RV32I-LABEL: fence_seq_cst:
55; RV32I:       # %bb.0:
56; RV32I-NEXT:    fence rw, rw
57; RV32I-NEXT:    ret
58;
59; RV64I-LABEL: fence_seq_cst:
60; RV64I:       # %bb.0:
61; RV64I-NEXT:    fence rw, rw
62; RV64I-NEXT:    ret
63  fence seq_cst
64  ret void
65}
66