1
0
mirror of https://gitlab.com/camelot/kickc.git synced 2024-12-28 16:31:36 +00:00

Added test for til parameter type problem. #299

This commit is contained in:
jespergravgaard 2019-08-27 19:15:32 +02:00
parent f9a7904acb
commit 70aaeafecc
2 changed files with 23 additions and 0 deletions

View File

@ -36,6 +36,14 @@ public class TestPrograms {
public TestPrograms() {
}
// Fix parameter type problem - https://gitlab.com/camelot/kickc/issues/299
/*
@Test
public void testParameterAutocastWrong() throws IOException, URISyntaxException {
compileAndCompare("parameter-autocast-wrong");
}
*/
@Test
public void testKickasmUsesPreventDeletion() throws IOException, URISyntaxException {
compileAndCompare("kickasm-uses-prevent-deletion");

View File

@ -0,0 +1,15 @@
// Illustrates problem with wrong autocasting of parameters
// Program wrongly reports Unknown fragment error - while it should have reported type problem (char != char*)
char[] message = "CHAO0029 OPERATING SYSTEM STARTING...";
void main() {
print_to_screen(*message); // Passes *(char*) - effectively char to function that takes char*
}
char* screen = 0x0400;
void print_to_screen(char *message) {
while(*message)
*screen++ = *message++;
}