1
0
mirror of https://gitlab.com/camelot/kickc.git synced 2024-09-08 17:54:40 +00:00

Added test cases for problems #283

This commit is contained in:
jespergravgaard 2019-08-22 00:47:44 +02:00
parent ea7df4761f
commit 4ec3c6b369
3 changed files with 44 additions and 1 deletions

View File

@ -87,7 +87,7 @@ public class TestPrograms {
// compileAndCompare("loophead-problem");
//}
// TODO: Fail with proper error when continue is encountered without a loop
// TODO: Fail with proper error when continue is encountered without a loop https://gitlab.com/camelot/kickc/issues/282
/*
@Test
public void testSwitch3Err() throws IOException, URISyntaxException {
@ -976,6 +976,19 @@ public class TestPrograms {
compileAndCompare("fragment-variations");
}
// TODO: Fix call parameter type conversion (See SymbolTypeConversion) https://gitlab.com/camelot/kickc/issues/283
/*
@Test
public void testTypePromotionScharParam() throws IOException, URISyntaxException {
compileAndCompare("type-promotion-schar-param");
}
@Test
public void testTypePromotionBoolParam() throws IOException, URISyntaxException {
compileAndCompare("type-promotion-bool-param");
}
*/
@Test
public void testTypeInference() throws IOException, URISyntaxException {
compileAndCompare("type-inference");

View File

@ -0,0 +1,13 @@
// Test promoting a bool to a byte
const char* SCREEN = 0x0400;
char i = 0;
void main() {
print(1==0);
}
void print(char c) {
SCREEN[i++] = c;
}

View File

@ -0,0 +1,17 @@
// Test promotion of signed char parameter to word
const unsigned int* SCREEN = 0x0400;
int i = 0;
void main() {
// First a constant signed char
signed char sc = -41;
print(sc);
// And then a loop with a signed char
for( signed char sc2: -5..5)
print(sc2);
}
void print(unsigned int d) {
SCREEN[i++] = d;
}