diff --git a/src/test/java/dk/camelot64/kickc/test/TestProgramsFast.java b/src/test/java/dk/camelot64/kickc/test/TestProgramsFast.java index 443e2ad15..c09471149 100644 --- a/src/test/java/dk/camelot64/kickc/test/TestProgramsFast.java +++ b/src/test/java/dk/camelot64/kickc/test/TestProgramsFast.java @@ -99,6 +99,11 @@ public class TestProgramsFast extends TestPrograms { compileAndCompare("null-constant.c"); } + //@Test + //public void testNullConstant1() throws IOException { + // compileAndCompare("null-constant-1.c"); + //} + @Test public void testBlockError2() throws IOException { compileAndCompare("block-error-2.c"); diff --git a/src/test/kc/null-constant-1.c b/src/test/kc/null-constant-1.c new file mode 100644 index 000000000..ba2a3fc88 --- /dev/null +++ b/src/test/kc/null-constant-1.c @@ -0,0 +1,17 @@ +// Test the NULL pointer + +#include + +void main() { + char* SCREEN = (char*)0x0400; + + SCREEN[1] = get(SCREEN); + SCREEN[0] = get(NULL); + +} + +char get(char* ptr) { + if(NULL==ptr) + return 0; + return *ptr; +} \ No newline at end of file