mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-28 04:33:05 +00:00
ca396e391e
The syntax for "cmpxchg" should now look something like: cmpxchg i32* %addr, i32 42, i32 3 acquire monotonic where the second ordering argument gives the required semantics in the case that no exchange takes place. It should be no stronger than the first ordering constraint and cannot be either "release" or "acq_rel" (since no store will have taken place). rdar://problem/15996804 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203559 91177308-0d34-0410-b5e6-96231b3b80d8
14 lines
412 B
LLVM
14 lines
412 B
LLVM
; RUN: llc < %s -mtriple=x86_64-apple-darwin | grep xor | count 3
|
|
|
|
@val = internal global i64 0
|
|
@"\01LC" = internal constant [7 x i8] c"0x%lx\0A\00"
|
|
|
|
define i32 @main() nounwind {
|
|
entry:
|
|
%0 = cmpxchg i64* @val, i64 0, i64 1 monotonic monotonic
|
|
%1 = tail call i32 (i8*, ...)* @printf(i8* getelementptr ([7 x i8]* @"\01LC", i32 0, i64 0), i64 %0) nounwind
|
|
ret i32 0
|
|
}
|
|
|
|
declare i32 @printf(i8*, ...) nounwind
|