mirror of
https://gitlab.com/camelot/kickc.git
synced 2024-09-08 17:54:40 +00:00
Improved tests for CI
This commit is contained in:
parent
31e412bb11
commit
5ec1070b41
@ -57,7 +57,7 @@ public class Compiler {
|
||||
}
|
||||
final CharStream fileStream = CharStreams.fromPath(file.toPath());
|
||||
imported.add(file.getAbsolutePath());
|
||||
program.getLog().append("PARSING "+file.getAbsolutePath());
|
||||
program.getLog().append("PARSING "+file.getPath());
|
||||
program.getLog().append(fileStream.toString());
|
||||
KickCLexer lexer = new KickCLexer(fileStream);
|
||||
KickCParser parser = new KickCParser(new CommonTokenStream(lexer));
|
||||
|
@ -1,61 +0,0 @@
|
||||
package dk.camelot64.kickc.test;
|
||||
|
||||
import dk.camelot64.kickc.Compiler;
|
||||
import dk.camelot64.kickc.model.CompileError;
|
||||
import dk.camelot64.kickc.model.Program;
|
||||
import junit.framework.TestCase;
|
||||
import org.antlr.v4.runtime.CharStream;
|
||||
import org.antlr.v4.runtime.CharStreams;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.URISyntaxException;
|
||||
|
||||
/**
|
||||
* Some failing tests highlighting errors/problems in KickC
|
||||
*/
|
||||
public class TestErrors extends TestCase {
|
||||
|
||||
ReferenceHelper helper;
|
||||
|
||||
String testPath;
|
||||
|
||||
public TestErrors() throws IOException {
|
||||
testPath = "src/test/java/dk/camelot64/kickc/test/";
|
||||
helper = new ReferenceHelper("dk/camelot64/kickc/test/ref/");
|
||||
}
|
||||
|
||||
public void testNoCast() throws IOException, URISyntaxException {
|
||||
compileAndCompare("nocast");
|
||||
}
|
||||
|
||||
public void testInlineAsmParam() throws IOException, URISyntaxException {
|
||||
compileAndCompare("inline-asm-param");
|
||||
}
|
||||
|
||||
public void testForRangeSymbolic() throws IOException, URISyntaxException {
|
||||
String filename = "forrangesymbolic";
|
||||
compileAndCompare(filename);
|
||||
}
|
||||
|
||||
private void compileAndCompare(String filename) throws IOException, URISyntaxException {
|
||||
TestErrors tester = new TestErrors();
|
||||
tester.testFile(filename);
|
||||
}
|
||||
|
||||
private void testFile(String fileName) throws IOException, URISyntaxException {
|
||||
System.out.println("Testing output for " + fileName);
|
||||
Compiler compiler = new Compiler();
|
||||
compiler.addImportPath(testPath);
|
||||
Program program = compiler.compile(fileName);
|
||||
boolean success = true;
|
||||
success &= helper.testOutput(fileName, ".asm", program.getAsm().toString(false));
|
||||
success &= helper.testOutput(fileName, ".sym", program.getScope().getSymbolTableContents(program));
|
||||
success &= helper.testOutput(fileName, ".cfg", program.getGraph().toString(program));
|
||||
success &= helper.testOutput(fileName, ".log", program.getLog().toString());
|
||||
if (!success) {
|
||||
fail("Output does not match reference!");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
PARSING /Users/jespergravgaard/c64/tmp/kickc/src/test/java/dk/camelot64/kickc/test/arrays-init.kc
|
||||
PARSING src/test/java/dk/camelot64/kickc/test/arrays-init.kc
|
||||
|
||||
byte[3] b;
|
||||
byte[] c = {'c', 'm', 'l'};
|
||||
|
@ -1,4 +1,4 @@
|
||||
PARSING /Users/jespergravgaard/c64/tmp/kickc/src/test/java/dk/camelot64/kickc/test/asm-clobber.kc
|
||||
PARSING src/test/java/dk/camelot64/kickc/test/asm-clobber.kc
|
||||
// Tests that inline ASM clobbering is taken into account when assigning registers
|
||||
byte* SCREEN = $0400;
|
||||
void main() {
|
||||
|
@ -1,4 +1,4 @@
|
||||
PARSING /Users/jespergravgaard/c64/tmp/kickc/src/test/java/dk/camelot64/kickc/test/bitmap-bresenham.kc
|
||||
PARSING src/test/java/dk/camelot64/kickc/test/bitmap-bresenham.kc
|
||||
byte* COLS = $d800;
|
||||
byte* BGCOL = $d020;
|
||||
byte* FGCOL = $d021;
|
||||
|
@ -1,4 +1,4 @@
|
||||
PARSING /Users/jespergravgaard/c64/tmp/kickc/src/test/java/dk/camelot64/kickc/test/bitmap-plotter.kc
|
||||
PARSING src/test/java/dk/camelot64/kickc/test/bitmap-plotter.kc
|
||||
byte* D011 = $d011;
|
||||
byte RST8 = %10000000;
|
||||
byte ECM = %01000000;
|
||||
|
@ -1,4 +1,4 @@
|
||||
PARSING /Users/jespergravgaard/c64/tmp/kickc/src/test/java/dk/camelot64/kickc/test/bresenham.kc
|
||||
PARSING src/test/java/dk/camelot64/kickc/test/bresenham.kc
|
||||
byte STAR = 81;
|
||||
byte[40*25] SCREEN = $0400;
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
PARSING /Users/jespergravgaard/c64/tmp/kickc/src/test/java/dk/camelot64/kickc/test/bresenhamarr.kc
|
||||
PARSING src/test/java/dk/camelot64/kickc/test/bresenhamarr.kc
|
||||
|
||||
void main() {
|
||||
byte STAR = 81;
|
||||
|
@ -1,4 +1,4 @@
|
||||
PARSING /Users/jespergravgaard/c64/tmp/kickc/src/test/java/dk/camelot64/kickc/test/callconstparam.kc
|
||||
PARSING src/test/java/dk/camelot64/kickc/test/callconstparam.kc
|
||||
// Multiple calls with different (constant?) parameters should yield different values at runtime
|
||||
// Currently the same constant parameter is passed on every call.
|
||||
// Reason: Multiple versioned parameter constants x0#0, x0#1 are only output as a single constant in the ASM .const x0 = 0
|
||||
|
@ -1,4 +1,4 @@
|
||||
PARSING /Users/jespergravgaard/c64/tmp/kickc/src/test/java/dk/camelot64/kickc/test/casting.kc
|
||||
PARSING src/test/java/dk/camelot64/kickc/test/casting.kc
|
||||
byte* SCREEN = $0400;
|
||||
byte* SCREEN2 = SCREEN+40*3;
|
||||
byte* SCREEN3 = SCREEN+40*6;
|
||||
|
@ -1,4 +1,4 @@
|
||||
PARSING /Users/jespergravgaard/c64/tmp/kickc/src/test/java/dk/camelot64/kickc/test/chargen.kc
|
||||
PARSING src/test/java/dk/camelot64/kickc/test/chargen.kc
|
||||
byte* PROCPORT = $01;
|
||||
byte* CHARGEN = $d000;
|
||||
byte* SCREEN = $0400;
|
||||
|
@ -1,4 +1,4 @@
|
||||
PARSING /Users/jespergravgaard/c64/tmp/kickc/src/test/java/dk/camelot64/kickc/test/const-identification.kc
|
||||
PARSING src/test/java/dk/camelot64/kickc/test/const-identification.kc
|
||||
const byte* plots = $1000;
|
||||
const byte* SCREEN = $0400;
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
PARSING /Users/jespergravgaard/c64/tmp/kickc/src/test/java/dk/camelot64/kickc/test/constabsmin.kc
|
||||
PARSING src/test/java/dk/camelot64/kickc/test/constabsmin.kc
|
||||
const byte* SCREEN = $0400;
|
||||
|
||||
void main() {
|
||||
|
@ -1,4 +1,4 @@
|
||||
PARSING /Users/jespergravgaard/c64/tmp/kickc/src/test/java/dk/camelot64/kickc/test/constant-string-concat.kc
|
||||
PARSING src/test/java/dk/camelot64/kickc/test/constant-string-concat.kc
|
||||
// Concatenates string constants in different ways
|
||||
void main() {
|
||||
byte[] s = "e"+"l";
|
||||
|
@ -1,4 +1,4 @@
|
||||
PARSING /Users/jespergravgaard/c64/tmp/kickc/src/test/java/dk/camelot64/kickc/test/constantmin.kc
|
||||
PARSING src/test/java/dk/camelot64/kickc/test/constantmin.kc
|
||||
const byte* SCREEN = $0400;
|
||||
const byte STAR = 81;
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
PARSING /Users/jespergravgaard/c64/tmp/kickc/src/test/java/dk/camelot64/kickc/test/constants.kc
|
||||
PARSING src/test/java/dk/camelot64/kickc/test/constants.kc
|
||||
import "print.kc"
|
||||
const byte* BGCOL = $d021;
|
||||
const byte GREEN = 5;
|
||||
@ -60,7 +60,7 @@ void assert_sbyte(byte* msg, signed byte b, signed byte c) {
|
||||
}
|
||||
|
||||
Importing print.kc
|
||||
PARSING /Users/jespergravgaard/c64/tmp/kickc/src/test/java/dk/camelot64/kickc/test/print.kc
|
||||
PARSING src/test/java/dk/camelot64/kickc/test/print.kc
|
||||
|
||||
byte* line_cursor = $0400;
|
||||
byte* char_cursor = line_cursor;
|
||||
|
@ -1,4 +1,4 @@
|
||||
PARSING /Users/jespergravgaard/c64/tmp/kickc/src/test/java/dk/camelot64/kickc/test/double-import.kc
|
||||
PARSING src/test/java/dk/camelot64/kickc/test/double-import.kc
|
||||
import "imported"
|
||||
import "imported"
|
||||
|
||||
@ -6,7 +6,7 @@ void main() {
|
||||
*BGCOL = RED;
|
||||
}
|
||||
Importing imported
|
||||
PARSING /Users/jespergravgaard/c64/tmp/kickc/src/test/java/dk/camelot64/kickc/test/imported.kc
|
||||
PARSING src/test/java/dk/camelot64/kickc/test/imported.kc
|
||||
const byte *BGCOL = $d021;
|
||||
const byte RED = 2;
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
PARSING /Users/jespergravgaard/c64/tmp/kickc/src/test/java/dk/camelot64/kickc/test/fibmem.kc
|
||||
PARSING src/test/java/dk/camelot64/kickc/test/fibmem.kc
|
||||
byte[15] fibs = $1100;
|
||||
|
||||
void main() {
|
||||
|
@ -1,4 +1,4 @@
|
||||
PARSING /Users/jespergravgaard/c64/tmp/kickc/src/test/java/dk/camelot64/kickc/test/fillscreen.kc
|
||||
PARSING src/test/java/dk/camelot64/kickc/test/fillscreen.kc
|
||||
byte *SCREEN = $0400;
|
||||
|
||||
void main() {
|
||||
|
@ -1,4 +1,4 @@
|
||||
PARSING /Users/jespergravgaard/c64/tmp/kickc/src/test/java/dk/camelot64/kickc/test/flipper-rex2.kc
|
||||
PARSING src/test/java/dk/camelot64/kickc/test/flipper-rex2.kc
|
||||
byte[16*16] buffer1;
|
||||
byte[16*16] buffer2;
|
||||
byte *RASTER = $d012;
|
||||
|
@ -1,4 +1,4 @@
|
||||
PARSING /Users/jespergravgaard/c64/tmp/kickc/src/test/java/dk/camelot64/kickc/test/forclassicmin.kc
|
||||
PARSING src/test/java/dk/camelot64/kickc/test/forclassicmin.kc
|
||||
|
||||
// Minimal classic for() loop
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
PARSING /Users/jespergravgaard/c64/tmp/kickc/src/test/java/dk/camelot64/kickc/test/forincrementassign.kc
|
||||
PARSING src/test/java/dk/camelot64/kickc/test/forincrementassign.kc
|
||||
// Classic for() does not allow assignment as increment, eg. for(byte i=0;i<40;i=i+2) {}
|
||||
// The following should give a program rendering a char on every second char of the first line - but results in a syntax error
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
PARSING /Users/jespergravgaard/c64/tmp/kickc/src/test/java/dk/camelot64/kickc/test/forrangemin.kc
|
||||
PARSING src/test/java/dk/camelot64/kickc/test/forrangemin.kc
|
||||
|
||||
// Minimal range based for() loop
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
PARSING /Users/jespergravgaard/c64/tmp/kickc/src/test/java/dk/camelot64/kickc/test/halfscii.kc
|
||||
PARSING src/test/java/dk/camelot64/kickc/test/halfscii.kc
|
||||
byte* SCREEN = $0400;
|
||||
byte* CHARSET = $2000;
|
||||
byte* CHARGEN = $D000;
|
||||
|
@ -1,4 +1,4 @@
|
||||
PARSING /Users/jespergravgaard/c64/tmp/kickc/src/test/java/dk/camelot64/kickc/test/ifmin.kc
|
||||
PARSING src/test/java/dk/camelot64/kickc/test/ifmin.kc
|
||||
// Minimal if() test
|
||||
byte* SCREEN = $0400;
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
PARSING /Users/jespergravgaard/c64/tmp/kickc/src/test/java/dk/camelot64/kickc/test/immzero.kc
|
||||
PARSING src/test/java/dk/camelot64/kickc/test/immzero.kc
|
||||
// Tests that immediate zero values are reused - even when assigning to words
|
||||
void main() {
|
||||
byte i = 0;
|
||||
|
@ -1,4 +1,4 @@
|
||||
PARSING /Users/jespergravgaard/c64/tmp/kickc/src/test/java/dk/camelot64/kickc/test/importing.kc
|
||||
PARSING src/test/java/dk/camelot64/kickc/test/importing.kc
|
||||
import "imported.kc"
|
||||
|
||||
void main() {
|
||||
@ -7,7 +7,7 @@ void main() {
|
||||
*BGCOL = RED;
|
||||
}
|
||||
Importing imported.kc
|
||||
PARSING /Users/jespergravgaard/c64/tmp/kickc/src/test/java/dk/camelot64/kickc/test/imported.kc
|
||||
PARSING src/test/java/dk/camelot64/kickc/test/imported.kc
|
||||
const byte *BGCOL = $d021;
|
||||
const byte RED = 2;
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
PARSING /Users/jespergravgaard/c64/tmp/kickc/src/test/java/dk/camelot64/kickc/test/incd020.kc
|
||||
PARSING src/test/java/dk/camelot64/kickc/test/incd020.kc
|
||||
// Incrementing / decrementing pointer content should result in code modifying the memory location - eg. inc $d020.
|
||||
// Currently it does not but instead leads to just reading the value a few times.
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
PARSING /Users/jespergravgaard/c64/tmp/kickc/src/test/java/dk/camelot64/kickc/test/incrementinarray.kc
|
||||
PARSING src/test/java/dk/camelot64/kickc/test/incrementinarray.kc
|
||||
import "print.kc"
|
||||
|
||||
byte[] txt = "camelot@";
|
||||
@ -13,7 +13,7 @@ void main() {
|
||||
|
||||
}
|
||||
Importing print.kc
|
||||
PARSING /Users/jespergravgaard/c64/tmp/kickc/src/test/java/dk/camelot64/kickc/test/print.kc
|
||||
PARSING src/test/java/dk/camelot64/kickc/test/print.kc
|
||||
|
||||
byte* line_cursor = $0400;
|
||||
byte* char_cursor = line_cursor;
|
||||
|
@ -1,4 +1,4 @@
|
||||
PARSING /Users/jespergravgaard/c64/tmp/kickc/src/test/java/dk/camelot64/kickc/test/inline-asm.kc
|
||||
PARSING src/test/java/dk/camelot64/kickc/test/inline-asm.kc
|
||||
|
||||
void main() {
|
||||
asm {
|
||||
|
@ -1,4 +1,4 @@
|
||||
PARSING /Users/jespergravgaard/c64/tmp/kickc/src/test/java/dk/camelot64/kickc/test/inline-assignment.kc
|
||||
PARSING src/test/java/dk/camelot64/kickc/test/inline-assignment.kc
|
||||
const byte* SCREEN = $400;
|
||||
|
||||
void main() {
|
||||
|
@ -1,4 +1,4 @@
|
||||
PARSING /Users/jespergravgaard/c64/tmp/kickc/src/test/java/dk/camelot64/kickc/test/inline-string.kc
|
||||
PARSING src/test/java/dk/camelot64/kickc/test/inline-string.kc
|
||||
// Inline Strings in method calls are automatically converted to local constant variables byte[] st = "..."; - generating an ASM .text).
|
||||
|
||||
byte[] msg1 = "message 1 @";
|
||||
|
@ -1,4 +1,4 @@
|
||||
PARSING /Users/jespergravgaard/c64/tmp/kickc/src/test/java/dk/camelot64/kickc/test/inline-word.kc
|
||||
PARSING src/test/java/dk/camelot64/kickc/test/inline-word.kc
|
||||
const byte* SCREEN = $400;
|
||||
|
||||
void main() {
|
||||
|
@ -1,4 +1,4 @@
|
||||
PARSING /Users/jespergravgaard/c64/tmp/kickc/src/test/java/dk/camelot64/kickc/test/inlinearrayproblem.kc
|
||||
PARSING src/test/java/dk/camelot64/kickc/test/inlinearrayproblem.kc
|
||||
// Arrays / strings allocated inline destroy functions (because they are allocated where the call enters.
|
||||
// The following places the text at the start of the main-function - and JSR's straight into the text - not the code.
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
PARSING /Users/jespergravgaard/c64/tmp/kickc/src/test/java/dk/camelot64/kickc/test/inmem-const-array.kc
|
||||
PARSING src/test/java/dk/camelot64/kickc/test/inmem-const-array.kc
|
||||
byte WHITE = 1;
|
||||
byte RED = 2;
|
||||
byte GREEN = 5;
|
||||
|
@ -1,4 +1,4 @@
|
||||
PARSING /Users/jespergravgaard/c64/tmp/kickc/src/test/java/dk/camelot64/kickc/test/inmemarray.kc
|
||||
PARSING src/test/java/dk/camelot64/kickc/test/inmemarray.kc
|
||||
|
||||
byte* SCREEN = $0400;
|
||||
byte[] TXT = { 3, 1, 13, 5, 12, 15, 20, 32};
|
||||
|
@ -1,4 +1,4 @@
|
||||
PARSING /Users/jespergravgaard/c64/tmp/kickc/src/test/java/dk/camelot64/kickc/test/inmemstring.kc
|
||||
PARSING src/test/java/dk/camelot64/kickc/test/inmemstring.kc
|
||||
|
||||
byte* SCREEN = $0400;
|
||||
byte[] TEXT = "camelot ";
|
||||
|
@ -1,4 +1,4 @@
|
||||
PARSING /Users/jespergravgaard/c64/tmp/kickc/src/test/java/dk/camelot64/kickc/test/iterarray.kc
|
||||
PARSING src/test/java/dk/camelot64/kickc/test/iterarray.kc
|
||||
void main() {
|
||||
byte[16] buf = $1100;
|
||||
byte i = 5;
|
||||
|
@ -1,4 +1,4 @@
|
||||
PARSING /Users/jespergravgaard/c64/tmp/kickc/src/test/java/dk/camelot64/kickc/test/literals.kc
|
||||
PARSING src/test/java/dk/camelot64/kickc/test/literals.kc
|
||||
byte* SCREEN = $0400;
|
||||
|
||||
byte char = 'a';
|
||||
|
@ -1,4 +1,4 @@
|
||||
PARSING /Users/jespergravgaard/c64/tmp/kickc/src/test/java/dk/camelot64/kickc/test/liverange-call-problem.kc
|
||||
PARSING src/test/java/dk/camelot64/kickc/test/liverange-call-problem.kc
|
||||
// Live ranges were not functioning properly, when multiple method calls were chained - each modifying different vars.
|
||||
// w1 and w2 ended up having the same zero-page register as their live range was not propagated properly
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
PARSING /Users/jespergravgaard/c64/tmp/kickc/src/test/java/dk/camelot64/kickc/test/liverange.kc
|
||||
PARSING src/test/java/dk/camelot64/kickc/test/liverange.kc
|
||||
byte i=0;
|
||||
|
||||
void main() {
|
||||
|
@ -1,4 +1,4 @@
|
||||
PARSING /Users/jespergravgaard/c64/tmp/kickc/src/test/java/dk/camelot64/kickc/test/local-string.kc
|
||||
PARSING src/test/java/dk/camelot64/kickc/test/local-string.kc
|
||||
// Local constant strings are placed at the start of the method. This means the generated ASM jumps / calls straignt into the constant string
|
||||
void main() {
|
||||
byte* screen = $0400;
|
||||
|
@ -1,4 +1,4 @@
|
||||
PARSING /Users/jespergravgaard/c64/tmp/kickc/src/test/java/dk/camelot64/kickc/test/loopmin.kc
|
||||
PARSING src/test/java/dk/camelot64/kickc/test/loopmin.kc
|
||||
void main() {
|
||||
byte i=10;
|
||||
byte s=0;
|
||||
|
@ -1,4 +1,4 @@
|
||||
PARSING /Users/jespergravgaard/c64/tmp/kickc/src/test/java/dk/camelot64/kickc/test/loopnest.kc
|
||||
PARSING src/test/java/dk/camelot64/kickc/test/loopnest.kc
|
||||
byte* SCREEN = $0400;
|
||||
|
||||
void main() {
|
||||
|
@ -1,4 +1,4 @@
|
||||
PARSING /Users/jespergravgaard/c64/tmp/kickc/src/test/java/dk/camelot64/kickc/test/loopnest2.kc
|
||||
PARSING src/test/java/dk/camelot64/kickc/test/loopnest2.kc
|
||||
byte* SCREEN = $0400;
|
||||
|
||||
void main() {
|
||||
|
@ -1,4 +1,4 @@
|
||||
PARSING /Users/jespergravgaard/c64/tmp/kickc/src/test/java/dk/camelot64/kickc/test/loopsplit.kc
|
||||
PARSING src/test/java/dk/camelot64/kickc/test/loopsplit.kc
|
||||
void main() {
|
||||
byte i=100;
|
||||
byte s=0;
|
||||
|
@ -1,4 +1,4 @@
|
||||
PARSING /Users/jespergravgaard/c64/tmp/kickc/src/test/java/dk/camelot64/kickc/test/modglobal.kc
|
||||
PARSING src/test/java/dk/camelot64/kickc/test/modglobal.kc
|
||||
byte cnt = 0;
|
||||
byte cnt2 = 0;
|
||||
byte cnt3 = 0;
|
||||
|
@ -1,4 +1,4 @@
|
||||
PARSING /Users/jespergravgaard/c64/tmp/kickc/src/test/java/dk/camelot64/kickc/test/modglobalmin.kc
|
||||
PARSING src/test/java/dk/camelot64/kickc/test/modglobalmin.kc
|
||||
byte cnt = 0;
|
||||
byte[256] SCREEN=$0400;
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
PARSING /Users/jespergravgaard/c64/tmp/kickc/src/test/java/dk/camelot64/kickc/test/multiply.kc
|
||||
PARSING src/test/java/dk/camelot64/kickc/test/multiply.kc
|
||||
// Implementation of the Seriously Fast Multiplication
|
||||
// See http://codebase64.org/doku.php?id=base:seriously_fast_multiplication
|
||||
// Utilizes the fact that a*b = ((a+b)/2)^2 - ((a-b)/2)^2
|
||||
|
@ -1,4 +1,4 @@
|
||||
PARSING /Users/jespergravgaard/c64/tmp/kickc/src/test/java/dk/camelot64/kickc/test/overlap-allocation-2.kc
|
||||
PARSING src/test/java/dk/camelot64/kickc/test/overlap-allocation-2.kc
|
||||
// Two levels of functions to test that register allocation handles live ranges and call-ranges optimally to allocate the fewest possible ZP-variables
|
||||
byte* SCREEN = $0400;
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
PARSING /Users/jespergravgaard/c64/tmp/kickc/src/test/java/dk/camelot64/kickc/test/overlap-allocation.kc
|
||||
PARSING src/test/java/dk/camelot64/kickc/test/overlap-allocation.kc
|
||||
// Allocates ZP to j/k-variables even though all of i, j, k could be allocates to x and be more efficient.
|
||||
// Reason: Pass4RegisterUpliftCombinations.isAllocationOverlapping() believes i/j/k variables overlaps insode plot()
|
||||
byte* SCREEN = $0400;
|
||||
|
@ -1,4 +1,4 @@
|
||||
PARSING /Users/jespergravgaard/c64/tmp/kickc/src/test/java/dk/camelot64/kickc/test/print-problem.kc
|
||||
PARSING src/test/java/dk/camelot64/kickc/test/print-problem.kc
|
||||
byte* SCREEN= $400;
|
||||
byte line = $40;
|
||||
byte char = line;
|
||||
|
@ -1,4 +1,4 @@
|
||||
PARSING /Users/jespergravgaard/c64/tmp/kickc/src/test/java/dk/camelot64/kickc/test/printmsg.kc
|
||||
PARSING src/test/java/dk/camelot64/kickc/test/printmsg.kc
|
||||
import "print"
|
||||
|
||||
byte[] msg = "hello world! @";
|
||||
@ -15,7 +15,7 @@ void main() {
|
||||
}
|
||||
|
||||
Importing print
|
||||
PARSING /Users/jespergravgaard/c64/tmp/kickc/src/test/java/dk/camelot64/kickc/test/print.kc
|
||||
PARSING src/test/java/dk/camelot64/kickc/test/print.kc
|
||||
|
||||
byte* line_cursor = $0400;
|
||||
byte* char_cursor = line_cursor;
|
||||
|
@ -1,4 +1,4 @@
|
||||
PARSING /Users/jespergravgaard/c64/tmp/kickc/src/test/java/dk/camelot64/kickc/test/ptr-complex.kc
|
||||
PARSING src/test/java/dk/camelot64/kickc/test/ptr-complex.kc
|
||||
// Test some complex pointers
|
||||
|
||||
void main() {
|
||||
|
@ -1,4 +1,4 @@
|
||||
PARSING /Users/jespergravgaard/c64/tmp/kickc/src/test/java/dk/camelot64/kickc/test/ptrtest.kc
|
||||
PARSING src/test/java/dk/camelot64/kickc/test/ptrtest.kc
|
||||
// Test all types of pointers
|
||||
|
||||
void main() {
|
||||
|
@ -1,4 +1,4 @@
|
||||
PARSING /Users/jespergravgaard/c64/tmp/kickc/src/test/java/dk/camelot64/kickc/test/ptrtestmin.kc
|
||||
PARSING src/test/java/dk/camelot64/kickc/test/ptrtestmin.kc
|
||||
// Test all types of pointers
|
||||
|
||||
void main() {
|
||||
|
@ -1,4 +1,4 @@
|
||||
PARSING /Users/jespergravgaard/c64/tmp/kickc/src/test/java/dk/camelot64/kickc/test/scroll-clobber.kc
|
||||
PARSING src/test/java/dk/camelot64/kickc/test/scroll-clobber.kc
|
||||
byte* SCREEN = $0400;
|
||||
byte* SCROLL = $d016;
|
||||
byte[] TEXT = "01234567@";
|
||||
|
@ -1,4 +1,4 @@
|
||||
PARSING /Users/jespergravgaard/c64/tmp/kickc/src/test/java/dk/camelot64/kickc/test/scroll.kc
|
||||
PARSING src/test/java/dk/camelot64/kickc/test/scroll.kc
|
||||
byte* SCREEN = $0400;
|
||||
byte* RASTER = $d012;
|
||||
byte* BGCOL = $d020;
|
||||
|
@ -1,4 +1,4 @@
|
||||
PARSING /Users/jespergravgaard/c64/tmp/kickc/src/test/java/dk/camelot64/kickc/test/scrollbig.kc
|
||||
PARSING src/test/java/dk/camelot64/kickc/test/scrollbig.kc
|
||||
// An 8x8 char letter scroller
|
||||
|
||||
byte* PROCPORT = $01;
|
||||
|
@ -1,4 +1,4 @@
|
||||
PARSING /Users/jespergravgaard/c64/tmp/kickc/src/test/java/dk/camelot64/kickc/test/signed-bytes.kc
|
||||
PARSING src/test/java/dk/camelot64/kickc/test/signed-bytes.kc
|
||||
|
||||
void main() {
|
||||
byte* screen = $0400;
|
||||
|
@ -1,4 +1,4 @@
|
||||
PARSING /Users/jespergravgaard/c64/tmp/kickc/src/test/java/dk/camelot64/kickc/test/signed-words.kc
|
||||
PARSING src/test/java/dk/camelot64/kickc/test/signed-words.kc
|
||||
import "c64"
|
||||
|
||||
const byte* SCREEN = $0400;
|
||||
@ -73,7 +73,7 @@ void anim() {
|
||||
}
|
||||
|
||||
Importing c64
|
||||
PARSING /Users/jespergravgaard/c64/tmp/kickc/src/test/java/dk/camelot64/kickc/test/c64.kc
|
||||
PARSING src/test/java/dk/camelot64/kickc/test/c64.kc
|
||||
const byte* PROCPORT = $01;
|
||||
|
||||
const byte* CHARGEN = $d000;
|
||||
|
@ -1,4 +1,4 @@
|
||||
PARSING /Users/jespergravgaard/c64/tmp/kickc/src/test/java/dk/camelot64/kickc/test/sinus-basic.kc
|
||||
PARSING src/test/java/dk/camelot64/kickc/test/sinus-basic.kc
|
||||
import "print"
|
||||
import "basic-floats"
|
||||
|
||||
@ -24,7 +24,7 @@ void main() {
|
||||
}
|
||||
|
||||
Importing print
|
||||
PARSING /Users/jespergravgaard/c64/tmp/kickc/src/test/java/dk/camelot64/kickc/test/print.kc
|
||||
PARSING src/test/java/dk/camelot64/kickc/test/print.kc
|
||||
|
||||
byte* line_cursor = $0400;
|
||||
byte* char_cursor = line_cursor;
|
||||
@ -77,7 +77,7 @@ Adding pre/post-modifier (byte*) print_str::str ← ++ (byte*) print_str::str
|
||||
Adding pre/post-modifier (byte*) char_cursor ← ++ (byte*) char_cursor
|
||||
Adding pre/post-modifier (byte*) print_cls::sc ← ++ (byte*) print_cls::sc
|
||||
Importing basic-floats
|
||||
PARSING /Users/jespergravgaard/c64/tmp/kickc/src/test/java/dk/camelot64/kickc/test/basic-floats.kc
|
||||
PARSING src/test/java/dk/camelot64/kickc/test/basic-floats.kc
|
||||
// Library wrapping the BASIC floating point functions
|
||||
// See https://www.c64-wiki.com/wiki/Floating_point_arithmetic
|
||||
// See http://www.pagetable.com/c64rom/c64rom_sc.html
|
||||
|
@ -1,4 +1,4 @@
|
||||
PARSING /Users/jespergravgaard/c64/tmp/kickc/src/test/java/dk/camelot64/kickc/test/sinus-sprites.kc
|
||||
PARSING src/test/java/dk/camelot64/kickc/test/sinus-sprites.kc
|
||||
import "c64"
|
||||
import "basic-floats"
|
||||
import "print"
|
||||
@ -217,7 +217,7 @@ void gen_sintab(byte* sintab, byte length, byte min, byte max) {
|
||||
}
|
||||
|
||||
Importing c64
|
||||
PARSING /Users/jespergravgaard/c64/tmp/kickc/src/test/java/dk/camelot64/kickc/test/c64.kc
|
||||
PARSING src/test/java/dk/camelot64/kickc/test/c64.kc
|
||||
const byte* PROCPORT = $01;
|
||||
|
||||
const byte* CHARGEN = $d000;
|
||||
@ -245,7 +245,7 @@ const byte WHITE = 1;
|
||||
const byte RED = 2;
|
||||
|
||||
Importing basic-floats
|
||||
PARSING /Users/jespergravgaard/c64/tmp/kickc/src/test/java/dk/camelot64/kickc/test/basic-floats.kc
|
||||
PARSING src/test/java/dk/camelot64/kickc/test/basic-floats.kc
|
||||
// Library wrapping the BASIC floating point functions
|
||||
// See https://www.c64-wiki.com/wiki/Floating_point_arithmetic
|
||||
// See http://www.pagetable.com/c64rom/c64rom_sc.html
|
||||
@ -524,7 +524,7 @@ void mulFACby10() {
|
||||
}
|
||||
|
||||
Importing print
|
||||
PARSING /Users/jespergravgaard/c64/tmp/kickc/src/test/java/dk/camelot64/kickc/test/print.kc
|
||||
PARSING src/test/java/dk/camelot64/kickc/test/print.kc
|
||||
|
||||
byte* line_cursor = $0400;
|
||||
byte* char_cursor = line_cursor;
|
||||
|
@ -1,4 +1,4 @@
|
||||
PARSING /Users/jespergravgaard/c64/tmp/kickc/src/test/java/dk/camelot64/kickc/test/summin.kc
|
||||
PARSING src/test/java/dk/camelot64/kickc/test/summin.kc
|
||||
byte* screen = $0400;
|
||||
|
||||
void main() {
|
||||
|
@ -1,4 +1,4 @@
|
||||
PARSING /Users/jespergravgaard/c64/tmp/kickc/src/test/java/dk/camelot64/kickc/test/true-inline-words.kc
|
||||
PARSING src/test/java/dk/camelot64/kickc/test/true-inline-words.kc
|
||||
|
||||
void main() {
|
||||
byte[] bs = { 'c', 'm' }; // constant byte array
|
||||
|
@ -1,4 +1,4 @@
|
||||
PARSING /Users/jespergravgaard/c64/tmp/kickc/src/test/java/dk/camelot64/kickc/test/unused-method.kc
|
||||
PARSING src/test/java/dk/camelot64/kickc/test/unused-method.kc
|
||||
void main() {
|
||||
byte* screen = $0400;
|
||||
screen[0] = 1;
|
||||
|
@ -1,4 +1,4 @@
|
||||
PARSING /Users/jespergravgaard/c64/tmp/kickc/src/test/java/dk/camelot64/kickc/test/unused-vars.kc
|
||||
PARSING src/test/java/dk/camelot64/kickc/test/unused-vars.kc
|
||||
// used vars
|
||||
const byte* SCREEN = $0400;
|
||||
byte b=2>>1;
|
||||
|
@ -1,4 +1,4 @@
|
||||
PARSING /Users/jespergravgaard/c64/tmp/kickc/src/test/java/dk/camelot64/kickc/test/useglobal.kc
|
||||
PARSING src/test/java/dk/camelot64/kickc/test/useglobal.kc
|
||||
// Tests procedures using global variables (should not fail)
|
||||
byte* SCREEN = $0400;
|
||||
void main() {
|
||||
|
@ -1,4 +1,4 @@
|
||||
PARSING /Users/jespergravgaard/c64/tmp/kickc/src/test/java/dk/camelot64/kickc/test/voronoi.kc
|
||||
PARSING src/test/java/dk/camelot64/kickc/test/voronoi.kc
|
||||
// The screen
|
||||
byte *SCREEN = $0400;
|
||||
byte *COLORS = $D800;
|
||||
|
@ -1,4 +1,4 @@
|
||||
PARSING /Users/jespergravgaard/c64/tmp/kickc/src/test/java/dk/camelot64/kickc/test/wordexpr.kc
|
||||
PARSING src/test/java/dk/camelot64/kickc/test/wordexpr.kc
|
||||
// Expressions based on bytes but resulting in words are as words - eg. b = b + 40*8;
|
||||
void main() {
|
||||
word b = 0;
|
||||
|
@ -1,4 +1,4 @@
|
||||
PARSING /Users/jespergravgaard/c64/tmp/kickc/src/test/java/dk/camelot64/kickc/test/zpparammin.kc
|
||||
PARSING src/test/java/dk/camelot64/kickc/test/zpparammin.kc
|
||||
byte* SCREEN = $0400;
|
||||
byte* SCREEN2 = $0400+40;
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
PARSING /Users/jespergravgaard/c64/tmp/kickc/src/test/java/dk/camelot64/kickc/test/zpptr.kc
|
||||
PARSING src/test/java/dk/camelot64/kickc/test/zpptr.kc
|
||||
void main() {
|
||||
byte* zpptr = $1000;
|
||||
for(byte j : 0..10) {
|
||||
|
Loading…
Reference in New Issue
Block a user