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:
parent
0d9d6f8d54
commit
6c0210b704
@ -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");
|
||||
|
16
src/test/kc/static-init-code.c
Normal file
16
src/test/kc/static-init-code.c
Normal 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';
|
Loading…
Reference in New Issue
Block a user