mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-01 01:26:56 +00:00
Add a bunch of tests for cases that should be eliminated.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19217 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -128,3 +128,30 @@ bool %test20(bool %B) {
|
|||||||
%D = setlt int %C, -1
|
%D = setlt int %C, -1
|
||||||
ret bool %D ;; false
|
ret bool %D ;; false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint %test21(uint %X) {
|
||||||
|
%Y = cast uint %X to sbyte
|
||||||
|
%Z = cast sbyte %Y to uint ;; sext -> zext -> and -> nop
|
||||||
|
%RV = and uint %Z, 255
|
||||||
|
ret uint %RV
|
||||||
|
}
|
||||||
|
|
||||||
|
uint %test22(uint %X) {
|
||||||
|
%Y = cast uint %X to sbyte
|
||||||
|
%Z = cast sbyte %Y to uint ;; sext -> zext -> and -> nop
|
||||||
|
%RV = shl uint %Z, ubyte 24
|
||||||
|
ret uint %RV
|
||||||
|
}
|
||||||
|
|
||||||
|
int %test23(int %X) {
|
||||||
|
%Y = cast int %X to ushort ;; Turn into an AND even though X
|
||||||
|
%Z = cast ushort %Y to int ;; and Z are signed.
|
||||||
|
ret int %Z
|
||||||
|
}
|
||||||
|
|
||||||
|
bool %test24(bool %C) {
|
||||||
|
%X = select bool %C, uint 14, uint 1234
|
||||||
|
%Y = cast uint %X to bool ;; Fold cast into select
|
||||||
|
ret bool %Y
|
||||||
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user