mirror of
https://github.com/irmen/prog8.git
synced 2025-07-24 20:24:09 +00:00
fixed compiler crash: unsigned = (-(unsigned as word) as uword)
This commit is contained in:
@@ -63,5 +63,21 @@ class TestVariables: FunSpec({
|
||||
"""
|
||||
compileText(C64Target(), false, text, writeAssembly = true) shouldNotBe null
|
||||
}
|
||||
|
||||
test("negation of unsigned via casts") {
|
||||
val text = """
|
||||
main {
|
||||
sub start() {
|
||||
cx16.r0L = -(cx16.r0L as byte) as ubyte
|
||||
cx16.r0 = -(cx16.r0 as word) as uword
|
||||
ubyte ub
|
||||
uword uw
|
||||
ub = -(ub as byte) as ubyte
|
||||
uw = -(uw as word) as uword
|
||||
}
|
||||
}
|
||||
"""
|
||||
compileText(C64Target(), false, text, writeAssembly = true) shouldNotBe null
|
||||
}
|
||||
|
||||
})
|
||||
|
Reference in New Issue
Block a user