1
0
mirror of https://gitlab.com/camelot/kickc.git synced 2024-11-24 14:31:15 +00:00

Added test illustrating problem with bitwise not and literal number type inference. #199

This commit is contained in:
Jesper Gravgaard 2019-08-27 13:26:55 +02:00
parent 5b71c50a90
commit fc3b7bd5c0
2 changed files with 28 additions and 13 deletions

View File

@ -575,11 +575,12 @@ public class TestPrograms {
compileAndCompare("unused-irq"); compileAndCompare("unused-irq");
} }
/** TODO: Fix error with number resolving /**
@Test * TODO: Fix error with number resolving
public void testNumberTernaryFail() throws IOException, URISyntaxException { *
compileAndCompare("number-ternary-fail"); * @Test public void testNumberTernaryFail() throws IOException, URISyntaxException {
} * compileAndCompare("number-ternary-fail");
* }
*/ */
@Test @Test
@ -1704,7 +1705,6 @@ public class TestPrograms {
*/ */
@Test @Test
public void testInlineKasmRefout() throws IOException, URISyntaxException { public void testInlineKasmRefout() throws IOException, URISyntaxException {
compileAndCompare("inline-kasm-refout"); compileAndCompare("inline-kasm-refout");
@ -1975,6 +1975,14 @@ public class TestPrograms {
compileAndCompare("min-fmul-16"); compileAndCompare("min-fmul-16");
} }
// Fix literal number type conversion (also over the bitwise NOT operator). https://gitlab.com/camelot/kickc/issues/199
/*
@Test
public void testBitwiseNot1() throws IOException, URISyntaxException {
compileAndCompare("bitwise-not-1");
}
*/
@Test @Test
public void testBitwiseNot() throws IOException, URISyntaxException { public void testBitwiseNot() throws IOException, URISyntaxException {
compileAndCompare("bitwise-not"); compileAndCompare("bitwise-not");

View File

@ -0,0 +1,7 @@
// Test that bitwise NOT (~) is handled correctly
void main() {
const char* screen = 0x0400;
char b = ~0x10;
*screen = b;
}