mirror of
https://github.com/irmen/prog8.git
synced 2025-12-19 20:17:17 +00:00
remove needless library module imports in unit tests
This commit is contained in:
@@ -413,8 +413,6 @@ main {
|
||||
test("various array indexed assignment scenarios") {
|
||||
val src="""
|
||||
%import floats
|
||||
%import textio
|
||||
%zeropage basicsafe
|
||||
|
||||
main {
|
||||
bool[10] barray
|
||||
@@ -456,14 +454,10 @@ main {
|
||||
dump()
|
||||
|
||||
sub dump() {
|
||||
txt.print_bool(barray[2])
|
||||
txt.spc()
|
||||
txt.print_uw(warrayns[2])
|
||||
txt.spc()
|
||||
txt.print_uw(warray[2])
|
||||
txt.spc()
|
||||
txt.print_f(farray[2])
|
||||
txt.nl()
|
||||
bool @shared bb = barray[2]
|
||||
uword @shared ww = warrayns[2]
|
||||
uword @shared ww2 = warray[2]
|
||||
float @shared ff = farray[2]
|
||||
}
|
||||
}
|
||||
}"""
|
||||
|
||||
@@ -197,8 +197,6 @@ main {
|
||||
|
||||
"identifiers can have the names of cpu instructions" {
|
||||
val text="""
|
||||
%import textio
|
||||
|
||||
nop {
|
||||
sub lda(ubyte sec) -> ubyte {
|
||||
asl:
|
||||
@@ -223,13 +221,15 @@ main {
|
||||
sub start() {
|
||||
ubyte col = 10
|
||||
ubyte row = 20
|
||||
txt.print_ub(nop.lda(42))
|
||||
txt.nl()
|
||||
txt.print_uw(nop.lda.asl)
|
||||
print_ub(nop.lda(42))
|
||||
print_uw(nop.lda.asl)
|
||||
|
||||
void ffalse(99)
|
||||
void ftrue(99)
|
||||
}
|
||||
|
||||
sub print_ub(ubyte v) {}
|
||||
sub print_uw(uword v) {}
|
||||
}
|
||||
"""
|
||||
val result = compileText(C64Target(), false, text, outputDir, writeAssembly = true)
|
||||
|
||||
@@ -19,14 +19,11 @@ class TestLibrary: FunSpec({
|
||||
val outputDir = tempdir().toPath()
|
||||
|
||||
test("library compilation (x16)") {
|
||||
val src="""
|
||||
%address ${'$'}A050
|
||||
%memtop ${'$'}C000
|
||||
val src= $$"""
|
||||
%address $A050
|
||||
%memtop $C000
|
||||
%output library
|
||||
|
||||
%import textio
|
||||
|
||||
|
||||
main {
|
||||
; Create a jump table as first thing in the library.
|
||||
uword[] @shared @nosplit jumptable = [
|
||||
@@ -105,23 +102,20 @@ library {
|
||||
}
|
||||
|
||||
test("library compilation (c64)") {
|
||||
val src="""
|
||||
%address ${'$'}8050
|
||||
%memtop ${'$'}a000
|
||||
val src= $$"""
|
||||
%address $8050
|
||||
%memtop $a000
|
||||
%output library
|
||||
|
||||
%import textio
|
||||
|
||||
|
||||
main {
|
||||
; Create a jump table as first thing in the library.
|
||||
uword[] @shared @nosplit jumptable = [
|
||||
; NOTE: the compiler has inserted a single JMP instruction at the start of the 'main' block, that jumps to the start() routine.
|
||||
; This is convenient because the rest of the jump table simply follows it,
|
||||
; making the first jump neatly be the required initialization routine for the library (initializing variables and BSS region).
|
||||
; btw, ${'$'}4c = opcode for JMP.
|
||||
${'$'}4c00, &library.func1,
|
||||
${'$'}4c00, &library.func2,
|
||||
; btw, $4c = opcode for JMP.
|
||||
$4c00, &library.func1,
|
||||
$4c00, &library.func2,
|
||||
]
|
||||
|
||||
sub start() {
|
||||
|
||||
Reference in New Issue
Block a user