2009-09-09 07:54:48 +08:00
|
|
|
; RUN: llc < %s -mtriple=x86_64-apple-darwin | grep xor | count 3
|
2008-09-20 01:38:47 +08:00
|
|
|
|
2011-09-27 07:15:09 +08:00
|
|
|
@val = internal global i64 0
|
|
|
|
@"\01LC" = internal constant [7 x i8] c"0x%lx\0A\00"
|
2008-09-20 01:38:47 +08:00
|
|
|
|
|
|
|
define i32 @main() nounwind {
|
|
|
|
entry:
|
2014-03-11 18:48:52 +08:00
|
|
|
%0 = cmpxchg i64* @val, i64 0, i64 1 monotonic monotonic
|
2011-09-27 07:15:09 +08:00
|
|
|
%1 = tail call i32 (i8*, ...)* @printf(i8* getelementptr ([7 x i8]* @"\01LC", i32 0, i64 0), i64 %0) nounwind
|
|
|
|
ret i32 0
|
2008-09-20 01:38:47 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
declare i32 @printf(i8*, ...) nounwind
|