Skip to content

Commit

Permalink
[CIR][CIRGen] Atomics: add one more testcase
Browse files Browse the repository at this point in the history
  • Loading branch information
bcardosolopes authored and lanza committed Apr 26, 2024
1 parent 67fa2b7 commit 426233f
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion clang/test/CIR/CodeGen/atomic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -297,4 +297,14 @@ bool fi4c(atomic_int *i) {
// CHECK: }

// LLVM-LABEL: @_Z4fi4cPU7_Atomici
// LLVM: cmpxchg ptr {{.*}}, i32 {{.*}}, i32 {{.*}} seq_cst seq_cst, align 4
// LLVM: cmpxchg ptr {{.*}}, i32 {{.*}}, i32 {{.*}} seq_cst seq_cst, align 4

bool fsb(bool *c) {
return __atomic_exchange_n(c, 1, memory_order_seq_cst);
}

// CHECK-LABEL: @_Z3fsbPb
// CHECK: cir.atomic.xchg({{.*}} : !cir.ptr<!cir.bool>, {{.*}} : !u8i, seq_cst) : !u8i

// LLVM-LABEL: @_Z3fsbPb
// LLVM: atomicrmw xchg ptr {{.*}}, i8 {{.*}} seq_cst, align 1

0 comments on commit 426233f

Please sign in to comment.