mirror of
https://gitlab.com/camelot/kickc.git
synced 2024-11-27 19:50:10 +00:00
Added test illustrating problem with bitwise not and literal number type inference. #199
This commit is contained in:
parent
5b71c50a90
commit
fc3b7bd5c0
@ -575,11 +575,12 @@ public class TestPrograms {
|
||||
compileAndCompare("unused-irq");
|
||||
}
|
||||
|
||||
/** TODO: Fix error with number resolving
|
||||
@Test
|
||||
public void testNumberTernaryFail() throws IOException, URISyntaxException {
|
||||
compileAndCompare("number-ternary-fail");
|
||||
}
|
||||
/**
|
||||
* TODO: Fix error with number resolving
|
||||
*
|
||||
* @Test public void testNumberTernaryFail() throws IOException, URISyntaxException {
|
||||
* compileAndCompare("number-ternary-fail");
|
||||
* }
|
||||
*/
|
||||
|
||||
@Test
|
||||
@ -1704,7 +1705,6 @@ public class TestPrograms {
|
||||
*/
|
||||
|
||||
|
||||
|
||||
@Test
|
||||
public void testInlineKasmRefout() throws IOException, URISyntaxException {
|
||||
compileAndCompare("inline-kasm-refout");
|
||||
@ -1975,6 +1975,14 @@ public class TestPrograms {
|
||||
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
|
||||
public void testBitwiseNot() throws IOException, URISyntaxException {
|
||||
compileAndCompare("bitwise-not");
|
||||
|
7
src/test/kc/bitwise-not-1.kc
Normal file
7
src/test/kc/bitwise-not-1.kc
Normal file
@ -0,0 +1,7 @@
|
||||
// Test that bitwise NOT (~) is handled correctly
|
||||
|
||||
void main() {
|
||||
const char* screen = 0x0400;
|
||||
char b = ~0x10;
|
||||
*screen = b;
|
||||
}
|
Loading…
Reference in New Issue
Block a user