mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-08 06:32:24 +00:00
Tests: reformat sitofp.ll and use FileCheck
From: Fiona Glaser <fglaser@apple.com> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229436 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
e8e3eb8397
commit
be55a79941
@ -1,28 +1,40 @@
|
|||||||
; RUN: opt < %s -instcombine -S | not grep itofp
|
; RUN: opt < %s -instcombine -S | FileCheck %s
|
||||||
|
|
||||||
|
; CHECK-LABEL: test1
|
||||||
|
; CHECK: ret i1 true
|
||||||
define i1 @test1(i8 %A) {
|
define i1 @test1(i8 %A) {
|
||||||
%B = sitofp i8 %A to double
|
%B = sitofp i8 %A to double
|
||||||
%C = fcmp ult double %B, 128.0
|
%C = fcmp ult double %B, 128.0
|
||||||
ret i1 %C ; True!
|
ret i1 %C
|
||||||
}
|
}
|
||||||
|
|
||||||
|
; CHECK-LABEL: test2
|
||||||
|
; CHECK: ret i1 true
|
||||||
define i1 @test2(i8 %A) {
|
define i1 @test2(i8 %A) {
|
||||||
%B = sitofp i8 %A to double
|
%B = sitofp i8 %A to double
|
||||||
%C = fcmp ugt double %B, -128.1
|
%C = fcmp ugt double %B, -128.1
|
||||||
ret i1 %C ; True!
|
ret i1 %C
|
||||||
}
|
}
|
||||||
|
|
||||||
|
; CHECK-LABEL: test3
|
||||||
|
; CHECK: ret i1 true
|
||||||
define i1 @test3(i8 %A) {
|
define i1 @test3(i8 %A) {
|
||||||
%B = sitofp i8 %A to double
|
%B = sitofp i8 %A to double
|
||||||
%C = fcmp ule double %B, 127.0
|
%C = fcmp ule double %B, 127.0
|
||||||
ret i1 %C ; true!
|
ret i1 %C
|
||||||
}
|
}
|
||||||
|
|
||||||
|
; CHECK-LABEL: test4
|
||||||
|
; CHECK: icmp ne i8 %A, 127
|
||||||
|
; CHECK-NEXT: ret i1
|
||||||
define i1 @test4(i8 %A) {
|
define i1 @test4(i8 %A) {
|
||||||
%B = sitofp i8 %A to double
|
%B = sitofp i8 %A to double
|
||||||
%C = fcmp ult double %B, 127.0
|
%C = fcmp ult double %B, 127.0
|
||||||
ret i1 %C ; A != 127
|
ret i1 %C
|
||||||
}
|
}
|
||||||
|
|
||||||
|
; CHECK-LABEL: test5
|
||||||
|
; CHECK: ret i32
|
||||||
define i32 @test5(i32 %A) {
|
define i32 @test5(i32 %A) {
|
||||||
%B = sitofp i32 %A to double
|
%B = sitofp i32 %A to double
|
||||||
%C = fptosi double %B to i32
|
%C = fptosi double %B to i32
|
||||||
@ -31,25 +43,32 @@ define i32 @test5(i32 %A) {
|
|||||||
ret i32 %E
|
ret i32 %E
|
||||||
}
|
}
|
||||||
|
|
||||||
|
; CHECK-LABEL: test6
|
||||||
|
; CHECK: and i32 %A, 39
|
||||||
|
; CHECK-NEXT: ret i32
|
||||||
define i32 @test6(i32 %A) {
|
define i32 @test6(i32 %A) {
|
||||||
%B = and i32 %A, 7 ; <i32> [#uses=1]
|
%B = and i32 %A, 7
|
||||||
%C = and i32 %A, 32 ; <i32> [#uses=1]
|
%C = and i32 %A, 32
|
||||||
%D = sitofp i32 %B to double ; <double> [#uses=1]
|
%D = sitofp i32 %B to double
|
||||||
%E = sitofp i32 %C to double ; <double> [#uses=1]
|
%E = sitofp i32 %C to double
|
||||||
%F = fadd double %D, %E ; <double> [#uses=1]
|
%F = fadd double %D, %E
|
||||||
%G = fptosi double %F to i32 ; <i32> [#uses=1]
|
%G = fptosi double %F to i32
|
||||||
ret i32 %G
|
ret i32 %G
|
||||||
}
|
}
|
||||||
|
|
||||||
define i32 @test7(i32 %a) nounwind {
|
; CHECK-LABEL: test7
|
||||||
%b = sitofp i32 %a to double ; <double> [#uses=1]
|
; CHECK: ret i32
|
||||||
%c = fptoui double %b to i32 ; <i32> [#uses=1]
|
define i32 @test7(i32 %A) nounwind {
|
||||||
ret i32 %c
|
%B = sitofp i32 %A to double
|
||||||
|
%C = fptoui double %B to i32
|
||||||
|
ret i32 %C
|
||||||
}
|
}
|
||||||
|
|
||||||
define i32 @test8(i32 %a) nounwind {
|
; CHECK-LABEL: test8
|
||||||
%b = uitofp i32 %a to double ; <double> [#uses=1]
|
; CHECK: ret i32
|
||||||
%c = fptosi double %b to i32 ; <i32> [#uses=1]
|
define i32 @test8(i32 %A) nounwind {
|
||||||
ret i32 %c
|
%B = uitofp i32 %A to double
|
||||||
|
%C = fptosi double %B to i32
|
||||||
|
ret i32 %C
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user