1
0
mirror of https://gitlab.com/camelot/kickc.git synced 2024-12-25 11:32:07 +00:00

Added static init test. #257

This commit is contained in:
jespergravgaard 2020-06-10 07:12:10 +02:00
parent 0d9d6f8d54
commit 6c0210b704
2 changed files with 21 additions and 0 deletions

View File

@ -42,6 +42,11 @@ public class TestPrograms {
public TestPrograms() {
}
//@Test
//public void testStaticInitCode() throws IOException, URISyntaxException {
// compileAndCompare("static-init-code.c", log());
//}
@Test
public void testConstParenthesis() throws IOException, URISyntaxException {
compileAndCompare("const-parenthesis.c");

View File

@ -0,0 +1,16 @@
// Tests static initialization code
// Currently placed outside any function scope and pushed into @begin block.
// To be put into an initializer function.
// Initialize a volatile ZP-variable (will be done in the initializer)
volatile char c1 = 'x';
char * const SCREEN = 0x0400;
void main() {
SCREEN[0] = c1;
SCREEN[0] = c2;
}
// Initialize another volatile ZP-variable (will be done in the initializer)
volatile char c2 = 'y';