1
0
mirror of https://gitlab.com/camelot/kickc.git synced 2024-11-22 16:33:48 +00:00

Added test.

This commit is contained in:
jespergravgaard 2021-09-25 21:33:23 +02:00
parent 063512c3f1
commit 9fc9d525cf
4 changed files with 277 additions and 2 deletions

View File

@ -2,7 +2,7 @@
KickC is a C-compiler for 6502-based platforms creating optimized and readable assembler code.
The language is 95% standard C with a few limitations, and a few extensions to ensure an optimal fit for creating 6502 assembler code.
The language is 95% standard C99 with a few limitations, and a few extensions to ensure an optimal fit for creating 6502 assembler code.
The KickC-compiler includes all necessary linker and header files to makes it easy to create and test binaries for the following 6502-based platforms out-of-the-box:
- Commodore VIC 20

View File

@ -117,7 +117,7 @@ public class Pass5FixLongBranches extends Pass5AsmOptimization {
}
}
// KickAssembler returned error, but no long branch was found. Fail with the output from KickAss
throw new CompileError("Error! Failed to compile using KickAss\n" + output);
throw new CompileError("Error! Failed to compile using KickAss\n" + output);
}
return false;
}

View File

@ -4318,6 +4318,11 @@ public class TestProgramsFast extends TestPrograms {
compileAndCompare("test-lowhigh.c");
}
@Test
public void testLongJump3() throws IOException {
assertError("longjump3.c", "Error! Failed to compile using KickAss", false);
}
@Test
public void testLongJump2() throws IOException {
compileAndCompare("longjump2.c");

270
src/test/kc/longjump3.c Normal file
View File

@ -0,0 +1,270 @@
// Example program generating a long jump - and an ASM compile problem shadowing the detection
__export char PROBLEM[1] = kickasm {{
#import "qwe.asd"
}};
void main() {
byte* SCREEN = (byte*)$400;
for(byte i : 0..10) {
asm {
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
}
SCREEN[i] = i;
}
}