mirror of
https://gitlab.com/camelot/kickc.git
synced 2025-03-25 23:34:26 +00:00
Added test cases for problems #283
This commit is contained in:
parent
ea7df4761f
commit
4ec3c6b369
src/test
java/dk/camelot64/kickc/test
kc
@ -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");
|
||||
|
13
src/test/kc/type-promotion-bool-param.kc
Normal file
13
src/test/kc/type-promotion-bool-param.kc
Normal 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;
|
||||
}
|
17
src/test/kc/type-promotion-schar-param.kc
Normal file
17
src/test/kc/type-promotion-schar-param.kc
Normal 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;
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user