1
0
mirror of https://gitlab.com/camelot/kickc.git synced 2024-11-23 08:32:39 +00:00

Added tests illustrating stack call live range problems.

This commit is contained in:
jespergravgaard 2020-03-01 17:05:54 +01:00
parent 648d08a13d
commit 7720eb8c13
3 changed files with 57 additions and 0 deletions

View File

@ -279,6 +279,20 @@ public class TestPrograms {
compileAndCompare("declared-memory-var-0");
}
/*
@Test
public void testProcedureCallingConventionStack8() throws IOException, URISyntaxException {
compileAndCompare("procedure-callingconvention-stack-8", log().verboseLiveRanges()); //, log().verboseCreateSsa().verboseParse().verboseStatementSequence());
}
*/
/*
@Test
public void testProcedureCallingConventionStack7() throws IOException, URISyntaxException {
compileAndCompare("procedure-callingconvention-stack-7", log().verboseLiveRanges()); //, log().verboseCreateSsa().verboseParse().verboseStatementSequence());
}
*/
/*
@Test
public void testProcedureCallingConventionStack6() throws IOException, URISyntaxException {

View File

@ -0,0 +1,21 @@
// Test a procedure with calling convention stack
// Illustrates live range problem with variables in different functions main::val and printline::i
#pragma calling(__stackcall)
#pragma var_model(ma_zp)
const char* SCREEN = 0x0400;
void main(void) {
char val = 0;
val = '-';
printline();
SCREEN[80] = val;
}
void printline() {
for(char i=0; i<40; i++) {
SCREEN[i] = '*';
}
}

View File

@ -0,0 +1,22 @@
// Test a procedure with calling convention stack
// Illustrates live range problem with variable function printline::i and global variable val
#pragma calling(__stackcall)
#pragma var_model(ma_zp)
const char* SCREEN = 0x0400;
char val = 0;
void main(void) {
val = '-';
printline();
SCREEN[80] = val;
}
void printline() {
for(char i=0; i<40; i++) {
SCREEN[i] = '*';
}
}