diff --git a/src/test/java/dk/camelot64/kickc/test/TestPrograms.java b/src/test/java/dk/camelot64/kickc/test/TestPrograms.java index 4fbaf26f9..b3b86ab2b 100644 --- a/src/test/java/dk/camelot64/kickc/test/TestPrograms.java +++ b/src/test/java/dk/camelot64/kickc/test/TestPrograms.java @@ -39,6 +39,17 @@ public class TestPrograms { public void testTextbox() throws IOException, URISyntaxException { compileAndCompare("textbox"); } +/* + @Test + public void testStructPtr12Ref() throws IOException, URISyntaxException { + compileAndCompare("struct-ptr-12-ref", log()); + } + + @Test + public void testStructPtr12() throws IOException, URISyntaxException { + compileAndCompare("struct-ptr-12"); + } + */ @Test public void testStructPtr11() throws IOException, URISyntaxException { diff --git a/src/test/kc/struct-ptr-12-ref.kc b/src/test/kc/struct-ptr-12-ref.kc new file mode 100644 index 000000000..92acc3271 --- /dev/null +++ b/src/test/kc/struct-ptr-12-ref.kc @@ -0,0 +1,9 @@ +// Reference file for Minimal struct - using address-of + +void main() { + word p = { 2, 3 }; + word *q = &p; + const byte* SCREEN = 0x0400; + SCREEN[0] = <*q; + SCREEN[1] = >*q; +} \ No newline at end of file diff --git a/src/test/kc/struct-ptr-12.kc b/src/test/kc/struct-ptr-12.kc new file mode 100644 index 000000000..b9dc1e6b2 --- /dev/null +++ b/src/test/kc/struct-ptr-12.kc @@ -0,0 +1,13 @@ +// Minimal struct - using address-of +struct Point { + byte x; + byte y; +}; + +void main() { + struct Point p = { 2, 3 }; + struct Point *q = &p; + const byte* SCREEN = 0x0400; + SCREEN[0] = q->x; + SCREEN[1] = q->y; +} \ No newline at end of file