• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: opt < %s | opt -S | FileCheck %s
2; Basic smoke test for atomic operations.
3
4define void @f(i32* %x) {
5  ; CHECK: load atomic i32* %x unordered, align 4
6  load atomic i32* %x unordered, align 4
7  ; CHECK: load atomic volatile i32* %x singlethread acquire, align 4
8  load atomic volatile i32* %x singlethread acquire, align 4
9  ; CHECK: store atomic i32 3, i32* %x release, align 4
10  store atomic i32 3, i32* %x release, align 4
11  ; CHECK: store atomic volatile i32 3, i32* %x singlethread monotonic, align 4
12  store atomic volatile i32 3, i32* %x singlethread monotonic, align 4
13  ; CHECK: cmpxchg i32* %x, i32 1, i32 0 singlethread monotonic
14  cmpxchg i32* %x, i32 1, i32 0 singlethread monotonic
15  ; CHECK: cmpxchg volatile i32* %x, i32 0, i32 1 acq_rel
16  cmpxchg volatile i32* %x, i32 0, i32 1 acq_rel
17  ; CHECK: atomicrmw add i32* %x, i32 10 seq_cst
18  atomicrmw add i32* %x, i32 10 seq_cst
19  ; CHECK: atomicrmw volatile xchg  i32* %x, i32 10 monotonic
20  atomicrmw volatile xchg i32* %x, i32 10 monotonic
21  ; CHECK: fence singlethread release
22  fence singlethread release
23  ; CHECK: fence seq_cst
24  fence seq_cst
25  ret void
26}
27