Skip to content

Commit 426233f

Browse files
bcardosolopeslanza
authored andcommitted
[CIR][CIRGen] Atomics: add one more testcase
1 parent 67fa2b7 commit 426233f

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

clang/test/CIR/CodeGen/atomic.cpp

+11-1
Original file line numberDiff line numberDiff line change
@@ -297,4 +297,14 @@ bool fi4c(atomic_int *i) {
297297
// CHECK: }
298298

299299
// LLVM-LABEL: @_Z4fi4cPU7_Atomici
300-
// LLVM: cmpxchg ptr {{.*}}, i32 {{.*}}, i32 {{.*}} seq_cst seq_cst, align 4
300+
// LLVM: cmpxchg ptr {{.*}}, i32 {{.*}}, i32 {{.*}} seq_cst seq_cst, align 4
301+
302+
bool fsb(bool *c) {
303+
return __atomic_exchange_n(c, 1, memory_order_seq_cst);
304+
}
305+
306+
// CHECK-LABEL: @_Z3fsbPb
307+
// CHECK: cir.atomic.xchg({{.*}} : !cir.ptr<!cir.bool>, {{.*}} : !u8i, seq_cst) : !u8i
308+
309+
// LLVM-LABEL: @_Z3fsbPb
310+
// LLVM: atomicrmw xchg ptr {{.*}}, i8 {{.*}} seq_cst, align 1

0 commit comments

Comments
 (0)