1
0
mirror of https://gitlab.com/camelot/kickc.git synced 2024-11-23 08:32:39 +00:00

fixed problem with triming on string comparisions

This commit is contained in:
Andrzej Sliwa 2020-12-09 16:33:57 +01:00
parent 6466419fd1
commit 3bf8a6f55e
5 changed files with 16 additions and 17 deletions

View File

@ -47,7 +47,7 @@ abstract class ReferenceHelper {
String outLine = outLines.get(i);
if(refLines.size()>i) {
String refLine = refLines.get(i);
if(!outLine.equals(refLine)) {
if(!outLine.trim().equals(refLine.trim())) {
writeOutputFile(fileName, extension, outputString);
System.out.println(
"Output does not match reference on line "+i+"\n"+

View File

@ -1066,7 +1066,7 @@ public class TestPrograms {
@Test
public void testAddressWithExpressionValue() throws IOException, URISyntaxException {
compileAndCompare("address-with-expression-value.c");
compileAndCompare("address-with-expression-value.c", log());
}
@Test

View File

@ -13,4 +13,3 @@ char __address(var1 + var2) DATA[1000];
void main() {
SCREEN[0] = DATA[0];
}

View File

@ -4,6 +4,6 @@ main: scope:[main] from
[0] *SCREEN = *DATA
to:main::@return
main::@return: scope:[main] from main
[1] return
[1] return
to:@return

View File

@ -6,17 +6,17 @@ main: scope:[main] from __start
SCREEN[0] = DATA[0]
to:main::@return
main::@return: scope:[main] from main
return
return
to:@return
void __start()
__start: scope:[__start] from
call main
call main
to:__start::@1
__start::@1: scope:[__start] from __start
to:__start::@return
__start::@return: scope:[__start] from __start::@1
return
return
to:@return
SYMBOL TABLE SSA
@ -55,7 +55,7 @@ main: scope:[main] from
[0] *SCREEN = *DATA
to:main::@return
main::@return: scope:[main] from main
[1] return
[1] return
to:@return
@ -65,14 +65,14 @@ void main()
Initial phi equivalence classes
Complete equivalence classes
REGISTER UPLIFT POTENTIAL REGISTERS
Statement [0] *SCREEN = *DATA [ ] ( [ ] { } ) always clobbers reg byte a
Statement [0] *SCREEN = *DATA [ ] ( [ ] { } ) always clobbers reg byte a
REGISTER UPLIFT SCOPES
Uplift Scope [main]
Uplift Scope []
Uplift Scope [main]
Uplift Scope []
Uplifting [main] best 17 combination
Uplifting [] best 17 combination
Uplifting [main] best 17 combination
Uplifting [] best 17 combination
ASSEMBLER BEFORE OPTIMIZATION
// File Comments
@ -86,13 +86,13 @@ ASSEMBLER BEFORE OPTIMIZATION
.label SCREEN = $400
// main
main: {
// [0] *SCREEN = *DATA -- _deref_pbuc1=_deref_pbuc2
// [0] *SCREEN = *DATA -- _deref_pbuc1=_deref_pbuc2
lda DATA
sta SCREEN
jmp __breturn
// main::@return
__breturn:
// [1] return
// [1] return
rts
}
// File Data
@ -128,12 +128,12 @@ Score: 14
// main
main: {
// SCREEN[0] = DATA[0]
// [0] *SCREEN = *DATA -- _deref_pbuc1=_deref_pbuc2
// [0] *SCREEN = *DATA -- _deref_pbuc1=_deref_pbuc2
lda DATA
sta SCREEN
// main::@return
// }
// [1] return
// [1] return
rts
}
// File Data