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