mirror of
https://github.com/RPCSX/llvm.git
synced 2024-11-25 04:39:44 +00:00
46cb5afdcd
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140557 91177308-0d34-0410-b5e6-96231b3b80d8
14 lines
313 B
LLVM
14 lines
313 B
LLVM
; RUN: opt < %s -basicaa -gvn -instcombine -S | grep {ret i32 0}
|
|
|
|
@flag0 = internal global i32 zeroinitializer
|
|
@turn = internal global i32 zeroinitializer
|
|
|
|
|
|
define i32 @main() {
|
|
%a = load i32* @flag0
|
|
%b = atomicrmw xchg i32* @turn, i32 1 monotonic
|
|
%c = load i32* @flag0
|
|
%d = sub i32 %a, %c
|
|
ret i32 %d
|
|
}
|