mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-25 14:32:53 +00:00
b4dc0233c9
This was done with the following sed invocation to catch label lines demarking function boundaries: sed -i '' "s/^;\( *\)\([A-Z0-9_]*\):\( *\)test\([A-Za-z0-9_-]*\):\( *\)$/;\1\2-LABEL:\3test\4:\5/g" test/CodeGen/*/*.ll which was written conservatively to avoid false positives rather than false negatives. I scanned through all the changes and everything looks correct. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186258 91177308-0d34-0410-b5e6-96231b3b80d8
49 lines
1.1 KiB
LLVM
49 lines
1.1 KiB
LLVM
; RUN: llc < %s -mtriple x86_64-apple-darwin11 -O0 -fast-isel-abort | FileCheck %s
|
|
|
|
%struct.x = type { i64, i64 }
|
|
%addovf = type { i32, i1 }
|
|
declare %struct.x @f()
|
|
|
|
define void @test1(i64*) nounwind ssp {
|
|
%2 = tail call %struct.x @f() nounwind
|
|
%3 = extractvalue %struct.x %2, 0
|
|
%4 = add i64 %3, 10
|
|
store i64 %4, i64* %0
|
|
ret void
|
|
; CHECK-LABEL: test1:
|
|
; CHECK: callq _f
|
|
; CHECK-NEXT: addq $10, %rax
|
|
}
|
|
|
|
define void @test2(i64*) nounwind ssp {
|
|
%2 = tail call %struct.x @f() nounwind
|
|
%3 = extractvalue %struct.x %2, 1
|
|
%4 = add i64 %3, 10
|
|
store i64 %4, i64* %0
|
|
ret void
|
|
; CHECK-LABEL: test2:
|
|
; CHECK: callq _f
|
|
; CHECK-NEXT: addq $10, %rdx
|
|
}
|
|
|
|
declare %addovf @llvm.sadd.with.overflow.i32(i32, i32) nounwind readnone
|
|
|
|
define void @test3(i32 %x, i32 %y, i32* %z) {
|
|
%r = call %addovf @llvm.sadd.with.overflow.i32(i32 %x, i32 %y)
|
|
%sum = extractvalue %addovf %r, 0
|
|
%sum3 = mul i32 %sum, 3
|
|
%bit = extractvalue %addovf %r, 1
|
|
br i1 %bit, label %then, label %end
|
|
|
|
then:
|
|
store i32 %sum3, i32* %z
|
|
br label %end
|
|
|
|
end:
|
|
ret void
|
|
; CHECK: test3
|
|
; CHECK: addl
|
|
; CHECK: seto %al
|
|
; CHECK: testb $1, %al
|
|
}
|