mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-07-18 12:29:27 +00:00
Add 3 more test cases for ptrtoint, fptoui and fptosi
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31940 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
f357daf2fe
commit
e434f4ac50
@ -2,7 +2,7 @@
|
|||||||
; sure only the LSBit survives. Test that this is the case both for a returned
|
; sure only the LSBit survives. Test that this is the case both for a returned
|
||||||
; value and as the operand of a branch.
|
; value and as the operand of a branch.
|
||||||
; RUN: llvm-as < %s | llc -march=x86 &&
|
; RUN: llvm-as < %s | llc -march=x86 &&
|
||||||
; RUN: llvm-as < %s | llc -march=x86 | grep '\(and\)\|\(test.*\$1\)' | wc -l | grep 3
|
; RUN: llvm-as < %s | llc -march=x86 | grep '\(and\)\|\(test.*\$1\)' | wc -l | grep 6
|
||||||
bool %test1(int %X) {
|
bool %test1(int %X) {
|
||||||
%Y = trunc int %X to bool
|
%Y = trunc int %X to bool
|
||||||
ret bool %Y
|
ret bool %Y
|
||||||
@ -30,3 +30,30 @@ cond_true:
|
|||||||
cond_false:
|
cond_false:
|
||||||
ret int 42
|
ret int 42
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int %test4(sbyte* %ptr) {
|
||||||
|
%tmp = ptrtoint sbyte* %ptr to bool
|
||||||
|
br bool %tmp, label %cond_true, label %cond_false
|
||||||
|
cond_true:
|
||||||
|
ret int 21
|
||||||
|
cond_false:
|
||||||
|
ret int 42
|
||||||
|
}
|
||||||
|
|
||||||
|
int %test5(float %f) {
|
||||||
|
%tmp = fptoui float %f to bool
|
||||||
|
br bool %tmp, label %cond_true, label %cond_false
|
||||||
|
cond_true:
|
||||||
|
ret int 21
|
||||||
|
cond_false:
|
||||||
|
ret int 42
|
||||||
|
}
|
||||||
|
|
||||||
|
int %test6(double %d) {
|
||||||
|
%tmp = fptosi double %d to bool
|
||||||
|
br bool %tmp, label %cond_true, label %cond_false
|
||||||
|
cond_true:
|
||||||
|
ret int 21
|
||||||
|
cond_false:
|
||||||
|
ret int 42
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user