mirror of
https://gitlab.com/camelot/kickc.git
synced 2025-01-23 09:33:30 +00:00
Added missing fragment and ternary type inference test
This commit is contained in:
parent
9f27006540
commit
855434afa9
11
src/main/fragment/vwsz1=vbsaa_plus_vwsc1.asm
Normal file
11
src/main/fragment/vwsz1=vbsaa_plus_vwsc1.asm
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
tax
|
||||||
|
clc
|
||||||
|
adc #<{c1}
|
||||||
|
sta {z1}
|
||||||
|
txa
|
||||||
|
ora #$7f
|
||||||
|
bmi !+
|
||||||
|
lda #0
|
||||||
|
!:
|
||||||
|
adc #>{c1}
|
||||||
|
sta {z1}+1
|
@ -63,6 +63,11 @@ public class TestPrograms {
|
|||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testTernaryInference() throws IOException, URISyntaxException {
|
||||||
|
compileAndCompare("ternary-inference");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testFragmentVariations() throws IOException, URISyntaxException {
|
public void testFragmentVariations() throws IOException, URISyntaxException {
|
||||||
compileAndCompare("fragment-variations");
|
compileAndCompare("fragment-variations");
|
||||||
|
10
src/test/kc/ternary-inference.kc
Normal file
10
src/test/kc/ternary-inference.kc
Normal 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;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user