2009-10-14 01:39:29 +08:00
|
|
|
; RUN: opt < %s -basicaa -gvn -instcombine -S | grep {ret i32 0}
|
2009-02-04 13:16:46 +08:00
|
|
|
|
|
|
|
@flag0 = internal global i32 zeroinitializer
|
|
|
|
@turn = internal global i32 zeroinitializer
|
|
|
|
|
|
|
|
|
|
|
|
define i32 @main() {
|
|
|
|
%a = load i32* @flag0
|
2011-09-27 04:15:28 +08:00
|
|
|
%b = atomicrmw xchg i32* @turn, i32 1 monotonic
|
2009-02-04 13:16:46 +08:00
|
|
|
%c = load i32* @flag0
|
2009-10-14 01:39:29 +08:00
|
|
|
%d = sub i32 %a, %c
|
|
|
|
ret i32 %d
|
2009-02-04 13:16:46 +08:00
|
|
|
}
|