1
0
mirror of https://gitlab.com/camelot/kickc.git synced 2024-11-20 02:32:36 +00:00

Added missing fragment and ternary type inference test

This commit is contained in:
jespergravgaard 2019-05-18 08:51:22 +02:00
parent 9f27006540
commit 855434afa9
3 changed files with 26 additions and 0 deletions

View File

@ -0,0 +1,11 @@
tax
clc
adc #<{c1}
sta {z1}
txa
ora #$7f
bmi !+
lda #0
!:
adc #>{c1}
sta {z1}+1

View File

@ -63,6 +63,11 @@ public class TestPrograms {
*/
@Test
public void testTernaryInference() throws IOException, URISyntaxException {
compileAndCompare("ternary-inference");
}
@Test
public void testFragmentVariations() throws IOException, URISyntaxException {
compileAndCompare("fragment-variations");

View File

@ -0,0 +1,10 @@
// Type inference into the ternary operator
void main() {
const byte* screen = 0x400;
for(byte i: 0..10) {
screen[i] = (i<5?0x57:'0')+i;
}
}