mirror of
https://gitlab.com/camelot/kickc.git
synced 2024-11-22 16:33:48 +00:00
Added tests illustrating stack call live range problems.
This commit is contained in:
parent
648d08a13d
commit
7720eb8c13
@ -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 {
|
||||
|
21
src/test/kc/procedure-callingconvention-stack-7.kc
Normal file
21
src/test/kc/procedure-callingconvention-stack-7.kc
Normal 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] = '*';
|
||||
}
|
||||
}
|
||||
|
22
src/test/kc/procedure-callingconvention-stack-8.kc
Normal file
22
src/test/kc/procedure-callingconvention-stack-8.kc
Normal 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] = '*';
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user