xref: /aosp_15_r20/external/llvm/test/Bitcode/weak-cmpxchg-upgrade.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; RUN: llvm-dis < %s.bc | FileCheck %s
2*9880d681SAndroid Build Coastguard Worker; RUN: verify-uselistorder < %s.bc
3*9880d681SAndroid Build Coastguard Worker
4*9880d681SAndroid Build Coastguard Worker; cmpxchg-upgrade.ll.bc was produced by running a version of llvm-as from just
5*9880d681SAndroid Build Coastguard Worker; before the IR change on this file.
6*9880d681SAndroid Build Coastguard Worker
7*9880d681SAndroid Build Coastguard Workerdefine i32 @test(i32* %addr, i32 %old, i32 %new) {
8*9880d681SAndroid Build Coastguard Worker; CHECK:  [[TMP:%.*]] = cmpxchg i32* %addr, i32 %old, i32 %new seq_cst monotonic
9*9880d681SAndroid Build Coastguard Worker; CHECK:  %val = extractvalue { i32, i1 } [[TMP]], 0
10*9880d681SAndroid Build Coastguard Worker  %val = cmpxchg i32* %addr, i32 %old, i32 %new seq_cst monotonic
11*9880d681SAndroid Build Coastguard Worker  ret i32 %val
12*9880d681SAndroid Build Coastguard Worker}
13*9880d681SAndroid Build Coastguard Worker
14*9880d681SAndroid Build Coastguard Workerdefine i32 @test(i32* %addr, i32 %old, i32 %new) {
15*9880d681SAndroid Build Coastguard Worker  ret i1 %val
16*9880d681SAndroid Build Coastguard Worker}
17