2018-10-17 11:42:52 +00:00
package dk.camelot64.kickc.test ;
2017-07-15 20:00:02 +00:00
2020-12-11 23:01:15 +00:00
import dk.camelot64.kickc.CompileLog ;
2017-07-15 20:00:02 +00:00
import dk.camelot64.kickc.Compiler ;
2020-12-11 23:01:15 +00:00
import dk.camelot64.kickc.SourceLoader ;
import dk.camelot64.kickc.TmpDirManager ;
2019-07-08 09:32:07 +00:00
import dk.camelot64.kickc.asm.AsmProgram ;
2017-10-17 07:58:00 +00:00
import dk.camelot64.kickc.model.CompileError ;
import dk.camelot64.kickc.model.Program ;
2020-05-11 00:36:37 +00:00
import dk.camelot64.kickc.model.TargetPlatform ;
2020-05-15 06:19:26 +00:00
import dk.camelot64.kickc.parser.CTargetPlatformParser ;
2020-07-26 00:25:33 +00:00
import kickass.KickAssembler65CE02 ;
2019-08-03 11:22:27 +00:00
import kickass.nonasm.c64.CharToPetsciiConverter ;
2020-08-24 19:00:16 +00:00
import org.junit.jupiter.api.AfterAll ;
import org.junit.jupiter.api.BeforeAll ;
import org.junit.jupiter.api.Test ;
2017-07-15 20:00:02 +00:00
2018-02-13 02:34:01 +00:00
import java.io.* ;
2019-05-31 13:48:20 +00:00
import java.lang.management.GarbageCollectorMXBean ;
import java.lang.management.ManagementFactory ;
import java.lang.management.MemoryUsage ;
2017-07-15 20:00:02 +00:00
import java.net.URISyntaxException ;
2018-07-09 16:39:01 +00:00
import java.nio.file.FileAlreadyExistsException ;
2018-07-07 17:23:38 +00:00
import java.nio.file.Files ;
2018-02-13 02:34:01 +00:00
import java.nio.file.Path ;
2020-04-11 11:03:36 +00:00
import java.nio.file.Paths ;
import java.util.ArrayList ;
2020-09-28 20:25:15 +00:00
import java.util.HashMap ;
import java.util.Map ;
2017-07-15 20:00:02 +00:00
2020-11-08 19:15:03 +00:00
import static org.junit.jupiter.api.Assertions.* ;
2017-12-30 20:59:23 +00:00
2017-07-25 22:26:50 +00:00
/ * *
* Compile a number of source files and compare the resulting assembler with expected output
* /
2017-12-30 20:59:23 +00:00
public class TestPrograms {
2017-07-15 20:00:02 +00:00
2020-04-11 19:15:34 +00:00
final String stdIncludePath = " src/main/kc/include " ;
final String stdLibPath = " src/main/kc/lib " ;
2020-05-11 00:36:37 +00:00
final String stdPlatformPath = " src/main/kc/target " ;
2018-10-07 00:31:25 +00:00
final String testPath = " src/test/kc " ;
final String refPath = " src/test/ref/ " ;
2017-07-15 20:00:02 +00:00
2018-08-11 09:30:19 +00:00
public TestPrograms ( ) {
2017-07-15 20:00:02 +00:00
}
2017-11-24 22:25:16 +00:00
2020-12-09 21:42:17 +00:00
@Test
public void testLocalVarShadowingProcedure ( ) throws IOException , URISyntaxException {
assertError ( " local-var-shadowing-procedure.c " , " Called symbol is not a procedure. main::doit " ) ;
}
2020-12-05 22:56:01 +00:00
@Test
public void testAdventOfCode04 ( ) throws IOException , URISyntaxException {
compileAndCompare ( " adventofcode/2020-04.c " ) ;
}
@Test
public void testAdventOfCode03 ( ) throws IOException , URISyntaxException {
compileAndCompare ( " adventofcode/2020-03.c " ) ;
}
@Test
public void testAdventOfCode02 ( ) throws IOException , URISyntaxException {
compileAndCompare ( " adventofcode/2020-02.c " ) ;
}
@Test
public void testAdventOfCode01 ( ) throws IOException , URISyntaxException {
compileAndCompare ( " adventofcode/2020-01.c " ) ;
}
2020-12-06 00:56:33 +00:00
@Test
public void testMissingBand ( ) throws IOException , URISyntaxException {
compileAndCompare ( " missing-band.c " ) ;
}
2020-12-05 22:56:01 +00:00
2020-11-04 08:09:38 +00:00
// https://gitlab.com/camelot/kickc/-/issues/564
//@Test
//public void testUnknownVarProblem() throws IOException, URISyntaxException {
// compileAndCompare("unknown-var-problem.c", log().verboseParse());
//}
2020-12-05 22:56:01 +00:00
// TODO: Fix functions returning __ma/__ssa structs
//@Test
//public void testStructUnwinding3() throws IOException, URISyntaxException {
// compileAndCompare("struct-unwinding-3.c", log().verboseCreateSsa().verboseCreateSsa());
//}
2020-11-23 10:46:54 +00:00
@Test
2020-12-05 22:56:01 +00:00
public void testStructUnwinding2 ( ) throws IOException , URISyntaxException {
compileAndCompare ( " struct-unwinding-2.c " ) ;
2020-11-23 10:46:54 +00:00
}
2020-12-05 22:56:01 +00:00
@Test
public void testStructUnwinding1 ( ) throws IOException , URISyntaxException {
compileAndCompare ( " struct-unwinding-1.c " ) ;
}
// TODO: Fix __varcall returning structs
//@Test
//public void testVarCall4() throws IOException, URISyntaxException {
// compileAndCompare("varcall-4.c", log().verboseStructUnwind().verboseCreateSsa());
//}
2020-11-23 09:08:11 +00:00
@Test
public void testVarCall3 ( ) throws IOException , URISyntaxException {
compileAndCompare ( " varcall-3.c " ) ;
}
2020-11-22 21:39:15 +00:00
@Test
public void testVarCall2 ( ) throws IOException , URISyntaxException {
compileAndCompare ( " varcall-2.c " ) ;
}
2020-11-22 21:29:48 +00:00
@Test
public void testVarCall1 ( ) throws IOException , URISyntaxException {
2020-11-22 21:39:15 +00:00
compileAndCompare ( " varcall-1.c " ) ;
2020-11-22 21:29:48 +00:00
}
2020-11-06 07:16:28 +00:00
@Test
public void testConstVolatileProblem1 ( ) throws IOException , URISyntaxException {
2020-11-06 07:21:23 +00:00
compileAndCompare ( " const-volatile-problem.c " ) ;
2020-11-06 07:16:28 +00:00
}
2020-11-01 17:49:10 +00:00
@Test
public void testFunctionPointerProblem1 ( ) throws IOException , URISyntaxException {
compileAndCompare ( " function-pointer-problem-1.c " ) ;
}
2020-11-02 00:18:03 +00:00
@Test
public void testInlineAsmUsesProblem2 ( ) throws IOException , URISyntaxException {
compileAndCompare ( " inline-asm-uses-problem-2.c " ) ;
}
2020-11-01 07:19:32 +00:00
@Test
public void testInlineKickasmUsesProblem ( ) throws IOException , URISyntaxException {
compileAndCompare ( " inline-kickasm-uses-problem.c " ) ;
}
2020-10-30 15:05:31 +00:00
@Test
public void test32bitRols ( ) throws IOException , URISyntaxException {
compileAndCompare ( " 32bit-rols.c " ) ;
}
2020-10-30 19:10:13 +00:00
@Test
public void testAtariXlMd5b ( ) throws IOException , URISyntaxException {
compileAndCompare ( " atarixl-md5b.c " ) ;
}
2020-11-02 14:00:09 +00:00
2020-10-30 09:43:01 +00:00
@Test
public void testAtariXlMd5 ( ) throws IOException , URISyntaxException {
compileAndCompare ( " atarixl-md5.c " ) ;
}
2020-10-30 08:17:34 +00:00
@Test
public void testZpReserveCoalesceProblem ( ) throws IOException , URISyntaxException {
compileAndCompare ( " zp-reserve-coalesce-problem.c " ) ;
}
2020-10-19 21:59:26 +00:00
@Test
public void testChipsetTest ( ) throws IOException , URISyntaxException {
compileAndCompare ( " chipset-test.c " ) ;
}
2020-10-12 17:59:07 +00:00
@Test
public void testConstRefNotLiteralProblem ( ) throws IOException , URISyntaxException {
compileAndCompare ( " constref-not-literal-problem.c " ) ;
}
2020-10-05 21:35:41 +00:00
@Test
public void testStrengthReduction1 ( ) throws IOException , URISyntaxException {
compileAndCompare ( " strength-reduction-1.c " ) ;
}
2020-10-01 08:31:34 +00:00
@Test
public void testProblemBoolCompare2 ( ) throws IOException , URISyntaxException {
compileAndCompare ( " problem-bool-compare-2.c " ) ;
}
2020-10-01 06:45:55 +00:00
@Test
public void testProblemBoolCompare ( ) throws IOException , URISyntaxException {
compileAndCompare ( " problem-bool-compare.c " ) ;
}
2020-09-28 22:42:25 +00:00
@Test
public void testIndexSizeofReuse ( ) throws IOException , URISyntaxException {
compileAndCompare ( " index-sizeof-reuse.c " ) ;
}
2020-09-28 23:35:08 +00:00
@Test
public void testIndexSizeofReuse2 ( ) throws IOException , URISyntaxException {
compileAndCompare ( " index-sizeof-reuse-2.c " ) ;
}
2020-10-01 20:30:04 +00:00
@Test
public void testIndexPointerRewrite0 ( ) throws IOException , URISyntaxException {
compileAndCompare ( " index-pointer-rewrite-0.c " ) ;
}
@Test
public void testIndexPointerRewrite1 ( ) throws IOException , URISyntaxException {
compileAndCompare ( " index-pointer-rewrite-1.c " ) ;
}
@Test
public void testIndexPointerRewrite2 ( ) throws IOException , URISyntaxException {
compileAndCompare ( " index-pointer-rewrite-2.c " ) ;
}
@Test
public void testIndexPointerRewrite3 ( ) throws IOException , URISyntaxException {
compileAndCompare ( " index-pointer-rewrite-3.c " ) ;
}
@Test
public void testIndexPointerRewrite4 ( ) throws IOException , URISyntaxException {
compileAndCompare ( " index-pointer-rewrite-4.c " ) ;
}
@Test
public void testIndexPointerRewrite5 ( ) throws IOException , URISyntaxException {
compileAndCompare ( " index-pointer-rewrite-5.c " ) ;
}
@Test
public void testIndexPointerRewrite6 ( ) throws IOException , URISyntaxException {
compileAndCompare ( " index-pointer-rewrite-6.c " ) ;
}
@Test
public void testIndexPointerRewrite7 ( ) throws IOException , URISyntaxException {
compileAndCompare ( " index-pointer-rewrite-7.c " ) ;
}
@Test
public void testIndexPointerRewrite8 ( ) throws IOException , URISyntaxException {
compileAndCompare ( " index-pointer-rewrite-8.c " ) ;
}
@Test
public void testIndexPointerRewrite9 ( ) throws IOException , URISyntaxException {
compileAndCompare ( " index-pointer-rewrite-9.c " ) ;
}
2020-08-27 21:40:10 +00:00
@Test
public void testPragmaNoParenthesis ( ) throws IOException , URISyntaxException {
compileAndCompare ( " pragma-noparenthesis.c " ) ;
}
2020-08-25 23:24:04 +00:00
@Test
public void testPragmaUnknown ( ) throws IOException , URISyntaxException {
compileAndCompare ( " pragma-unknown.c " ) ;
}
2020-11-08 19:15:03 +00:00
@Test
public void testErrorFormatter ( ) throws IOException , URISyntaxException {
2020-11-15 13:15:07 +00:00
// Error on a char
assertError ( " printf-error-6.c " , " printf-error-6.c:7:5: error: printf missing parameter with index 1 " ) ;
// Error on a line
assertError ( " library-constructor-error-2.c " , " library-constructor-error-2.c:4: error: Procedure not found print " ) ;
// Error without a line
assertError ( " cstyle-decl-function-missing.c " , " Error! Function body is never defined: sum " , false ) ;
2020-11-08 19:15:03 +00:00
}
2020-08-24 22:27:42 +00:00
@Test
public void testLibraryConstructorError2 ( ) throws IOException , URISyntaxException {
2020-11-08 19:45:22 +00:00
assertError ( " library-constructor-error-2.c " , " Procedure not found print " ) ;
2020-08-24 22:27:42 +00:00
}
@Test
public void testLibraryConstructorError1 ( ) throws IOException , URISyntaxException {
2020-11-08 19:45:22 +00:00
assertError ( " library-constructor-error-1.c " , " Constructor procedure not found my_init " ) ;
2020-08-24 22:27:42 +00:00
}
@Test
public void testLibraryConstructorError0 ( ) throws IOException , URISyntaxException {
2020-11-08 19:45:22 +00:00
assertError ( " library-constructor-error-0.c " , " #pragma constructor_for requires at least 2 parameters. " ) ;
2020-08-24 22:27:42 +00:00
}
2020-08-23 22:35:48 +00:00
@Test
2020-08-25 20:28:41 +00:00
public void testLibraryConstructor3 ( ) throws IOException , URISyntaxException {
compileAndCompare ( " library-constructor-3.c " ) ;
2020-08-23 22:35:48 +00:00
}
2020-08-24 22:27:42 +00:00
@Test
2020-08-25 20:28:41 +00:00
public void testLibraryConstructor2 ( ) throws IOException , URISyntaxException {
compileAndCompare ( " library-constructor-2.c " ) ;
2020-08-24 22:27:42 +00:00
}
2020-08-23 22:35:48 +00:00
@Test
public void testLibraryConstructor1 ( ) throws IOException , URISyntaxException {
compileAndCompare ( " library-constructor-1.c " ) ;
}
//@Test
//public void testLibraryConstructor0() throws IOException, URISyntaxException {
// compileAndCompare("library-constructor-0.c");
//}
2020-07-30 12:11:17 +00:00
@Test
public void testCpu45GS02AddressingModes ( ) throws IOException , URISyntaxException {
compileAndCompare ( " cpu-45gs02-addressing-modes.c " ) ;
}
2020-07-29 21:52:38 +00:00
@Test
public void testCpu65CE02AddressingModes ( ) throws IOException , URISyntaxException {
compileAndCompare ( " cpu-65ce02-addressing-modes.c " ) ;
}
2020-07-28 17:05:58 +00:00
@Test
2020-07-28 20:40:24 +00:00
public void testCpu65C02AddressingModes ( ) throws IOException , URISyntaxException {
compileAndCompare ( " cpu-65c02-addressing-modes.c " ) ;
}
@Test
public void testCpu6502AddressingModes ( ) throws IOException , URISyntaxException {
compileAndCompare ( " cpu-6502-addressing-modes.c " ) ;
2020-07-28 19:31:17 +00:00
}
@Test
2020-07-30 12:11:17 +00:00
public void testCpu45GS02 ( ) throws IOException , URISyntaxException {
2020-07-28 19:31:17 +00:00
compileAndCompare ( " cpu-45gs02.c " ) ;
}
2020-08-01 01:01:00 +00:00
@Test
public void testCpu65CE02EightQueens ( ) throws IOException , URISyntaxException {
compileAndCompare ( " cpu-65ce02-eightqueens.c " ) ;
}
2020-07-31 21:16:54 +00:00
@Test
public void testCpu65CE02b ( ) throws IOException , URISyntaxException {
compileAndCompare ( " cpu-65ce02-b.c " ) ;
}
2020-07-29 23:20:41 +00:00
@Test
public void testCpu65CE02 ( ) throws IOException , URISyntaxException {
2020-07-30 12:11:17 +00:00
compileAndCompare ( " cpu-65ce02.c " ) ;
2020-07-29 23:20:41 +00:00
}
2020-07-28 19:31:17 +00:00
@Test
public void testCpu65C02 ( ) throws IOException , URISyntaxException {
compileAndCompare ( " cpu-65c02.c " ) ;
}
@Test
public void testCpu6502 ( ) throws IOException , URISyntaxException {
compileAndCompare ( " cpu-6502.c " ) ;
2020-07-28 17:05:58 +00:00
}
2020-07-22 07:10:34 +00:00
@Test
public void testCastingNegative ( ) throws IOException , URISyntaxException {
compileAndCompare ( " casting-negative.c " ) ;
}
2020-07-07 06:32:42 +00:00
@Test
public void testForEver2 ( ) throws IOException , URISyntaxException {
2020-07-07 11:07:26 +00:00
compileAndCompare ( " for-ever-2.c " ) ;
2020-07-07 06:32:42 +00:00
}
@Test
public void testForEver ( ) throws IOException , URISyntaxException {
compileAndCompare ( " for-ever.c " ) ;
}
2020-07-05 16:38:55 +00:00
2020-07-01 21:45:09 +00:00
@Test
public void testPointerToPointerProblem ( ) throws IOException , URISyntaxException {
compileAndCompare ( " pointer-to-pointer-problem.c " ) ;
}
2020-06-27 22:16:25 +00:00
@Test
2020-06-27 22:21:27 +00:00
public void testStmtEmpty1 ( ) throws IOException , URISyntaxException {
compileAndCompare ( " stmt-empty-1.c " ) ;
}
@Test
public void testStmtEmpty0 ( ) throws IOException , URISyntaxException {
2020-06-27 22:16:25 +00:00
compileAndCompare ( " stmt-empty.c " ) ;
}
2020-06-27 18:32:09 +00:00
@Test
public void testEmptyFunction2 ( ) throws IOException , URISyntaxException {
compileAndCompare ( " empty-function-2.c " ) ;
}
@Test
public void testEmptyFunction1 ( ) throws IOException , URISyntaxException {
compileAndCompare ( " empty-function-1.c " ) ;
}
@Test
public void testEmptyFunction0 ( ) throws IOException , URISyntaxException {
compileAndCompare ( " empty-function-0.c " ) ;
}
2020-06-16 21:30:38 +00:00
@Test
2020-06-18 08:01:45 +00:00
public void testStaticInitCode2 ( ) throws IOException , URISyntaxException {
2020-06-18 23:23:34 +00:00
compileAndCompare ( " static-init-code-2.c " ) ;
2020-06-18 08:01:45 +00:00
}
@Test
public void testStaticInitCode1 ( ) throws IOException , URISyntaxException {
compileAndCompare ( " static-init-code-1.c " ) ;
2020-06-16 21:30:38 +00:00
}
2020-06-14 11:10:26 +00:00
@Test
2020-06-18 08:01:45 +00:00
public void testStaticInitCode0 ( ) throws IOException , URISyntaxException {
compileAndCompare ( " static-init-code-0.c " ) ;
}
@Test
public void testStrcpy0 ( ) throws IOException , URISyntaxException {
compileAndCompare ( " strcpy-0.c " ) ;
2020-06-14 11:10:26 +00:00
}
2020-06-10 05:12:10 +00:00
2020-06-06 06:48:00 +00:00
@Test
public void testConstParenthesis ( ) throws IOException , URISyntaxException {
compileAndCompare ( " const-parenthesis.c " ) ;
}
2020-06-05 14:35:14 +00:00
@Test
public void testGlobalLabelProblem ( ) throws IOException , URISyntaxException {
compileAndCompare ( " global-label-problem.c " ) ;
}
2020-05-27 07:05:20 +00:00
@Test
public void testProblemMaVarOverwrite ( ) throws IOException , URISyntaxException {
compileAndCompare ( " problem-ma-var-overwrite.c " ) ;
}
@Test
public void testMinusPrecedenceProblem ( ) throws IOException , URISyntaxException {
compileAndCompare ( " minus-precedence-problem.c " ) ;
}
2020-09-28 21:45:41 +00:00
@Test
public void testbubbles64 ( ) throws IOException , URISyntaxException {
compileAndCompare ( " complex/bubbles64/bubbles64.c " ) ;
}
2020-09-28 18:32:39 +00:00
@Test
public void testNesBalls ( ) throws IOException , URISyntaxException {
compileAndCompare ( " complex/nes-balls/kickballs-2.c " ) ;
}
2020-09-26 19:59:10 +00:00
2020-09-30 22:54:08 +00:00
@Test
public void testNesBalls3 ( ) throws IOException , URISyntaxException {
compileAndCompare ( " complex/nes-balls/kickballs-3.c " ) ;
}
2020-06-07 01:56:27 +00:00
@Test
public void testNesDxycp ( ) throws IOException , URISyntaxException {
2020-09-28 18:32:39 +00:00
compileAndCompare ( " examples/nes/nes-dxycp.c " ) ;
2020-06-07 01:56:27 +00:00
}
2020-06-05 23:19:28 +00:00
@Test
public void testNesConio ( ) throws IOException , URISyntaxException {
2020-09-28 18:32:39 +00:00
compileAndCompare ( " examples/nes/nes-conio.c " ) ;
2020-06-05 23:19:28 +00:00
}
2020-05-27 07:05:20 +00:00
2020-05-23 22:28:38 +00:00
@Test
public void testNesDemo ( ) throws IOException , URISyntaxException {
2020-09-28 18:32:39 +00:00
compileAndCompare ( " examples/nes/nes-demo.c " ) ;
2020-05-23 22:28:38 +00:00
}
2020-12-16 21:24:38 +00:00
@Test
2020-12-17 22:23:46 +00:00
public void testCx16Sprites ( ) throws IOException , URISyntaxException {
compileAndCompare ( " examples/cx16/sprites.c " ) ;
2020-12-16 21:24:38 +00:00
}
2020-12-14 23:42:52 +00:00
@Test
public void testCx16Text ( ) throws IOException , URISyntaxException {
compileAndCompare ( " examples/cx16/text.c " ) ;
}
2020-12-14 00:29:39 +00:00
@Test
public void testCx16Rasterbars ( ) throws IOException , URISyntaxException {
compileAndCompare ( " examples/cx16/rasterbars.c " ) ;
}
2020-09-26 19:59:10 +00:00
//@Test
//public void testMega65Wator() throws IOException, URISyntaxException {
// compileAndCompare("complex/m65wator/main.c");
//}
2020-09-26 11:30:48 +00:00
@Test
public void testMega65BankedMusic ( ) throws IOException , URISyntaxException {
compileAndCompare ( " examples/mega65/banked-music.c " ) ;
}
2020-12-03 00:37:58 +00:00
@Test
public void testMega65DmaTest6 ( ) throws IOException , URISyntaxException {
compileAndCompare ( " examples/mega65/dma-test6.c " ) ;
}
@Test
public void testMega65DmaTest5 ( ) throws IOException , URISyntaxException {
compileAndCompare ( " examples/mega65/dma-test5.c " ) ;
}
2020-09-26 11:30:48 +00:00
@Test
public void testMega65DmaTest4 ( ) throws IOException , URISyntaxException {
compileAndCompare ( " examples/mega65/dma-test4.c " ) ;
}
@Test
public void testMega65DmaTest3 ( ) throws IOException , URISyntaxException {
compileAndCompare ( " examples/mega65/dma-test3.c " ) ;
}
2020-09-22 19:27:07 +00:00
@Test
2020-09-26 06:57:29 +00:00
public void testMega65DmaTest2 ( ) throws IOException , URISyntaxException {
compileAndCompare ( " examples/mega65/dma-test2.c " ) ;
}
@Test
public void testMega65DmaTest ( ) throws IOException , URISyntaxException {
compileAndCompare ( " examples/mega65/dma-test.c " ) ;
2020-09-22 19:27:07 +00:00
}
2020-09-20 20:32:42 +00:00
@Test
public void testMega65MemoryMapTest ( ) throws IOException , URISyntaxException {
compileAndCompare ( " examples/mega65/memorymap-test.c " ) ;
}
2020-08-09 20:34:40 +00:00
@Test
public void testMega65Addressing32bit ( ) throws IOException , URISyntaxException {
compileAndCompare ( " examples/mega65/32bit-addressing-mega65.c " ) ;
}
2020-08-23 23:21:18 +00:00
@Test
public void testMega65HelloWorld ( ) throws IOException , URISyntaxException {
compileAndCompare ( " examples/mega65/helloworld-mega65.c " ) ;
}
2020-08-09 18:36:54 +00:00
@Test
public void testMega65Hello ( ) throws IOException , URISyntaxException {
compileAndCompare ( " examples/mega65/hello-mega65.c " ) ;
}
2020-08-23 18:09:12 +00:00
@Test
public void testMega65Vic4 ( ) throws IOException , URISyntaxException {
compileAndCompare ( " examples/mega65/test-vic4.c " ) ;
}
2020-09-13 22:22:23 +00:00
@Test
public void testMega65Raster65 ( ) throws IOException , URISyntaxException {
compileAndCompare ( " examples/mega65/raster65.c " ) ;
}
2020-12-03 00:37:58 +00:00
@Test
public void testMega65Dypp65 ( ) throws IOException , URISyntaxException {
compileAndCompare ( " examples/mega65/dypp65.c " ) ;
}
2020-10-19 10:22:42 +00:00
@Test
public void testAtariXlConioTest ( ) throws IOException , URISyntaxException {
compileAndCompare ( " examples/atarixl/conio-test.c " ) ;
}
2020-08-16 23:10:02 +00:00
@Test
public void testAtariXlRasterbars ( ) throws IOException , URISyntaxException {
compileAndCompare ( " examples/atarixl/rasterbars.c " ) ;
}
2020-08-06 08:57:27 +00:00
@Test
public void testAtariXlHello ( ) throws IOException , URISyntaxException {
compileAndCompare ( " examples/atarixl/helloxl.c " ) ;
}
2020-05-21 19:34:34 +00:00
@Test
public void testAtari2600Sprites ( ) throws IOException , URISyntaxException {
compileAndCompare ( " examples/atari2600/atari2600-sprites.c " ) ;
}
2020-05-16 20:13:47 +00:00
@Test
2020-05-17 21:52:58 +00:00
public void testAtari2600Demo ( ) throws IOException , URISyntaxException {
compileAndCompare ( " examples/atari2600/atari2600-demo.c " ) ;
2020-05-16 20:13:47 +00:00
}
2020-05-16 15:35:25 +00:00
@Test
public void testVic20Raster ( ) throws IOException , URISyntaxException {
compileAndCompare ( " vic20-raster.c " ) ;
}
2020-05-16 14:28:24 +00:00
@Test
public void testVic20Simple ( ) throws IOException , URISyntaxException {
compileAndCompare ( " vic20-simple.c " ) ;
}
2020-05-16 10:45:35 +00:00
@Test
public void testPlus4KeyboardTest ( ) throws IOException , URISyntaxException {
2020-05-16 11:05:59 +00:00
compileAndCompare ( " plus4-keyboard-test.c " ) ;
2020-05-16 10:45:35 +00:00
}
2020-05-16 10:40:01 +00:00
@Test
public void testPlus4Kbhit ( ) throws IOException , URISyntaxException {
compileAndCompare ( " plus4-kbhit.c " ) ;
}
2020-05-15 06:19:26 +00:00
@Test
public void testPlatformPlus4Define ( ) throws IOException , URISyntaxException {
compileAndCompare ( " platform-plus4-define.c " ) ;
}
@Test
public void testPlatformDefaultDefine ( ) throws IOException , URISyntaxException {
compileAndCompare ( " platform-default-define.c " ) ;
}
2020-05-11 22:08:11 +00:00
@Test
public void testIncludeDefine ( ) throws IOException , URISyntaxException {
compileAndCompare ( " include-define.c " ) ;
}
2020-05-11 18:55:29 +00:00
@Test
public void testStructPointerInts ( ) throws IOException , URISyntaxException {
compileAndCompare ( " struct-pointer-ints.c " ) ;
}
2020-05-06 20:36:46 +00:00
@Test
2020-07-22 07:10:34 +00:00
public void testXyScroller ( ) throws IOException , URISyntaxException {
2020-07-14 18:14:57 +00:00
compileAndCompare ( " complex/xy-scroller/xy-scroller.c " ) ;
}
@Test
2020-07-22 07:10:34 +00:00
public void testPolygon ( ) throws IOException , URISyntaxException {
2020-05-08 16:28:48 +00:00
compileAndCompare ( " complex/polygon/polygon.c " ) ;
2020-05-06 20:36:46 +00:00
}
2020-05-03 23:24:28 +00:00
@Test
2020-05-08 16:28:48 +00:00
public void testPlus4Walk ( ) throws IOException , URISyntaxException {
compileAndCompare ( " examples/plus4walk/plus4walk.c " ) ;
}
@Test
public void testCircleChars ( ) throws IOException , URISyntaxException {
compileAndCompare ( " circlechars.c " ) ;
2020-05-03 23:24:28 +00:00
}
2020-05-05 05:49:32 +00:00
@Test
public void testRand1 ( ) throws IOException , URISyntaxException {
compileAndCompare ( " rand-1.c " ) ;
}
2020-05-03 23:24:28 +00:00
@Test
public void testPrngXorshift ( ) throws IOException , URISyntaxException {
compileAndCompare ( " prng-xorshift.c " ) ;
}
@Test
public void testStars2 ( ) throws IOException , URISyntaxException {
compileAndCompare ( " stars-2.c " ) ;
}
@Test
public void testStars1 ( ) throws IOException , URISyntaxException {
compileAndCompare ( " stars-1.c " ) ;
}
2020-05-02 09:38:51 +00:00
/ * TODO : Add support for var * var
@Test
public void testMultiply3 ( ) throws IOException , URISyntaxException {
compileAndCompare ( " multiply-3.c " ) ;
}
* /
@Test
public void testMultiply2 ( ) throws IOException , URISyntaxException {
compileAndCompare ( " multiply-2.c " ) ;
}
@Test
public void testMultiply1 ( ) throws IOException , URISyntaxException {
compileAndCompare ( " multiply-1.c " ) ;
}
2020-05-03 11:59:48 +00:00
@Test
public void testDoubleCallProblem ( ) throws IOException , URISyntaxException {
2020-11-08 19:45:22 +00:00
assertError ( " double-call-problem.c " , " Function clrscr does not return a value! " ) ;
2020-05-03 11:59:48 +00:00
}
2020-04-30 21:42:45 +00:00
@Test
public void testStructPointerToMember2 ( ) throws IOException , URISyntaxException {
compileAndCompare ( " struct-pointer-to-member-2.c " ) ;
}
2020-04-30 20:15:59 +00:00
@Test
public void testStructPointerToMember ( ) throws IOException , URISyntaxException {
2020-04-30 21:42:45 +00:00
compileAndCompare ( " struct-pointer-to-member.c " ) ;
2020-04-30 20:15:59 +00:00
}
@Test
public void testSizeOfInConstPointer ( ) throws IOException , URISyntaxException {
compileAndCompare ( " sizeof-in-const-pointer.c " ) ;
}
2020-04-26 21:30:04 +00:00
@Test
public void testTod1 ( ) throws IOException , URISyntaxException {
compileAndCompare ( " tod-1.c " ) ;
}
2020-04-26 11:57:53 +00:00
@Test
public void testEightQueensRecursive ( ) throws IOException , URISyntaxException {
compileAndCompare ( " examples/eightqueens/eightqueens-recursive.c " ) ;
}
2020-04-25 21:28:38 +00:00
@Test
public void testEightQueens ( ) throws IOException , URISyntaxException {
compileAndCompare ( " examples/eightqueens/eightqueens.c " ) ;
}
2020-04-25 19:09:46 +00:00
@Test
public void testAtoi ( ) throws IOException , URISyntaxException {
compileAndCompare ( " atoi-1.c " ) ;
}
2020-04-25 18:23:40 +00:00
@Test
public void testToUpper1 ( ) throws IOException , URISyntaxException {
compileAndCompare ( " toupper-1.c " ) ;
}
2020-05-03 11:59:48 +00:00
@Test
public void testPrintfError6 ( ) throws IOException , URISyntaxException {
2020-11-08 19:45:22 +00:00
assertError ( " printf-error-6.c " , " printf missing parameter with index 1 " ) ;
2020-05-03 11:59:48 +00:00
}
2020-04-25 12:53:14 +00:00
@Test
public void testPrintfError5 ( ) throws IOException , URISyntaxException {
2020-11-08 19:45:22 +00:00
assertError ( " printf-error-5.c " , " printf() format parameter must be a string! " ) ;
2020-04-25 12:53:14 +00:00
}
@Test
public void testPrintfError4 ( ) throws IOException , URISyntaxException {
2020-11-08 19:45:22 +00:00
assertError ( " printf-error-4.c " , " Only constant printf() format parameter supported! " ) ;
2020-04-25 12:53:14 +00:00
}
2020-04-25 12:48:20 +00:00
@Test
public void testPrintfError3 ( ) throws IOException , URISyntaxException {
2020-11-08 19:45:22 +00:00
assertError ( " printf-error-3.c " , " If any single printf() placeholder specifies a parameter, all the rest of the placeholders must also specify a parameter! " ) ;
2020-04-25 12:48:20 +00:00
}
@Test
public void testPrintfError2 ( ) throws IOException , URISyntaxException {
2020-11-08 19:45:22 +00:00
assertError ( " printf-error-2.c " , " If any single printf() placeholder specifies a parameter, all the rest of the placeholders must also specify a parameter! " ) ;
2020-04-25 12:48:20 +00:00
}
2020-04-21 06:41:52 +00:00
@Test
public void testPrintfError1 ( ) throws IOException , URISyntaxException {
assertError ( " printf-error-1.c " , " Needed printf sub-procedure not found " ) ;
}
2020-05-20 20:25:39 +00:00
@Test
public void testPrintfSpeed ( ) throws IOException , URISyntaxException {
compileAndCompare ( " printf-speed.c " ) ;
}
2020-04-25 12:48:20 +00:00
@Test
public void testPrintf16 ( ) throws IOException , URISyntaxException {
compileAndCompare ( " printf-16.c " ) ;
}
2020-04-21 22:14:30 +00:00
@Test
public void testPrintf15 ( ) throws IOException , URISyntaxException {
compileAndCompare ( " printf-15.c " ) ;
}
2020-04-21 08:39:07 +00:00
@Test
public void testPrintf14 ( ) throws IOException , URISyntaxException {
compileAndCompare ( " printf-14.c " ) ;
}
2020-04-21 06:41:52 +00:00
@Test
public void testPrintf13 ( ) throws IOException , URISyntaxException {
compileAndCompare ( " printf-13.c " ) ;
}
@Test
public void testPrintf12 ( ) throws IOException , URISyntaxException {
compileAndCompare ( " printf-12.c " ) ;
}
2020-04-19 21:29:37 +00:00
@Test
2020-04-20 17:00:16 +00:00
public void testPrintf11 ( ) throws IOException , URISyntaxException {
compileAndCompare ( " printf-11.c " ) ;
}
@Test
public void testPrintf10 ( ) throws IOException , URISyntaxException {
2020-04-20 06:55:50 +00:00
compileAndCompare ( " printf-10.c " ) ;
2020-04-19 21:29:37 +00:00
}
2020-04-19 09:13:57 +00:00
@Test
2020-04-25 11:15:22 +00:00
public void testPrintf2 ( ) throws IOException , URISyntaxException {
compileAndCompare ( " printf-2.c " ) ;
2020-04-19 09:13:57 +00:00
}
2020-04-18 18:54:39 +00:00
2020-04-19 09:53:15 +00:00
@Test
2020-04-25 11:15:22 +00:00
public void testPrintf1 ( ) throws IOException , URISyntaxException {
compileAndCompare ( " printf-1.c " ) ;
2020-04-19 09:53:15 +00:00
}
2020-04-19 09:05:54 +00:00
@Test
2020-04-25 11:15:22 +00:00
public void testProblemNegateConst ( ) throws IOException , URISyntaxException {
compileAndCompare ( " problem-negate-const.c " ) ;
2020-04-19 09:05:54 +00:00
}
2020-04-18 18:54:39 +00:00
@Test
2020-04-25 11:15:22 +00:00
public void testProblemStructInlineParameter1 ( ) throws IOException , URISyntaxException {
compileAndCompare ( " problem-struct-inline-parameter-1.c " ) ;
2020-04-18 18:54:39 +00:00
}
@Test
2020-04-25 11:15:22 +00:00
public void testProblemStructInlineParameter ( ) throws IOException , URISyntaxException {
compileAndCompare ( " problem-struct-inline-parameter.c " ) ;
2020-04-18 18:54:39 +00:00
}
@Test
public void testPrimes10002 ( ) throws IOException , URISyntaxException {
compileAndCompare ( " primes-1000-2.c " ) ;
}
@Test
public void testPrimes1000 ( ) throws IOException , URISyntaxException {
compileAndCompare ( " primes-1000.c " ) ;
}
2020-04-12 21:52:23 +00:00
@Test
public void testConioNachtScreen ( ) throws IOException , URISyntaxException {
compileAndCompare ( " examples/conio/nacht-screen.c " ) ;
}
2020-10-11 13:56:17 +00:00
@Test
public void testPostIncrementProblem5 ( ) throws IOException , URISyntaxException {
assertError ( " post-increment-problem-5.c " , " Constants can not be modified " ) ;
}
2020-07-06 15:40:15 +00:00
@Test
public void testPostIncrementProblem4 ( ) throws IOException , URISyntaxException {
compileAndCompare ( " post-increment-problem-4.c " ) ;
}
@Test
public void testPostIncrementProblem3 ( ) throws IOException , URISyntaxException {
compileAndCompare ( " post-increment-problem-3.c " ) ;
}
2020-04-28 18:13:29 +00:00
@Test
public void testPostIncrementProblem2 ( ) throws IOException , URISyntaxException {
compileAndCompare ( " post-increment-problem-2.c " ) ;
}
2020-04-11 20:48:33 +00:00
@Test
public void testPostIncrementProblem ( ) throws IOException , URISyntaxException {
compileAndCompare ( " post-increment-problem.c " ) ;
}
@Test
public void testStrncat0 ( ) throws IOException , URISyntaxException {
compileAndCompare ( " strncat-0.c " ) ;
}
2020-04-11 19:15:34 +00:00
@Test
public void testIncludes3 ( ) throws IOException , URISyntaxException {
compileAndCompare ( " complex/includes/includes-3.c " ) ;
}
2020-04-09 21:56:43 +00:00
@Test
public void testIncludes2 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " complex/includes/includes-2.c " ) ;
2020-04-09 21:56:43 +00:00
}
@Test
public void testIncludes1 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " complex/includes/includes-1.c " ) ;
2020-04-09 21:56:43 +00:00
}
2020-04-08 21:52:49 +00:00
@Test
2020-04-09 07:21:43 +00:00
public void testCStyleDeclVarMultiple ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " cstyle-decl-var-multiple.c " ) ;
2020-04-08 21:52:49 +00:00
}
2020-04-08 21:44:40 +00:00
@Test
2020-04-09 07:21:43 +00:00
public void testCStyleDeclVarMissing ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
assertError ( " cstyle-decl-var-missing.c " , " Variable is declared but never defined: SCREEN " , false ) ;
2020-04-08 21:44:40 +00:00
}
@Test
2020-04-09 07:21:43 +00:00
public void testCStyleDeclVarMismatch ( ) throws IOException , URISyntaxException {
2020-11-08 19:45:22 +00:00
assertError ( " cstyle-decl-var-mismatch.c " , " Conflicting declarations for: SCREEN " ) ;
2020-04-08 21:44:40 +00:00
}
2020-04-08 21:40:27 +00:00
@Test
2020-04-09 07:21:43 +00:00
public void testCStyleDeclVarRedefinition ( ) throws IOException , URISyntaxException {
2020-11-08 19:45:22 +00:00
assertError ( " cstyle-decl-var-redefinition.c " , " Redefinition of variable: SCREEN " ) ;
2020-04-09 07:21:43 +00:00
}
@Test
public void testCStyleDeclVar ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " cstyle-decl-var.c " ) ;
2020-04-09 07:21:43 +00:00
}
@Test
public void testCStyleDeclFunctionMissing ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
assertError ( " cstyle-decl-function-missing.c " , " Error! Function body is never defined: sum " , false ) ;
2020-04-09 07:21:43 +00:00
}
@Test
public void testCStyleDeclFunctionRedefinition ( ) throws IOException , URISyntaxException {
2020-11-08 19:45:22 +00:00
assertError ( " cstyle-decl-function-redefinition.c " , " Redefinition of function: sum " ) ;
2020-04-09 07:21:43 +00:00
}
@Test
public void testCStyleDeclFunctionMismatch ( ) throws IOException , URISyntaxException {
2020-11-08 19:45:22 +00:00
assertError ( " cstyle-decl-function-mismatch.c " , " Conflicting declarations for: sum " ) ;
2020-04-09 07:21:43 +00:00
}
2020-04-25 13:46:27 +00:00
@Test
public void testCStyleDeclFunctionIntrinsic ( ) throws IOException , URISyntaxException {
compileAndCompare ( " cstyle-decl-function-intrinsic.c " ) ;
}
2020-04-09 07:21:43 +00:00
@Test
public void testCStyleDeclFunction ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " cstyle-decl-function.c " ) ;
2020-04-08 21:40:27 +00:00
}
2020-09-28 20:25:15 +00:00
@Test
public void testPreprocessor14 ( ) throws IOException , URISyntaxException {
compileAndCompare ( " preprocessor-14.c " ) ;
}
2020-09-27 17:48:54 +00:00
@Test
public void testPreprocessor13 ( ) throws IOException , URISyntaxException {
compileAndCompare ( " preprocessor-13.c " ) ;
}
2020-05-29 21:11:52 +00:00
@Test
public void testPreprocessor12 ( ) throws IOException , URISyntaxException {
compileAndCompare ( " preprocessor-12.c " ) ;
}
2020-05-29 20:21:20 +00:00
@Test
public void testPreprocessor11 ( ) throws IOException , URISyntaxException {
compileAndCompare ( " preprocessor-11.c " ) ;
}
@Test
public void testPreprocessor10 ( ) throws IOException , URISyntaxException {
assertError ( " preprocessor-10.c " , " Preprocessor causing an error! " ) ;
}
2020-04-11 11:41:10 +00:00
@Test
public void testPreprocessor9 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " preprocessor-9.c " ) ;
2020-04-11 11:41:10 +00:00
}
2020-04-05 20:54:00 +00:00
@Test
public void testPreprocessor8 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " preprocessor-8.c " ) ;
2020-04-05 20:54:00 +00:00
}
@Test
public void testPreprocessor7 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " preprocessor-7.c " ) ;
2020-04-05 20:54:00 +00:00
}
2020-04-05 18:34:33 +00:00
@Test
public void testPreprocessor6 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " preprocessor-6.c " ) ;
2020-04-05 18:34:33 +00:00
}
2020-04-05 18:13:40 +00:00
@Test
public void testPreprocessor5 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " preprocessor-5.c " ) ;
2020-04-05 18:13:40 +00:00
}
2020-04-05 16:06:06 +00:00
2020-04-05 18:09:34 +00:00
@Test
public void testPreprocessor4 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " preprocessor-4.c " ) ;
2020-04-05 18:09:34 +00:00
}
2020-04-05 16:28:32 +00:00
@Test
public void testPreprocessor3 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " preprocessor-3.c " ) ;
2020-04-05 16:28:32 +00:00
}
2020-04-05 12:32:07 +00:00
@Test
2020-04-05 16:06:06 +00:00
public void testPreprocessor2 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " preprocessor-2.c " ) ;
2020-04-05 12:32:07 +00:00
}
2020-04-05 12:45:32 +00:00
@Test
public void testPreprocessor1 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " preprocessor-1.c " ) ;
2020-04-05 12:45:32 +00:00
}
2020-04-05 16:06:06 +00:00
@Test
public void testPreprocessor0 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " preprocessor-0.c " ) ;
2020-04-05 16:06:06 +00:00
}
2020-02-13 23:32:19 +00:00
@Test
public void testMaCoalesceProblem ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " ma_coalesce_problem.c " ) ;
2020-02-13 23:32:19 +00:00
}
2020-02-22 19:45:35 +00:00
@Test
public void testVarModelMaMem5 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " varmodel-ma_mem-5.c " ) ;
2020-02-22 19:45:35 +00:00
}
2020-02-15 08:00:57 +00:00
@Test
public void testVarModelMaMem4 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " varmodel-ma_mem-4.c " ) ;
2020-02-15 08:00:57 +00:00
}
2020-02-09 14:06:16 +00:00
@Test
public void testVarModelMaMem3 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " varmodel-ma_mem-3.c " ) ;
2020-02-09 14:06:16 +00:00
}
2020-02-09 11:55:17 +00:00
@Test
public void testVarModelMaMem2 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " varmodel-ma_mem-2.c " ) ;
2020-02-09 11:55:17 +00:00
}
@Test
public void testVarModelMaMem ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " varmodel-ma_mem.c " ) ;
2020-02-09 11:55:17 +00:00
}
2020-02-08 09:35:43 +00:00
@Test
public void testVarModelUnknown ( ) throws IOException , URISyntaxException {
2020-11-08 19:45:22 +00:00
assertError ( " varmodel-unknown.c " , " Malformed var_model parameter " ) ;
2020-02-08 09:35:43 +00:00
}
2020-02-02 07:47:47 +00:00
@Test
public void testMillforkPlasma ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " millfork-benchmarks/plasma-kc.c " ) ;
2020-02-02 07:47:47 +00:00
}
@Test
public void testMillforkRomsum ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " millfork-benchmarks/romsum-kc.c " ) ;
2020-02-02 07:47:47 +00:00
}
@Test
public void testMillforkSieve ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " millfork-benchmarks/sieve-kc.c " ) ;
2020-02-02 07:47:47 +00:00
}
2020-02-01 18:07:52 +00:00
@Test
public void testMillforkLinkedlist ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " millfork-benchmarks/linkedlist-kc.c " ) ;
2020-02-01 18:07:52 +00:00
}
2020-01-20 20:41:14 +00:00
@Test
public void testSqrDelta ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " sqr-delta.c " ) ;
2020-01-20 20:41:14 +00:00
}
2020-01-19 22:37:15 +00:00
2019-12-26 08:51:41 +00:00
@Test
public void testRegister1 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
assertError ( " register-1.c " , " Unknown register " ) ;
2019-12-26 08:51:41 +00:00
}
2019-12-25 23:57:19 +00:00
@Test
public void testRegister0 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " register-0.c " ) ;
2019-12-25 23:57:19 +00:00
}
2020-04-13 20:04:11 +00:00
// TODO: Fix this. Currently a volatile __address() variable can still be optimized away completely.
//@Test
//public void testAddress7() throws IOException, URISyntaxException {
// compileAndCompare("address-7.c", log());
//}
2020-06-27 09:11:03 +00:00
@Test
public void testAddress10 ( ) throws IOException , URISyntaxException {
assertError ( " address-10.c " , " Error! Local array variables with __address() not allowed. " , false ) ;
}
@Test
public void testAddress9 ( ) throws IOException , URISyntaxException {
compileAndCompare ( " address-9.c " ) ;
}
2020-12-09 11:18:07 +00:00
@Test
public void testAddressWithExpressionValue ( ) throws IOException , URISyntaxException {
2020-12-09 11:22:51 +00:00
compileAndCompare ( " address-with-expression-value.c " ) ;
2020-12-09 11:18:07 +00:00
}
2020-06-27 09:11:03 +00:00
@Test
public void testAddress8 ( ) throws IOException , URISyntaxException {
compileAndCompare ( " address-8.c " ) ;
}
2019-12-25 23:57:19 +00:00
@Test
public void testAddress6 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " address-6.c " ) ;
2019-12-25 23:57:19 +00:00
}
@Test
public void testAddress5 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " address-5.c " ) ;
2019-12-25 23:57:19 +00:00
}
2019-12-25 18:54:02 +00:00
@Test
2019-12-25 23:17:01 +00:00
public void testAddress4 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " address-4.c " ) ;
2019-12-25 23:17:01 +00:00
}
@Test
public void testAddress3 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " address-3.c " ) ;
2019-12-25 23:17:01 +00:00
}
@Test
public void testAddress2 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " address-2.c " ) ;
2019-12-25 23:17:01 +00:00
}
@Test
public void testAddress1 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " address-1.c " ) ;
2019-12-25 23:17:01 +00:00
}
@Test
public void testAddress0 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " address-0.c " ) ;
2019-12-25 18:54:02 +00:00
}
2019-12-25 22:03:40 +00:00
@Test
public void testVolatile2 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " volatile-2.c " ) ;
2019-12-25 22:03:40 +00:00
}
2019-12-25 16:37:44 +00:00
@Test
public void testVolatile1 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " volatile-1.c " ) ;
2019-12-25 16:37:44 +00:00
}
@Test
public void testVolatile0 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " volatile-0.c " ) ;
2019-12-25 16:37:44 +00:00
}
2019-12-24 10:05:32 +00:00
@Test
2019-12-24 11:59:51 +00:00
public void testNomodify5 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
assertError ( " nomodify-5.c " , " const variable may not be modified " ) ;
2019-12-24 11:59:51 +00:00
}
@Test
public void testNomodify4 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " nomodify-4.c " ) ;
2019-12-24 11:59:51 +00:00
}
@Test
public void testNomodify3 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " nomodify-3.c " ) ;
2019-12-24 11:59:51 +00:00
}
@Test
public void testNomodify2 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
assertError ( " nomodify-2.c " , " const variable may not be modified " ) ;
2019-12-24 10:05:32 +00:00
}
@Test
public void testNomodify1 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
assertError ( " nomodify-1.c " , " const variable may not be modified " ) ;
2019-12-24 10:05:32 +00:00
}
2019-12-24 11:59:51 +00:00
@Test
public void testNomodify0 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
assertError ( " nomodify-0.c " , " const variable may not be modified " ) ;
2019-12-24 11:59:51 +00:00
}
2019-12-25 23:17:01 +00:00
@Test
public void testKernalLoad ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " examples/kernalload/kernalload.c " ) ;
2019-12-25 23:17:01 +00:00
}
2020-06-21 22:07:59 +00:00
@Test
public void testKrillLoad ( ) throws IOException , URISyntaxException {
compileAndCompare ( " examples/krillload/krillload.c " ) ;
}
2019-12-22 10:53:37 +00:00
@Test
public void testConstantWithPrePost ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
assertError ( " constant-prepost.c " , " Constant value contains a pre/post-modifier " ) ;
2019-12-22 10:53:37 +00:00
}
2020-03-31 07:55:49 +00:00
@Test
public void testSpriteScroller ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " complex/spritescroller/spritescroller.c " ) ;
2020-03-31 07:55:49 +00:00
}
2020-03-30 20:39:39 +00:00
2019-12-08 12:25:34 +00:00
@Test
public void testGridBobs ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " complex/prebob/grid-bobs.c " ) ;
2019-12-08 12:25:34 +00:00
}
2019-11-24 22:00:44 +00:00
@Test
2019-12-01 13:04:18 +00:00
public void testVogelBobs ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " complex/prebob/vogel-bobs.c " ) ;
2019-12-01 13:04:18 +00:00
}
@Test
public void testVogelSprites ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " complex/prebob/vogel-sprites.c " ) ;
2019-11-24 22:00:44 +00:00
}
2019-11-19 07:28:54 +00:00
@Test
public void testUnaryPlus ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " unary-plus.c " ) ;
2019-11-19 07:28:54 +00:00
}
2019-11-03 09:48:40 +00:00
@Test
public void testConstDeclaration ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " const-declaration.c " ) ;
2019-11-03 09:48:40 +00:00
}
2019-10-31 15:10:29 +00:00
@Test
public void testStaticRegisterOptimizationProblem ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " static-register-optimization-problem.c " ) ;
2019-10-31 15:10:29 +00:00
}
2019-10-20 12:06:54 +00:00
@Test
2019-10-20 18:41:16 +00:00
public void testDeclaredSsaVar0 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " declared-ssa-var-0.c " ) ;
2019-10-20 12:06:54 +00:00
}
2019-10-13 22:51:15 +00:00
@Test
public void testDeclaredMemoryVar8 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " declared-memory-var-8.c " ) ;
2019-10-13 22:51:15 +00:00
}
2019-10-13 21:49:52 +00:00
@Test
public void testDeclaredMemoryVar7 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " declared-memory-var-7.c " ) ;
2019-10-13 21:49:52 +00:00
}
2019-10-13 21:36:40 +00:00
@Test
public void testDeclaredMemoryVar6 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " declared-memory-var-6.c " ) ;
2019-10-13 21:36:40 +00:00
}
2019-09-30 21:57:27 +00:00
@Test
public void testDeclaredMemoryVar5 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " declared-memory-var-5.c " ) ;
2019-09-30 21:57:27 +00:00
}
2019-09-29 22:18:41 +00:00
@Test
public void testDeclaredMemoryVar4 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " declared-memory-var-4.c " ) ;
2019-09-29 22:18:41 +00:00
}
@Test
public void testDeclaredMemoryVar3 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " declared-memory-var-3.c " ) ;
2019-09-29 22:18:41 +00:00
}
2019-09-27 17:51:26 +00:00
@Test
public void testDeclaredMemoryVar2 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " declared-memory-var-2.c " ) ;
2019-09-27 17:51:26 +00:00
}
2019-09-26 12:53:33 +00:00
@Test
public void testDeclaredMemoryVar1 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " declared-memory-var-1.c " ) ;
2019-09-26 12:53:33 +00:00
}
2019-09-24 06:55:06 +00:00
@Test
2019-09-26 12:35:02 +00:00
public void testDeclaredMemoryVar0 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " declared-memory-var-0.c " ) ;
2019-09-24 06:55:06 +00:00
}
2020-04-25 14:51:35 +00:00
@Test
public void testProcedureCallingConventionStack13 ( ) throws IOException , URISyntaxException {
compileAndCompare ( " procedure-callingconvention-stack-13.c " ) ;
}
2020-03-08 08:43:12 +00:00
@Test
public void testProcedureCallingConventionStack12 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " procedure-callingconvention-stack-12.c " ) ;
2020-03-08 08:43:12 +00:00
}
2020-03-06 23:33:07 +00:00
@Test
public void testProcedureCallingConventionStack11 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " procedure-callingconvention-stack-11.c " ) ;
2020-03-06 23:33:07 +00:00
}
2020-03-05 08:13:52 +00:00
@Test
public void testProcedureCallingConventionStack10 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " procedure-callingconvention-stack-10.c " ) ;
2020-03-05 08:13:52 +00:00
}
2020-03-01 22:02:07 +00:00
@Test
public void testProcedureCallingConventionStack9 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " procedure-callingconvention-stack-9.c " ) ;
2020-03-01 22:02:07 +00:00
}
2020-03-01 16:05:54 +00:00
@Test
public void testProcedureCallingConventionStack8 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " procedure-callingconvention-stack-8.c " ) ;
2020-03-01 16:05:54 +00:00
}
@Test
public void testProcedureCallingConventionStack7 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " procedure-callingconvention-stack-7.c " ) ;
2020-03-01 16:05:54 +00:00
}
2019-09-23 20:42:07 +00:00
/ *
@Test
public void testProcedureCallingConventionStack6 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " procedure-callingconvention-stack-6.c " , log ( ) ) ; //, log().verboseCreateSsa().verboseParse().verboseStatementSequence());
2019-09-23 20:42:07 +00:00
}
* /
2019-09-23 15:53:23 +00:00
@Test
public void testProcedureCallingConventionStack5 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " procedure-callingconvention-stack-5.c " ) ; //, log().verboseCreateSsa().verboseParse().verboseStatementSequence());
2019-09-23 15:53:23 +00:00
}
2019-09-22 20:20:45 +00:00
@Test
public void testProcedureCallingConventionStack4 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " procedure-callingconvention-stack-4.c " ) ; //, log().verboseCreateSsa().verboseParse().verboseStatementSequence());
2019-09-22 20:20:45 +00:00
}
@Test
public void testProcedureCallingConventionStack3 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " procedure-callingconvention-stack-3.c " ) ; //, log().verboseCreateSsa().verboseParse().verboseStatementSequence());
2019-09-22 20:20:45 +00:00
}
2019-09-20 14:27:50 +00:00
@Test
public void testProcedureCallingConventionStack2 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " procedure-callingconvention-stack-2.c " ) ; //, log().verboseCreateSsa().verboseParse().verboseStatementSequence());
2019-09-20 14:27:50 +00:00
}
2019-09-18 20:41:46 +00:00
@Test
public void testProcedureCallingConventionStack1 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " procedure-callingconvention-stack-1.c " ) ;
2019-09-18 20:41:46 +00:00
}
@Test
public void testProcedureCallingConventionStack0 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " procedure-callingconvention-stack-0.c " ) ;
2019-09-18 20:41:46 +00:00
}
2019-09-18 19:53:32 +00:00
@Test
public void testSignedCharComparison ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " signed-char-comparison.c " ) ;
2019-09-18 19:53:32 +00:00
}
@Test
public void testBitmapLineAnim2 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " bitmap-line-anim-2.c " ) ;
2019-09-18 19:53:32 +00:00
}
@Test
public void testBitmapLineAnim1 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " bitmap-line-anim-1.c " ) ;
2019-09-18 19:53:32 +00:00
}
@Test
public void testStackRelativeAddressing ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " stack-relative-addressing.c " ) ;
2019-09-18 19:53:32 +00:00
}
2019-09-14 09:21:29 +00:00
@Test
public void testStringPointerProblem ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " string-pointer-problem.c " ) ;
2019-09-14 09:21:29 +00:00
}
2019-10-03 08:29:58 +00:00
/ *
@Test
public void testMaze ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " complex/maze/maze.c " , log ( ) . verboseSSAOptimize ( ) ) ;
2019-10-03 08:29:58 +00:00
}
2019-09-14 09:21:29 +00:00
2019-10-03 08:29:58 +00:00
@Test
public void testOs52 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " complex/unit5/os5.2.c " ) ;
2019-10-03 08:29:58 +00:00
}
@Test
public void testOs51 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " complex/unit5/os5.1.c " ) ;
2019-10-03 08:29:58 +00:00
}
* /
2019-09-09 13:51:39 +00:00
2019-09-07 16:23:11 +00:00
@Test
public void testZpCode ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " examples/zpcode/zpcode.c " ) ;
2019-09-07 16:23:11 +00:00
}
2019-08-27 17:15:32 +00:00
// Fix parameter type problem - https://gitlab.com/camelot/kickc/issues/299
/ *
@Test
public void testParameterAutocastWrong ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " parameter-autocast-wrong.c " ) ;
2019-08-27 17:15:32 +00:00
}
* /
2020-12-11 23:01:15 +00:00
@Test
public void testConstBool0 ( ) throws IOException , URISyntaxException {
compileAndCompare ( " const-bool-0.c " ) ;
}
2019-09-07 14:14:08 +00:00
2019-09-02 21:35:15 +00:00
@Test
public void testAsmCullingJmp ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " asm-culling-jmp.c " ) ;
2019-09-02 21:35:15 +00:00
}
2019-09-01 20:06:32 +00:00
@Test
public void testZeropageDetectAdvanced ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " zeropage-detect-advanced.c " ) ;
2019-09-01 20:06:32 +00:00
}
2019-08-26 17:31:55 +00:00
@Test
public void testKickasmUsesPreventDeletion ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " kickasm-uses-prevent-deletion.c " ) ;
2019-08-26 17:31:55 +00:00
}
2019-08-27 12:31:30 +00:00
@Test
public void testAsmUses0 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " asm-uses-0.c " ) ;
2019-08-27 12:31:30 +00:00
}
2019-08-27 10:49:17 +00:00
// TODO: Fix inline kickasm uses handling of used variables. https://gitlab.com/camelot/kickc/issues/296
/ *
@Test
public void testKickasmUses1 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " kickasm-uses-1.c " ) ;
2019-08-27 10:49:17 +00:00
}
@Test
public void testKickasmUses0 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " kickasm-uses-0.c " ) ;
2019-08-27 10:49:17 +00:00
}
* /
2019-09-12 21:48:12 +00:00
@Test
public void testBitmapCircle2 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " bitmap-circle-2.c " ) ;
2019-09-12 21:48:12 +00:00
}
2019-08-25 22:55:22 +00:00
@Test
public void testBitmapCircle ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " bitmap-circle.c " ) ;
2019-08-25 22:55:22 +00:00
}
2019-08-25 20:44:06 +00:00
// TODO: Optimize comparisons with values outside the range of types https://gitlab.com/camelot/kickc/issues/291
@Test
public void testOptimizeUnsignedComparisons ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " optimize-unsigned-comparisons.c " ) ;
2019-08-25 20:44:06 +00:00
}
2020-10-11 13:59:07 +00:00
@Test
public void testLoopHeadTrivial1 ( ) throws IOException , URISyntaxException {
compileAndCompare ( " loophead-trivial-1.c " ) ;
}
2019-08-25 20:57:23 +00:00
// TODO: Fix loop head problem! https://gitlab.com/camelot/kickc/issues/290
2019-08-25 20:21:56 +00:00
@Test
2019-08-25 20:57:23 +00:00
public void testLoopheadProblem3 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " loophead-problem-3.c " ) ;
2019-08-25 20:21:56 +00:00
}
// TODO: Fix loop head problem! https://gitlab.com/camelot/kickc/issues/290
@Test
public void testLoopheadProblem2 ( ) throws IOException , URISyntaxException {
2020-10-11 13:59:07 +00:00
compileAndCompare ( " loophead-problem-2.c " ) ;
2019-08-25 20:21:56 +00:00
}
2019-08-25 20:57:23 +00:00
// TODO: Fix loop head problem! https://gitlab.com/camelot/kickc/issues/261
@Test
public void testLoopheadProblem ( ) throws IOException , URISyntaxException {
2020-10-11 13:59:07 +00:00
compileAndCompare ( " loophead-problem.c " ) ;
2019-08-25 20:57:23 +00:00
}
2019-08-25 20:21:56 +00:00
2019-08-25 22:23:05 +00:00
@Test
public void testPointerPlusSignedWord ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " pointer-plus-signed-word.c " ) ;
2019-08-25 22:23:05 +00:00
}
2019-08-25 11:53:54 +00:00
@Test
public void testAsmMnemonicNames ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " asm-mnemonic-names.c " ) ;
2019-08-25 11:53:54 +00:00
}
2019-08-24 12:11:45 +00:00
@Test
public void testParseNegatedStructRef ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " parse-negated-struct-ref.c " ) ;
2019-08-24 12:11:45 +00:00
}
2019-08-22 10:15:33 +00:00
@Test
public void testLongPointer1 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " long-pointer-1.c " ) ;
2019-08-22 10:15:33 +00:00
}
@Test
public void testLongPointer0 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " long-pointer-0.c " ) ;
2019-08-24 10:18:56 +00:00
}
@Test
public void testPointerAnding ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " pointer-anding.c " ) ;
2019-08-22 10:15:33 +00:00
}
2019-08-22 09:13:52 +00:00
@Test
public void testForcedZeropage ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " forced-zeropage.c " ) ;
2019-08-22 09:13:52 +00:00
}
2019-08-22 08:36:05 +00:00
@Test
public void testFloatErrorMessage ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
assertError ( " float-error-message.c " , " Non-integer numbers are not supported " ) ;
2019-08-22 08:36:05 +00:00
}
2019-08-21 05:06:11 +00:00
@Test
public void testFunctionAsArray ( ) throws IOException , URISyntaxException {
2020-11-08 19:45:22 +00:00
assertError ( " function-as-array.c " , " Dereferencing a non-pointer type void() " ) ;
2019-08-21 05:06:11 +00:00
}
2020-07-01 06:24:12 +00:00
//@Test
//public void testFunctionInfiniteLoop() throws IOException, URISyntaxException {
// compileAndCompare("function-infinite-loop.c");
//}
2019-08-18 21:44:01 +00:00
@Test
public void testCodeAfterReturn1 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " code-after-return-1.c " ) ;
2019-08-18 21:44:01 +00:00
}
2019-08-18 18:59:57 +00:00
@Test
public void testCodeAfterReturn ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " code-after-return.c " ) ;
2019-08-18 18:59:57 +00:00
}
2019-08-18 14:43:15 +00:00
@Test
public void testStringEscapesErr1 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
assertError ( " string-escapes-err-1.c " , " Illegal string escape sequence " ) ;
2019-08-18 14:43:15 +00:00
}
@Test
public void testStringEscapesErr0 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
assertError ( " string-escapes-err-0.c " , " Unfinished string escape sequence at end of string " ) ;
2019-08-18 14:43:15 +00:00
}
2020-04-11 07:13:22 +00:00
@Test
public void testStringEscapes5 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " string-escapes-5.c " ) ;
2020-04-11 07:13:22 +00:00
}
2020-04-10 09:24:20 +00:00
@Test
public void testStringEscapes4 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " string-escapes-4.c " ) ;
2020-04-10 09:24:20 +00:00
}
2019-08-18 21:18:53 +00:00
@Test
public void testStringEscapes3 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " string-escapes-3.c " ) ;
2019-08-18 21:18:53 +00:00
}
2019-08-18 14:43:15 +00:00
@Test
public void testStringEscapes2 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " string-escapes-2.c " ) ;
2019-08-18 14:43:15 +00:00
}
@Test
public void testStringEscapes1 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " string-escapes-1.c " ) ;
2019-08-18 14:43:15 +00:00
}
@Test
public void testStringEscapes0 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " string-escapes-0.c " ) ;
2019-08-18 14:43:15 +00:00
}
2019-08-21 18:04:11 +00:00
@Test
public void testSwitch3Err ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
assertError ( " switch-3-err.c " , " Continue not inside a loop! " ) ;
2019-08-21 18:04:11 +00:00
}
2019-08-21 23:01:01 +00:00
@Test
public void testSwitch4 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " switch-4.c " ) ;
2019-08-21 23:01:01 +00:00
}
2019-08-21 15:33:11 +00:00
@Test
public void testSwitch2 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " switch-2.c " ) ;
2019-08-21 15:33:11 +00:00
}
2019-08-18 19:55:21 +00:00
@Test
public void testSwitch1 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " switch-1.c " ) ;
2019-08-18 19:55:21 +00:00
}
2019-08-12 19:46:01 +00:00
@Test
public void testSwitch0 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " switch-0.c " ) ;
2019-08-12 19:46:01 +00:00
}
2019-08-13 06:08:43 +00:00
@Test
public void testCastError ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
assertError ( " cast-error.c " , " Type mismatch " ) ;
2019-08-13 06:08:43 +00:00
}
2020-05-21 07:38:03 +00:00
@Test
public void testInlineAsmMaVar ( ) throws IOException , URISyntaxException {
compileAndCompare ( " inline-asm-ma-var.c " ) ;
}
2019-08-10 23:16:56 +00:00
@Test
public void testInlineAsmParam ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " inline-asm-param.c " ) ;
2019-08-10 23:16:56 +00:00
}
2020-10-11 13:47:10 +00:00
@Test
public void testDyppa2 ( ) throws IOException , URISyntaxException {
2020-10-11 13:56:17 +00:00
compileAndCompare ( " complex/dyppa2/dyppa2.c " ) ;
2020-10-11 13:47:10 +00:00
}
2019-08-10 12:41:46 +00:00
@Test
public void testAtariTempest ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " complex/ataritempest/ataritempest.c " ) ;
2019-08-10 12:41:46 +00:00
}
2019-11-17 15:49:54 +00:00
@Test
public void testXMega65Logo ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " complex/xmega65/xmega65logo.c " ) ;
2019-11-17 15:49:54 +00:00
}
2019-08-09 20:38:33 +00:00
@Test
public void testXMega65 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " complex/xmega65/xmega65.c " ) ;
2019-08-09 20:38:33 +00:00
}
2019-08-09 15:07:11 +00:00
@Test
public void testLinking ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " examples/linking/linking.c " ) ;
2019-08-09 15:07:11 +00:00
}
2019-08-07 19:35:40 +00:00
@Test
public void testNmiSamples ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " examples/nmisamples/nmisamples.c " ) ;
2019-08-07 19:35:40 +00:00
}
2020-09-29 00:05:57 +00:00
@Test
public void testEncodingAtascii ( ) throws IOException , URISyntaxException {
compileAndCompare ( " encoding-atascii.c " ) ;
}
2019-08-07 12:58:57 +00:00
@Test
public void testEncodingLiteralChar ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " encoding-literal-char.c " ) ;
2019-08-07 12:58:57 +00:00
}
2019-08-03 11:22:27 +00:00
@Test
public void testKcKaStringEncoding ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " kc-ka-string-encoding.c " ) ;
2019-08-03 11:22:27 +00:00
}
@Test
public void testGlobalPcMultiple ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " global-pc-multiple.c " ) ;
2019-08-03 11:22:27 +00:00
}
2019-08-01 10:58:40 +00:00
@Test
public void testStructPosFill ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " struct-pos-fill.c " ) ;
2019-08-01 10:58:40 +00:00
}
2019-07-30 20:28:19 +00:00
@Test
public void testDannyJoystickProblem ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " danny-joystick-problem.c " ) ;
2019-07-30 20:28:19 +00:00
}
2019-07-30 20:29:33 +00:00
@Test
2019-07-30 12:54:22 +00:00
public void testZeropageSinus ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " zeropage-sinus.c " ) ;
2019-07-30 12:54:22 +00:00
}
@Test
public void testProcessorPortTest ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " processor-port-test.c " ) ;
2019-07-30 12:54:22 +00:00
}
2019-07-18 07:47:41 +00:00
@Test
public void testSieve ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " sieve.c " ) ;
2019-07-18 07:47:41 +00:00
}
2019-08-07 09:35:15 +00:00
@Test
public void testSieveMin ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " sieve-min.c " ) ;
2019-08-07 09:35:15 +00:00
}
2019-07-29 21:50:42 +00:00
@Test
public void testCoalesceAssignment ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " coalesce-assignment.c " ) ;
2019-07-29 21:50:42 +00:00
}
2020-07-27 10:12:41 +00:00
@Test
public void testArray16bitInit ( ) throws IOException , URISyntaxException {
compileAndCompare ( " array-16bit-init.c " ) ;
}
2019-07-26 11:15:54 +00:00
@Test
public void testArray16bitLookup ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " array-16bit-lookup.c " ) ;
2019-07-26 11:15:54 +00:00
}
2019-07-25 15:26:43 +00:00
@Test
public void testZeropageExhausted ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
assertError ( " zeropage-exhausted.c " , " Variables used in program do not fit on zeropage " , false ) ;
2019-07-25 15:26:43 +00:00
}
2019-07-25 15:06:17 +00:00
@Test
public void testPlatformAsm6502 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " platform-asm6502.c " ) ;
2019-07-25 15:06:17 +00:00
}
2019-07-25 12:55:10 +00:00
@Test
2020-06-21 09:19:32 +00:00
public void testEuclid3 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " euclid-3.c " ) ;
2019-07-25 12:55:10 +00:00
}
2019-07-25 12:35:43 +00:00
@Test
public void testEuclidProblem2 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " euclid-problem-2.c " ) ;
2019-07-25 12:35:43 +00:00
}
@Test
public void testEuclidProblem ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " euclid-problem.c " ) ;
2019-07-25 12:35:43 +00:00
}
@Test
public void testFastMultiply127 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " fastmultiply-127.c " ) ;
2019-07-25 12:35:43 +00:00
}
2019-07-15 21:45:52 +00:00
@Test
2019-07-19 00:23:44 +00:00
public void testTrueTypeSplines ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " complex/splines/truetype-splines.c " ) ;
2019-07-15 21:45:52 +00:00
}
2019-07-10 18:54:35 +00:00
@Test
public void testProblemNegativeWordConst ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " problem-negative-word-const.c " ) ;
2019-07-10 18:54:35 +00:00
}
2020-03-25 16:51:45 +00:00
//@Test
//public void testProblemConstAddition() throws IOException, URISyntaxException {
2020-04-11 14:06:15 +00:00
// compileAndCompare("problem-const-addition.c", log());
2020-03-25 16:51:45 +00:00
//}
2020-09-27 22:01:06 +00:00
@Test
public void testInnerIndexProblem ( ) throws IOException , URISyntaxException {
compileAndCompare ( " inner-index-problem.c " ) ;
}
2019-07-09 09:40:56 +00:00
@Test
public void testInnerIncrementProblem ( ) throws IOException , URISyntaxException {
2020-06-27 18:59:59 +00:00
compileAndCompare ( " inner-increment-problem.c " ) ;
2019-07-09 09:40:56 +00:00
}
2019-07-08 14:43:09 +00:00
@Test
public void testFillSquare ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " fill-square.c " ) ;
2019-07-08 14:43:09 +00:00
}
2019-07-06 08:32:25 +00:00
@Test
2019-07-06 22:17:00 +00:00
public void testPlasmaCenter ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " plasma-center.c " ) ;
2019-07-06 22:17:00 +00:00
}
2019-07-08 22:31:44 +00:00
@Test
public void testScreenShowSpiralBuckets ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " screen-show-spiral-buckets.c " ) ;
2019-07-08 22:31:44 +00:00
}
2019-07-06 22:17:00 +00:00
@Test
public void testScreenShowSpiral ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " screen-show-spiral.c " ) ;
2019-07-06 08:32:25 +00:00
}
2019-07-05 22:48:45 +00:00
@Test
public void testNesArray ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " nes-array.c " ) ;
2019-07-05 22:48:45 +00:00
}
@Test
public void testLiverangeProblem0 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " liverange-problem-0.c " ) ;
2019-07-05 22:48:45 +00:00
}
2019-07-03 20:22:25 +00:00
@Test
public void testCiaTimerCyclecount ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " cia-timer-cyclecount.c " ) ;
2019-07-03 20:22:25 +00:00
}
2019-07-03 19:15:53 +00:00
@Test
public void testCiaTimerSimple ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " cia-timer-simple.c " ) ;
2019-07-03 19:15:53 +00:00
}
2019-06-30 21:08:39 +00:00
@Test
public void testArraysInitKasm0 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " arrays-init-kasm-0.c " ) ;
2019-06-30 21:08:39 +00:00
}
2020-06-21 22:07:59 +00:00
@Test
public void testArraysInitKasm1 ( ) throws IOException , URISyntaxException {
compileAndCompare ( " arrays-init-kasm-1.c " ) ;
}
2019-06-29 09:38:26 +00:00
@Test
public void testScreenCenterAngle ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " screen-center-angle.c " ) ;
2019-06-29 09:38:26 +00:00
}
2019-06-29 09:10:16 +00:00
@Test
public void testCordicAtan2Clear ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " cordic-atan2-clear.c " ) ;
2019-06-29 09:10:16 +00:00
}
2019-06-26 07:24:25 +00:00
@Test
2019-06-29 07:55:12 +00:00
public void testCordicAtan2Ref ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " cordic-atan2-16-ref.c " ) ;
2019-06-29 07:55:12 +00:00
}
@Test
public void testCordicAtan2_16 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " cordic-atan2-16.c " ) ;
2019-06-29 07:55:12 +00:00
}
@Test
public void testCordicAtan2_8 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " cordic-atan2.c " ) ;
2019-06-26 07:24:25 +00:00
}
2019-06-24 21:22:20 +00:00
@Test
public void testDefaultFont ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " default-font.c " ) ;
2019-06-24 21:22:20 +00:00
}
2019-06-23 21:44:55 +00:00
@Test
public void testUnsignedVoidError ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
assertError ( " unsigned-void-error.c " , " Unknown type unsigned void " ) ;
2019-06-23 21:44:55 +00:00
}
@Test
public void testScreenCenterDistance ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " screen-center-distance.c " ) ;
2019-06-23 21:44:55 +00:00
}
2019-06-22 19:13:22 +00:00
@Test
2019-06-23 09:26:11 +00:00
public void testFontHexShow ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " font-hex-show.c " ) ;
2019-06-22 19:13:22 +00:00
}
2019-08-21 18:04:11 +00:00
@Test
public void testMemcpy1 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " memcpy-1.c " ) ;
2019-08-21 18:04:11 +00:00
}
2019-06-22 08:36:13 +00:00
@Test
public void testMemcpy0 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " memcpy-0.c " ) ;
2019-06-22 08:36:13 +00:00
}
2019-07-10 16:43:42 +00:00
@Test
public void testBitmapPlot3 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " bitmap-plot-3.c " ) ;
2019-07-10 16:43:42 +00:00
}
2019-06-21 20:12:04 +00:00
@Test
2019-06-21 22:25:28 +00:00
public void testBitmapPlot2 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " bitmap-plot-2.c " ) ;
2019-06-21 22:25:28 +00:00
}
@Test
public void testBitmapPlot1 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " bitmap-plot-1.c " ) ;
2019-06-21 22:25:28 +00:00
}
@Test
public void testBitmapPlot0 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " bitmap-plot-0.c " ) ;
2019-06-21 20:12:04 +00:00
}
2019-06-19 21:16:59 +00:00
@Test
2019-06-20 20:39:45 +00:00
public void testCallParameterAutocast ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " call-parameter-autocast.c " ) ;
2019-06-20 20:39:45 +00:00
}
2019-06-21 18:06:57 +00:00
@Test
public void testPointerVoidErr0 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
assertError ( " pointer-void-err-0.c " , " Void pointer math not allowed. " ) ;
2019-06-21 18:06:57 +00:00
}
2019-06-23 22:31:08 +00:00
@Test
public void testPointerVoid3 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " pointer-void-3.c " ) ;
2019-06-23 22:31:08 +00:00
}
2019-06-20 20:39:45 +00:00
@Test
public void testPointerVoid2 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " pointer-void-2.c " ) ;
2019-06-20 20:39:45 +00:00
}
@Test
public void testPointerVoid1 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " pointer-void-1.c " ) ;
2019-06-20 20:39:45 +00:00
}
@Test
public void testPointerVoid0 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " pointer-void-0.c " ) ;
2019-06-19 21:16:59 +00:00
}
2019-06-18 23:53:03 +00:00
@Test
public void testEnumErr2 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
assertError ( " enum-err-2.c " , " Enum value not constant " ) ;
2019-06-18 23:53:03 +00:00
}
@Test
public void testEnumErr1 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
assertError ( " enum-err-1.c " , " Symbol already declared " ) ;
2019-06-18 23:53:03 +00:00
}
@Test
public void testEnumErr0 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
assertError ( " enum-err-0.c " , " Symbol already declared " ) ;
2019-06-18 23:53:03 +00:00
}
2019-06-18 23:45:07 +00:00
@Test
public void testEnum8 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " enum-8.c " ) ;
2019-06-18 23:45:07 +00:00
}
@Test
public void testEnum7 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " enum-7.c " ) ;
2019-06-18 23:45:07 +00:00
}
@Test
public void testEnum6 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " enum-6.c " ) ;
2019-06-18 23:45:07 +00:00
}
@Test
public void testEnum5 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " enum-5.c " ) ;
2019-06-18 23:45:07 +00:00
}
@Test
public void testEnum4 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " enum-4.c " ) ;
2019-06-18 23:45:07 +00:00
}
2019-06-18 22:39:15 +00:00
@Test
public void testEnum3 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " enum-3.c " ) ;
2019-06-18 22:39:15 +00:00
}
@Test
public void testEnum2 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " enum-2.c " ) ;
2019-06-18 22:39:15 +00:00
}
@Test
public void testEnum1 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " enum-1.c " ) ;
2019-06-18 22:39:15 +00:00
}
@Test
public void testEnum0 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " enum-0.c " ) ;
2019-06-18 22:39:15 +00:00
}
2020-03-30 11:25:52 +00:00
@Test
public void testPointerConstTypedef ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " pointer-const-typedef.c " ) ;
2020-03-30 11:25:52 +00:00
}
2020-03-30 06:35:22 +00:00
2020-03-30 11:25:52 +00:00
@Test
public void testTypedef7 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " typedef-7.c " ) ;
2020-03-30 11:25:52 +00:00
}
2020-03-30 06:35:22 +00:00
2020-03-30 11:25:52 +00:00
@Test
public void testTypedef6 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " typedef-6.c " ) ;
2020-03-30 11:25:52 +00:00
}
@Test
public void testTypedef5 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " typedef-5.c " ) ;
2020-03-30 11:25:52 +00:00
}
@Test
public void testTypedef4 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " typedef-4.c " ) ;
2020-03-30 11:25:52 +00:00
}
2020-03-27 21:23:04 +00:00
2020-03-30 06:35:22 +00:00
@Test
public void testTypedef3 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " typedef-3.c " ) ;
2020-03-30 06:35:22 +00:00
}
2019-08-24 12:30:21 +00:00
@Test
public void testTypedef2 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " typedef-2.c " ) ;
2019-08-24 12:30:21 +00:00
}
2019-08-18 18:59:57 +00:00
2019-06-14 22:32:09 +00:00
@Test
public void testTypedef1 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " typedef-1.c " ) ;
2019-06-14 22:32:09 +00:00
}
@Test
public void testTypedef0 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " typedef-0.c " ) ;
2019-06-14 22:32:09 +00:00
}
2019-06-17 21:57:45 +00:00
@Test
public void testMedusa ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " complex/medusa/medusa.c " ) ;
2019-06-17 21:57:45 +00:00
}
2019-06-12 10:45:58 +00:00
@Test
2019-06-16 09:37:06 +00:00
public void testClearscreen ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " complex/clearscreen/clearscreen.c " ) ;
2019-06-12 10:45:58 +00:00
}
// TODO: Optimize unused IRQ's away (and other unused funtions that reference each other circularly)
@Test
public void testUnusedIrq ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " unused-irq.c " ) ;
2019-06-12 10:45:58 +00:00
}
2020-12-11 23:01:15 +00:00
@Test
public void testNumberTernaryFail2 ( ) throws IOException , URISyntaxException {
compileAndCompare ( " number-ternary-fail-2.c " ) ;
}
2020-03-25 16:51:45 +00:00
2020-12-11 23:01:15 +00:00
@Test
public void testNumberTernaryFail ( ) throws IOException , URISyntaxException {
compileAndCompare ( " number-ternary-fail.c " ) ;
}
2020-03-25 16:51:45 +00:00
2020-12-11 23:01:15 +00:00
@Test
public void testNumberTernaryFail3 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " number-ternary-fail-3.c " ) ;
2020-03-25 16:51:45 +00:00
}
2019-06-11 04:56:51 +00:00
@Test
public void testTextbox ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " textbox.c " ) ;
2019-06-11 04:56:51 +00:00
}
2019-06-12 10:45:58 +00:00
2019-07-26 12:54:10 +00:00
@Test
2019-07-28 21:05:30 +00:00
public void testInitializer0 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " initializer-0.c " ) ;
2019-07-28 21:05:30 +00:00
}
@Test
public void testInitializer1 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " initializer-1.c " ) ;
2019-07-28 21:05:30 +00:00
}
@Test
public void testInitializer2 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " initializer-2.c " ) ;
2019-07-28 21:05:30 +00:00
}
@Test
public void testInitializer3 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " initializer-3.c " ) ;
2019-07-26 12:54:10 +00:00
}
2020-06-27 22:43:40 +00:00
@Test
public void testInitializer4 ( ) throws IOException , URISyntaxException {
compileAndCompare ( " initializer-4.c " ) ;
}
@Test
public void testInitializer5 ( ) throws IOException , URISyntaxException {
2020-10-05 15:53:46 +00:00
compileAndCompare ( " initializer-5.c " ) ;
2020-06-27 22:43:40 +00:00
}
2019-07-26 12:54:10 +00:00
/ *
@Test
public void testProblemInlineStructReturn ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " problem-inline-struct-return.c " , log ( ) . verboseCreateSsa ( ) ) ;
2019-07-26 12:54:10 +00:00
}
* /
2019-10-12 06:10:43 +00:00
@Test
public void testStructError6 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
assertError ( " struct-error-6.c " , " Value list cannot initialize type " ) ;
2019-10-12 06:10:43 +00:00
}
2019-09-13 21:29:42 +00:00
@Test
public void testStructPtr34 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " struct-ptr-34.c " ) ;
2019-09-13 21:29:42 +00:00
}
2019-09-12 23:23:55 +00:00
@Test
public void testStructPtr33 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " struct-ptr-33.c " ) ;
2019-09-12 23:23:55 +00:00
}
2019-09-12 21:48:12 +00:00
2019-09-09 22:18:31 +00:00
@Test
public void testStructPtr32 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " struct-ptr-32.c " ) ;
2019-09-09 22:18:31 +00:00
}
2020-04-13 08:33:44 +00:00
@Test
public void testStructPtr31 ( ) throws IOException , URISyntaxException {
compileAndCompare ( " struct-ptr-31.c " ) ;
}
2019-09-09 21:01:04 +00:00
@Test
public void testStructPtr30 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " struct-ptr-30.c " ) ;
2019-09-09 21:01:04 +00:00
}
2019-11-17 18:36:30 +00:00
// TODO: Fix problem with structs containing pointer elements
2019-09-12 21:48:12 +00:00
//@Test
2019-11-17 18:36:30 +00:00
//public void testStructPtr29() throws IOException, URISyntaxException {
2020-04-11 14:06:15 +00:00
// compileAndCompare("struct-ptr-29.c");
2019-09-12 21:48:12 +00:00
//}
2019-09-09 21:01:04 +00:00
2020-02-06 14:40:27 +00:00
@Test
public void testStructPtr28 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " struct-ptr-28.c " ) ;
2020-02-06 14:40:27 +00:00
}
2019-09-09 21:01:04 +00:00
2019-09-04 21:09:27 +00:00
@Test
public void testStructPtr26 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " struct-ptr-26.c " ) ;
2019-09-04 21:09:27 +00:00
}
2019-09-03 06:35:38 +00:00
@Test
public void testStructPtr25 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " struct-ptr-25.c " ) ;
2019-09-03 06:35:38 +00:00
}
@Test
public void testStructPtr24 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " struct-ptr-24.c " ) ;
2019-09-03 06:35:38 +00:00
}
2019-08-19 06:42:48 +00:00
@Test
public void testStructPtr23 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " struct-ptr-23.c " ) ;
2019-08-19 06:42:48 +00:00
}
@Test
public void testStructPtr22 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " struct-ptr-22.c " ) ;
2019-08-19 06:42:48 +00:00
}
2019-08-18 18:59:57 +00:00
@Test
public void testStructPtr21 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " struct-ptr-21.c " ) ;
2019-08-18 18:59:57 +00:00
}
@Test
public void testStructPtr20 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " struct-ptr-20.c " ) ;
2019-08-18 18:59:57 +00:00
}
2019-07-26 12:54:10 +00:00
@Test
public void testStructPtr19 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " struct-ptr-19.c " ) ;
2019-07-26 12:54:10 +00:00
}
@Test
public void testStructPtr18 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " struct-ptr-18.c " ) ;
2019-07-26 12:54:10 +00:00
}
@Test
public void testStructPtr17 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " struct-ptr-17.c " ) ;
2019-07-26 12:54:10 +00:00
}
@Test
public void testStructPtr16 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " struct-ptr-16.c " ) ;
2019-07-26 12:54:10 +00:00
}
2019-07-16 21:14:14 +00:00
@Test
public void testStructPtr15 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " struct-ptr-15.c " ) ;
2019-07-16 21:14:14 +00:00
}
2019-06-16 19:48:13 +00:00
@Test
public void testStructPtr14 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " struct-ptr-14.c " ) ;
2019-06-16 19:48:13 +00:00
}
2019-06-15 17:17:55 +00:00
@Test
public void testStructPtr13 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " struct-ptr-13.c " ) ;
2019-06-15 17:17:55 +00:00
}
2019-06-11 19:52:21 +00:00
@Test
public void testStructPtr12Ref ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " struct-ptr-12-ref.c " ) ;
2019-06-11 19:52:21 +00:00
}
@Test
public void testStructPtr12 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " struct-ptr-12.c " ) ;
2019-06-11 19:52:21 +00:00
}
2019-06-11 04:56:51 +00:00
2019-06-10 23:34:24 +00:00
@Test
public void testStructPtr11 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " struct-ptr-11.c " ) ;
2019-06-10 23:34:24 +00:00
}
2019-06-10 20:58:15 +00:00
@Test
public void testStructPtr10 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " struct-ptr-10.c " ) ;
2019-06-10 20:58:15 +00:00
}
2019-06-10 20:49:21 +00:00
@Test
public void testStructPtr9 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " struct-ptr-9.c " ) ;
2019-06-10 20:49:21 +00:00
}
2019-06-10 19:24:33 +00:00
@Test
public void testStructPtr8 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " struct-ptr-8.c " ) ;
2019-06-10 19:24:33 +00:00
}
@Test
public void testStructPtr7 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " struct-ptr-7.c " ) ;
2019-06-10 19:24:33 +00:00
}
2019-06-10 15:02:17 +00:00
@Test
public void testStructPtr6 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " struct-ptr-6.c " ) ;
2019-06-10 15:02:17 +00:00
}
2019-06-10 14:36:11 +00:00
@Test
public void testStructPtr5 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " struct-ptr-5.c " ) ;
2019-06-10 14:36:11 +00:00
}
2019-06-10 12:56:25 +00:00
@Test
public void testStructPtr4 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " struct-ptr-4.c " ) ;
2019-06-10 12:56:25 +00:00
}
@Test
public void testStructPtr3 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " struct-ptr-3.c " ) ;
2019-06-10 12:56:25 +00:00
}
2019-06-07 07:31:14 +00:00
@Test
public void testStructPtr2 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " struct-ptr-2.c " ) ;
2019-06-07 07:31:14 +00:00
}
@Test
public void testStructPtr1 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " struct-ptr-1.c " ) ;
2019-06-07 07:31:14 +00:00
}
@Test
public void testStructPtr0 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " struct-ptr-0.c " ) ;
2019-06-07 07:31:14 +00:00
}
2019-06-12 10:45:58 +00:00
@Test
public void testStructError5 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
assertError ( " struct-err-5.c " , " Unknown struct member " ) ;
2019-06-12 10:45:58 +00:00
}
@Test
public void testStructError4 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
assertError ( " struct-err-4.c " , " Unknown struct member " ) ;
2019-06-12 10:45:58 +00:00
}
2019-06-07 11:46:36 +00:00
@Test
2019-06-08 13:01:44 +00:00
public void testStructError3 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
assertError ( " struct-err-3.c " , " Parameters type mismatch in call " ) ;
2019-06-08 13:01:44 +00:00
}
@Test
public void testStructError2 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
assertError ( " struct-err-2.c " , " Type mismatch " ) ;
2019-06-08 13:01:44 +00:00
}
@Test
public void testStructError1 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
assertError ( " struct-err-1.c " , " Type mismatch " ) ;
2019-06-07 11:46:36 +00:00
}
2019-06-07 07:31:14 +00:00
2019-06-07 11:46:36 +00:00
@Test
2019-06-08 13:01:44 +00:00
public void testStructError0 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
assertError ( " struct-err-0.c " , " Unknown struct type " ) ;
2019-06-07 11:46:36 +00:00
}
2019-08-27 11:26:55 +00:00
2020-03-30 11:48:55 +00:00
@Test
public void testStructDirectives ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " struct-directives.c " ) ;
2020-03-30 11:48:55 +00:00
}
2020-05-29 22:56:45 +00:00
@Test
public void testStruct43 ( ) throws IOException , URISyntaxException {
compileAndCompare ( " struct-43.c " ) ;
}
2020-02-02 22:41:26 +00:00
@Test
public void testStruct42 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " struct-42.c " ) ;
2020-02-02 22:41:26 +00:00
}
2020-02-02 21:24:25 +00:00
@Test
public void testStruct41 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " struct-41.c " ) ;
2020-02-02 21:24:25 +00:00
}
@Test
public void testStruct40 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " struct-40.c " ) ;
2020-02-02 21:24:25 +00:00
}
2020-02-02 14:00:14 +00:00
@Test
public void testStruct39 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " struct-39.c " ) ;
2020-02-02 14:00:14 +00:00
}
@Test
public void testStruct38 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " struct-38.c " ) ;
2020-02-02 14:00:14 +00:00
}
@Test
public void testStruct37 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " struct-37.c " ) ;
2020-02-02 14:00:14 +00:00
}
2020-02-02 08:47:51 +00:00
@Test
public void testStruct36 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " struct-36.c " ) ;
2020-02-02 08:47:51 +00:00
}
2020-01-19 21:10:02 +00:00
@Test
public void testStruct35 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " struct-35.c " ) ;
2020-01-19 21:10:02 +00:00
}
2020-01-12 21:53:57 +00:00
@Test
public void testStruct34 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " struct-34.c " ) ;
2020-01-12 21:53:57 +00:00
}
2020-01-11 12:39:10 +00:00
@Test
public void testStruct33 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " struct-33.c " ) ;
2020-01-11 12:39:10 +00:00
}
2020-01-08 23:30:16 +00:00
@Test
public void testStruct32 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " struct-32.c " ) ;
2020-01-08 23:30:16 +00:00
}
2020-01-06 23:25:47 +00:00
@Test
public void testStruct31 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " struct-31.c " ) ;
2020-01-06 23:25:47 +00:00
}
@Test
public void testStruct30 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " struct-30.c " ) ;
2020-01-06 23:25:47 +00:00
}
2020-01-02 13:36:02 +00:00
@Test
public void testStruct29 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " struct-29.c " ) ;
2020-01-02 13:36:02 +00:00
}
2019-12-29 14:05:24 +00:00
@Test
public void testStruct28 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " struct-28.c " ) ;
2019-12-29 14:05:24 +00:00
}
@Test
public void testStruct27 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " struct-27.c " ) ;
2019-12-29 14:05:24 +00:00
}
2019-12-28 00:59:26 +00:00
@Test
public void testStruct26 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " struct-26.c " ) ;
2019-12-28 00:59:26 +00:00
}
@Test
public void testStruct25 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " struct-25.c " ) ;
2019-12-28 00:59:26 +00:00
}
@Test
public void testStruct24 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " struct-24.c " ) ;
2019-12-28 00:59:26 +00:00
}
2019-12-27 21:35:05 +00:00
@Test
public void testStruct23 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " struct-23.c " ) ;
2019-12-27 21:35:05 +00:00
}
@Test
public void testStruct22 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " struct-22.c " ) ;
2019-12-27 21:35:05 +00:00
}
@Test
public void testStruct21 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " struct-21.c " ) ;
2019-12-27 21:35:05 +00:00
}
@Test
public void testStruct20 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " struct-20.c " ) ;
2019-12-27 21:35:05 +00:00
}
@Test
public void testStruct19 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " struct-19.c " ) ;
2019-12-27 21:35:05 +00:00
}
@Test
public void testStruct18 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " struct-18.c " ) ;
2019-12-27 21:35:05 +00:00
}
@Test
public void testStruct17 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " struct-17.c " ) ;
2019-12-27 21:35:05 +00:00
}
@Test
public void testStruct16 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " struct-16.c " ) ;
2019-12-27 21:35:05 +00:00
}
@Test
public void testStruct15 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " struct-15.c " ) ;
2019-12-27 21:35:05 +00:00
}
@Test
public void testStruct14 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " struct-14.c " ) ;
2019-12-27 21:35:05 +00:00
}
@Test
public void testStruct13 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " struct-13.c " ) ;
2019-12-27 21:35:05 +00:00
}
2019-09-09 21:01:04 +00:00
@Test
public void testStruct12 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " struct-12.c " ) ;
2019-09-09 21:01:04 +00:00
}
2019-12-14 08:50:26 +00:00
@Test
public void testStruct11b ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " struct-11b.c " ) ;
2019-09-09 21:01:04 +00:00
}
2019-08-13 06:08:43 +00:00
@Test
public void testStruct11 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " struct-11.c " ) ;
2019-08-13 06:08:43 +00:00
}
2019-05-31 13:48:20 +00:00
2019-07-26 12:54:10 +00:00
@Test
public void testStruct10 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " struct-10.c " ) ;
2019-07-26 12:54:10 +00:00
}
2019-07-16 19:16:00 +00:00
@Test
public void testStruct9 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " struct-9.c " ) ;
2019-07-16 19:16:00 +00:00
}
@Test
public void testStruct8 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " struct-8.c " ) ;
2019-07-16 19:16:00 +00:00
}
2019-06-09 08:55:18 +00:00
@Test
public void testStruct7 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " struct-7.c " ) ;
2019-06-09 08:55:18 +00:00
}
2019-06-09 08:47:33 +00:00
@Test
public void testStruct6 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " struct-6.c " ) ;
2019-06-09 08:47:33 +00:00
}
2019-06-09 11:56:35 +00:00
@Test
public void testStruct5 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " struct-5.c " ) ;
2019-06-09 11:56:35 +00:00
}
2019-06-06 22:14:42 +00:00
@Test
public void testStruct4 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " struct-4.c " ) ;
2019-06-06 22:14:42 +00:00
}
@Test
public void testStruct3 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " struct-3.c " ) ;
2019-06-06 22:14:42 +00:00
}
@Test
public void testStruct2 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " struct-2.c " ) ;
2019-06-06 22:14:42 +00:00
}
@Test
public void testStruct1 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " struct-1.c " ) ;
2019-06-06 22:14:42 +00:00
}
@Test
public void testStruct0 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " struct-0.c " ) ;
2019-06-06 22:14:42 +00:00
}
2019-06-03 20:26:21 +00:00
@Test
public void testSequenceLocality1 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " sequence-locality-1.c " ) ;
2019-06-03 20:26:21 +00:00
}
@Test
public void testSequenceLocality0 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " sequence-locality-0.c " ) ;
2019-06-03 20:26:21 +00:00
}
2019-07-30 13:01:43 +00:00
@Test
2019-06-03 08:36:20 +00:00
public void testVoidParameter ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " void-parameter.c " ) ;
2019-06-03 08:36:20 +00:00
}
2019-06-02 22:44:46 +00:00
@Test
public void testConditionInteger4 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " condition-integer-4.c " ) ;
2019-06-02 22:44:46 +00:00
}
@Test
public void testConditionInteger3 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " condition-integer-3.c " ) ;
2019-06-02 22:44:46 +00:00
}
@Test
public void testConditionInteger2 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " condition-integer-2.c " ) ;
2019-06-02 22:44:46 +00:00
}
@Test
public void testConditionInteger1 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " condition-integer-1.c " ) ;
2019-06-02 22:44:46 +00:00
}
@Test
public void testConditionInteger0 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " condition-integer-0.c " ) ;
2019-06-02 22:44:46 +00:00
}
2019-06-02 15:25:04 +00:00
@Test
public void testStringUnknownEncoding ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
assertError ( " string-encoding-unknown.c " , " Unknown string encoding " ) ;
2019-06-02 15:25:04 +00:00
}
@Test
public void testStringEncodingMixError ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
assertError ( " string-encoding-mix-error.c " , " Cannot mix encodings in concatenated strings " ) ;
2019-06-02 15:25:04 +00:00
}
@Test
public void testStringEncodingPragma ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " string-encoding-pragma.c " ) ;
2019-06-02 15:25:04 +00:00
}
@Test
public void testStringEncodingLiterals ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " string-encoding-literals.c " ) ;
2019-06-02 15:25:04 +00:00
}
2019-05-30 23:56:59 +00:00
@Test
public void testRobozzleLabelProblem ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " robozzle64-label-problem.c " ) ;
2019-05-30 23:56:59 +00:00
}
2019-05-30 21:50:26 +00:00
@Test
public void testGlobalPc ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " global-pc.c " ) ;
2019-05-30 21:50:26 +00:00
}
2019-05-30 15:55:53 +00:00
@Test
public void testNoopCastElimination ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " noop-cast-elimination.c " ) ;
2019-05-30 15:55:53 +00:00
}
@Test
public void testSignedWordMinusByte2 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " signed-word-minus-byte-2.c " ) ;
2019-05-30 15:55:53 +00:00
}
2019-05-28 20:28:17 +00:00
@Test
public void testForTwoVars ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " for-two-vars.c " ) ;
2019-05-27 06:39:59 +00:00
}
2019-05-16 23:07:47 +00:00
@Test
2019-05-24 18:57:43 +00:00
public void testC64DtvGfxExplorer ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " c64dtv-gfxexplorer.c " , 10 ) ;
2019-05-16 23:07:47 +00:00
}
@Test
2019-05-24 18:57:43 +00:00
public void testC64DtvGfxModes ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " c64dtv-gfxmodes.c " , 10 ) ;
2019-05-16 23:07:47 +00:00
}
@Test
2019-05-24 18:57:43 +00:00
public void testConstantStringConcat0 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " constant-string-concat-0.c " ) ;
2019-05-16 23:07:47 +00:00
}
@Test
2019-05-24 18:57:43 +00:00
public void testLiterals ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " literals.c " ) ;
2019-05-16 23:07:47 +00:00
}
2019-05-24 18:57:43 +00:00
@Test
public void testConstantStringConcat ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " constant-string-concat.c " ) ;
2019-05-24 18:57:43 +00:00
}
2019-05-16 23:07:47 +00:00
2019-05-23 15:50:44 +00:00
@Test
public void testStatementSequence1 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " statement-sequence-1.c " ) ;
2019-05-23 15:50:44 +00:00
}
2019-06-03 10:19:47 +00:00
@Test
public void testSubExprOptimize4 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " subexpr-optimize-4.c " ) ;
2019-06-03 10:19:47 +00:00
}
@Test
public void testSubExprOptimize3 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " subexpr-optimize-3.c " ) ;
2019-06-03 10:19:47 +00:00
}
@Test
public void testSubExprOptimize2 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " subexpr-optimize-2.c " ) ;
2019-06-03 10:19:47 +00:00
}
2019-05-22 06:06:54 +00:00
@Test
public void testSubExprOptimize1 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " subexpr-optimize-1.c " ) ;
2019-05-22 06:06:54 +00:00
}
2019-05-21 08:23:39 +00:00
@Test
public void testSubExprOptimize0 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " subexpr-optimize-0.c " ) ;
2019-05-21 08:23:39 +00:00
}
@Test
public void testPtrPtrOptimize2 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " ptrptr-optimize-2.c " ) ;
2019-05-21 08:23:39 +00:00
}
@Test
public void testPtrPtrOptimize1 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " ptrptr-optimize-1.c " ) ;
2019-05-21 08:23:39 +00:00
}
@Test
public void testPtrPtrOptimize0 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " ptrptr-optimize-0.c " ) ;
2019-05-21 08:23:39 +00:00
}
2019-05-20 23:45:32 +00:00
@Test
public void testHex2DecPtrPtr ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " hex2dec-ptrptr.c " ) ;
2019-05-20 23:45:32 +00:00
}
2019-05-19 07:31:12 +00:00
@Test
public void testHex2Dec ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " hex2dec.c " ) ;
2019-05-19 07:31:12 +00:00
}
2019-05-20 22:33:36 +00:00
@Test
public void testMemoryHeap ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " memory-heap.c " ) ;
2019-05-20 22:33:36 +00:00
}
2019-06-23 21:44:55 +00:00
@Test
public void testMalloc1 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " malloc-1.c " ) ;
2019-06-23 21:44:55 +00:00
}
@Test
public void testMalloc0 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " malloc-0.c " ) ;
2019-06-23 21:44:55 +00:00
}
2019-05-18 23:16:12 +00:00
@Test
public void testTernaryInference ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " ternary-inference.c " ) ;
2019-05-18 23:16:12 +00:00
}
2019-05-18 21:58:04 +00:00
@Test
public void testMul8uMin ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " mul8u-min.c " ) ;
2019-05-18 21:58:04 +00:00
}
2019-05-18 20:40:46 +00:00
@Test
public void testNumberInferenceSum ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " number-inference-sum.c " ) ;
2019-05-18 20:40:46 +00:00
}
2019-05-18 19:37:34 +00:00
@Test
public void testGfxBankOptimization ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " gfxbank.c " ) ;
2019-05-18 19:37:34 +00:00
}
2019-05-18 11:58:26 +00:00
@Test
public void testDoubleIndexingArrays ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " double-indexing-arrays.c " ) ;
2019-05-18 11:58:26 +00:00
}
@Test
public void testDerefidxWord2 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " derefidx-word-2.c " ) ;
2019-05-18 11:58:26 +00:00
}
@Test
public void testDerefidxWord1 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " derefidx-word-1.c " ) ;
2019-05-18 11:58:26 +00:00
}
@Test
public void testDerefidxWord0 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " derefidx-word-0.c " ) ;
2019-05-18 11:58:26 +00:00
}
2019-05-16 23:07:47 +00:00
@Test
public void testFragmentVariations ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " fragment-variations.c " ) ;
2019-05-16 23:07:47 +00:00
}
2019-08-21 22:47:44 +00:00
// TODO: Fix call parameter type conversion (See SymbolTypeConversion) https://gitlab.com/camelot/kickc/issues/283
/ *
@Test
public void testTypePromotionScharParam ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " type-promotion-schar-param.c " ) ;
2019-08-21 22:47:44 +00:00
}
@Test
public void testTypePromotionBoolParam ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " type-promotion-bool-param.c " ) ;
2019-08-21 22:47:44 +00:00
}
* /
2019-05-16 06:51:14 +00:00
@Test
public void testTypeInference ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " type-inference.c " ) ;
2019-05-16 06:51:14 +00:00
}
2019-05-13 07:24:23 +00:00
@Test
public void testMixedArray1 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " mixed-array-1.c " ) ;
2019-05-13 07:24:23 +00:00
}
2019-05-13 07:17:30 +00:00
@Test
public void testMixedArray0 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " mixed-array-0.c " ) ;
2019-05-13 07:17:30 +00:00
}
@Test
public void testInlinePointer2 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " inline-pointer-2.c " ) ;
2019-05-13 07:17:30 +00:00
}
@Test
public void testInlinePointer1 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " inline-pointer-1.c " ) ;
2019-05-13 07:17:30 +00:00
}
@Test
public void testInlinePointer0 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " inline-pointer-0.c " ) ;
2019-05-13 07:17:30 +00:00
}
2019-05-07 19:53:08 +00:00
@Test
public void testToD018Problem ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " tod018-problem.c " ) ;
2019-05-07 19:53:08 +00:00
}
2019-05-07 07:19:50 +00:00
@Test
public void testHelloWorld0 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " helloworld0.c " ) ;
2019-05-07 07:19:50 +00:00
}
2019-05-04 23:26:40 +00:00
@Test
2019-05-05 23:08:41 +00:00
public void testNumberConversion ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " number-conversion.c " ) ;
2019-05-04 23:26:40 +00:00
}
2019-05-01 23:23:49 +00:00
@Test
2019-05-05 23:08:41 +00:00
public void testNumberType ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " number-type.c " ) ;
2019-05-01 23:23:49 +00:00
}
2019-05-04 23:26:40 +00:00
@Test
2019-05-05 23:08:41 +00:00
public void testIntegerConversion ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " int-conversion.c " ) ;
2019-05-05 23:08:41 +00:00
}
@Test
public void testIntegerLiterals ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " int-literals.c " ) ;
2019-05-04 23:26:40 +00:00
}
2019-04-25 05:58:17 +00:00
@Test
public void testSimpleLoop ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " simple-loop.c " ) ;
2019-04-25 05:58:17 +00:00
}
2019-04-23 22:46:45 +00:00
@Test
public void testLiteralCharMinusNumber ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " literal-char-minus-number.c " ) ;
2019-04-23 22:46:45 +00:00
}
2019-04-25 05:58:17 +00:00
@Test
public void testPaulNelsenSandboxTernaryError ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " sandbox-ternary-error.c " ) ;
2019-04-25 05:58:17 +00:00
}
2019-04-23 22:46:45 +00:00
2019-04-23 21:26:47 +00:00
@Test
public void testPaulNelsenSandbox ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " sandbox.c " ) ;
2020-03-29 18:22:16 +00:00
}
@Test
public void testPointerConstDeep ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
assertError ( " pointer-const-deep.c " , " Deep const/volatile not supported " ) ;
2020-03-29 18:22:16 +00:00
}
@Test
public void testPointerConst ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " pointer-const.c " ) ;
2019-04-23 21:26:47 +00:00
}
2019-06-03 06:58:23 +00:00
@Test
public void testPointerCast4 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " pointer-cast-4.c " ) ;
2019-06-03 06:58:23 +00:00
}
2019-06-02 23:40:55 +00:00
@Test
public void testPointerCast3 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " pointer-cast-3.c " ) ;
2019-06-02 23:40:55 +00:00
}
2019-04-09 20:58:42 +00:00
2019-04-22 11:47:22 +00:00
@Test
public void testTypeIdPlusByteProblem ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " typeid-plus-byte-problem.c " ) ;
2019-04-22 11:47:22 +00:00
}
2019-04-22 11:35:52 +00:00
2019-04-27 10:12:44 +00:00
@Test
2019-04-22 11:47:22 +00:00
public void testTypeIdPlusBytes ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " typeid-plus-bytes.c " ) ;
2019-04-22 11:47:22 +00:00
}
2019-04-22 11:35:52 +00:00
2019-04-22 09:50:48 +00:00
@Test
public void testTypeIdSimple ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " typeid-simple.c " ) ;
2019-04-22 09:50:48 +00:00
}
2019-04-22 07:20:14 +00:00
@Test
public void testTypeSigned ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " type-signed.c " ) ;
2019-04-22 07:20:14 +00:00
}
2019-05-07 19:03:26 +00:00
@Test
public void testConstIntCastProblem ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " const-int-cast-problem.c " ) ;
2019-05-07 19:03:26 +00:00
}
2019-04-20 21:52:29 +00:00
@Test
public void testPointerPlus0 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " pointer-plus-0.c " ) ;
2019-04-20 21:52:29 +00:00
}
2019-04-20 20:12:56 +00:00
@Test
public void testDerefToDerefIdx2 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " deref-to-derefidx-2.c " ) ;
2019-04-20 20:12:56 +00:00
}
@Test
public void testDerefToDerefIdx ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " deref-to-derefidx.c " ) ;
2019-04-20 20:12:56 +00:00
}
2019-04-20 09:13:49 +00:00
@Test
public void testSemiStruct2 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " semi-struct-2.c " ) ;
2019-04-20 09:13:49 +00:00
}
2019-04-20 11:08:12 +00:00
@Test
public void testSemiStruct1 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " semi-struct-1.c " ) ;
2019-04-20 11:08:12 +00:00
}
2019-04-20 20:12:56 +00:00
@Test
public void testStrip ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " strip.c " ) ;
2019-04-20 20:12:56 +00:00
}
2020-05-22 13:24:03 +00:00
@Test
public void testReserveZpGlobalRange ( ) throws IOException , URISyntaxException {
compileAndCompare ( " reserve-zp-global-range.c " ) ;
}
2019-04-19 23:44:54 +00:00
@Test
public void testReserveZpGlobal ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " reserve-zp-global.c " ) ;
2019-04-19 23:44:54 +00:00
}
2020-05-22 13:24:03 +00:00
@Test
public void testReserveZpProcedure4 ( ) throws IOException , URISyntaxException {
compileAndCompare ( " reserve-zp-procedure-4.c " ) ;
}
2019-04-19 23:44:54 +00:00
@Test
public void testReserveZpProcedure3 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " reserve-zp-procedure-3.c " ) ;
2019-04-19 23:44:54 +00:00
}
@Test
public void testReserveZpProcedure2 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " reserve-zp-procedure-2.c " ) ;
2019-04-19 23:44:54 +00:00
}
@Test
public void testReserveZpProcedure1 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " reserve-zp-procedure-1.c " ) ;
2019-04-19 23:44:54 +00:00
}
2019-04-19 06:42:42 +00:00
@Test
public void testWordPointerCompound ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " word-pointer-compound.c " ) ;
2019-04-19 06:42:42 +00:00
}
2019-04-17 21:58:10 +00:00
@Test
public void testWordPointerMath ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " word-pointer-math.c " ) ;
2019-04-17 21:58:10 +00:00
}
2019-06-24 06:21:58 +00:00
@Test
public void testWordPointerMath1 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " word-pointer-math-1.c " ) ;
2019-06-24 06:21:58 +00:00
}
2019-04-17 23:06:22 +00:00
@Test
public void testWordPointerMath0 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " word-pointer-math-0.c " ) ;
2019-04-17 23:06:22 +00:00
}
2019-04-17 21:58:10 +00:00
@Test
public void testWordPointerIteration ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " word-pointer-iteration.c " ) ;
2019-04-17 21:58:10 +00:00
}
@Test
public void testWordPointerIteration0 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " word-pointer-iteration-0.c " ) ;
2019-04-17 21:58:10 +00:00
}
2019-04-20 23:22:14 +00:00
@Test
public void testWordArray2 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " word-array-2.c " ) ;
2019-04-20 23:22:14 +00:00
}
2019-04-17 21:58:10 +00:00
@Test
2019-04-20 22:26:18 +00:00
public void testWordArray1 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " word-array-1.c " ) ;
2019-04-17 21:58:10 +00:00
}
2019-04-17 23:26:51 +00:00
@Test
public void testWordArray0 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " word-array-0.c " ) ;
2019-04-17 23:26:51 +00:00
}
2019-06-10 09:59:40 +00:00
@Test
public void testSizeofStruct ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " sizeof-struct.c " ) ;
2019-06-10 09:59:40 +00:00
}
@Test
public void testSizeofArrays ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " sizeof-arrays.c " ) ;
2019-06-10 09:59:40 +00:00
}
2019-04-17 19:27:32 +00:00
@Test
public void testSizeofExpression ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " sizeof-expr.c " ) ;
2019-04-17 19:27:32 +00:00
}
2019-04-17 07:34:10 +00:00
@Test
public void testSizeofTypes ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " sizeof-types.c " ) ;
2019-04-17 07:34:10 +00:00
}
2019-04-15 22:22:47 +00:00
@Test
public void testCommaDeclFor ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " comma-decl-for.c " ) ;
2019-04-15 22:22:47 +00:00
}
2020-03-27 09:53:42 +00:00
@Test
public void testCommaDecl2 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " comma-decl-2.c " ) ;
2020-03-27 09:53:42 +00:00
}
2019-04-15 21:13:15 +00:00
@Test
public void testCommaDecl ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " comma-decl.c " ) ;
2019-04-15 21:13:15 +00:00
}
2019-04-15 12:03:50 +00:00
@Test
public void testCommaExprFor ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " comma-expr-for.c " ) ;
2019-04-15 12:03:50 +00:00
}
2019-04-15 21:13:15 +00:00
@Test
public void testCommaExpr2 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " comma-expr-2.c " ) ;
2019-04-15 21:13:15 +00:00
}
2019-04-15 12:03:50 +00:00
@Test
public void testCommaExpr1 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " comma-expr-1.c " ) ;
2019-04-15 12:03:50 +00:00
}
2019-04-15 21:13:15 +00:00
2019-04-15 08:44:18 +00:00
@Test
public void testForRangedNoVar ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
assertError ( " for-ranged-novar.c " , " extraneous input " ) ;
2019-04-15 08:44:18 +00:00
}
@Test
public void testForEmptyInit ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " for-empty-init.c " ) ;
2019-04-15 08:44:18 +00:00
}
2019-04-15 08:37:00 +00:00
@Test
public void testForEmptyIncrement ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " for-empty-increment.c " ) ;
2019-04-15 08:37:00 +00:00
}
2019-04-15 07:33:49 +00:00
@Test
public void testDivide2s ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " divide-2s.c " ) ;
2019-04-15 07:33:49 +00:00
}
@Test
public void testMultiply2s ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " multiply-2s.c " ) ;
2019-04-15 07:33:49 +00:00
}
2019-06-10 23:34:24 +00:00
@Test
public void testMultiplyNs ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " multiply-ns.c " ) ;
2019-06-10 23:34:24 +00:00
}
2019-04-09 20:58:42 +00:00
@Test
public void testPointerCast2 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " pointer-cast-2.c " ) ;
2019-04-09 20:58:42 +00:00
}
2019-04-09 19:30:21 +00:00
@Test
public void testPointerCast ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " pointer-cast.c " ) ;
2019-04-09 19:30:21 +00:00
}
2019-08-27 12:31:30 +00:00
// TODO: Fix literal string array initialization. https://gitlab.com/camelot/kickc/issues/297
/ *
@Test
public void testLiteralStringArray ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " literal-string-array.c " ) ;
2019-08-27 12:31:30 +00:00
}
* /
2019-08-27 12:54:49 +00:00
@Test
public void testLiteralWordPointer0 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " literal-word-pointer-0.c " ) ;
2019-08-27 12:54:49 +00:00
}
// TODO: Fix casting literal char* to word https://gitlab.com/camelot/kickc/issues/298
/ *
@Test
public void testLiteralWordPointer1 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " literal-word-pointer-1.c " ) ;
2019-08-27 12:54:49 +00:00
}
* /
2019-04-08 22:51:53 +00:00
@Test
public void testLiteralStrings ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " literal-strings.c " ) ;
2019-04-08 22:51:53 +00:00
}
2019-04-08 21:27:05 +00:00
@Test
public void testIllegalVoidParameter ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
assertError ( " illegal-void-parameter.c " , " Illegal void parameter " ) ;
2019-04-08 21:27:05 +00:00
}
@Test
public void testIllegalUnnamedParameter ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
assertError ( " illegal-unnamed-parameter.c " , " Illegal unnamed parameter " ) ;
2019-04-08 21:27:05 +00:00
}
2019-04-08 14:26:39 +00:00
@Test
2019-04-08 18:54:23 +00:00
public void testFire ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " examples/fire/fire.c " ) ;
2019-04-08 18:54:23 +00:00
}
2020-03-25 16:51:45 +00:00
@Test
public void testFont2x2 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " examples/font-2x2/font-2x2.c " ) ;
2020-03-25 16:51:45 +00:00
}
2019-04-08 18:54:23 +00:00
@Test
2019-04-08 14:26:39 +00:00
public void testCTypes ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " c-types.c " ) ;
2019-04-08 14:26:39 +00:00
}
2019-04-08 07:00:48 +00:00
@Test
public void testPlus0 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " plus-0.c " ) ;
2019-04-08 07:00:48 +00:00
}
@Test
2019-04-15 09:53:07 +00:00
public void testPlasmaUnroll ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " examples/plasma/plasma-unroll.c " ) ;
2019-04-08 07:00:48 +00:00
}
2019-04-07 22:44:09 +00:00
@Test
public void testPlasma ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " examples/plasma/plasma.c " ) ;
2019-04-07 22:44:09 +00:00
}
2019-08-27 10:01:20 +00:00
// TODO: Fix bool auto-conversion type conversion https://gitlab.com/camelot/kickc/issues/199
/ *
@Test
public void testBoolNotOperator3 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " bool-not-operator-3.c " ) ;
2019-08-27 10:01:20 +00:00
}
* /
2019-08-21 18:04:11 +00:00
@Test
public void testTernary4 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " ternary-4.c " ) ;
2019-08-21 18:04:11 +00:00
}
2019-08-27 10:01:20 +00:00
@Test
public void testBoolNotOperator1 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " bool-not-operator-1.c " ) ;
2019-08-27 10:01:20 +00:00
}
@Test
public void testBoolNotOperator2 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " bool-not-operator-2.c " ) ;
2019-08-27 10:01:20 +00:00
}
2019-08-21 18:04:11 +00:00
2019-04-07 16:35:50 +00:00
@Test
public void testTernary3 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " ternary-3.c " ) ;
2019-04-07 16:35:50 +00:00
}
2019-04-07 15:59:44 +00:00
@Test
public void testTernary2 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " ternary-2.c " ) ;
2019-04-07 15:59:44 +00:00
}
@Test
public void testTernary1 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " ternary-1.c " ) ;
2019-04-07 15:59:44 +00:00
}
2019-04-04 23:05:15 +00:00
@Test
2019-04-07 11:35:23 +00:00
public void testPointerPointer3 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " pointer-pointer-3.c " ) ;
2019-04-07 11:35:23 +00:00
}
@Test
2019-04-04 23:05:15 +00:00
public void testPointerPointer2 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " pointer-pointer-2.c " ) ;
2019-04-04 23:05:15 +00:00
}
@Test
public void testPointerPointer1 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " pointer-pointer-1.c " ) ;
2019-04-04 23:05:15 +00:00
}
2020-11-01 17:49:10 +00:00
@Test
public void testFunctionPointerNoargCall14 ( ) throws IOException , URISyntaxException {
compileAndCompare ( " function-pointer-noarg-call-14.c " ) ;
}
2020-11-01 07:00:52 +00:00
@Test
public void testFunctionPointerNoargCall13 ( ) throws IOException , URISyntaxException {
compileAndCompare ( " function-pointer-noarg-call-13.c " ) ;
}
2020-09-26 20:52:19 +00:00
@Test
public void testFunctionPointerNoargCall12 ( ) throws IOException , URISyntaxException {
compileAndCompare ( " function-pointer-noarg-call-12.c " ) ;
}
2020-05-26 15:45:55 +00:00
@Test
public void testFunctionPointerNoargCall11 ( ) throws IOException , URISyntaxException {
compileAndCompare ( " function-pointer-noarg-call-11.c " ) ;
}
2019-04-07 09:08:39 +00:00
@Test
public void testFunctionPointerNoargCall10 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " function-pointer-noarg-call-10.c " ) ;
2019-04-07 09:08:39 +00:00
}
@Test
public void testFunctionPointerNoargCall9 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " function-pointer-noarg-call-9.c " ) ;
2019-04-07 09:08:39 +00:00
}
2019-04-06 09:53:56 +00:00
@Test
public void testFunctionPointerNoargCall8 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " function-pointer-noarg-call-8.c " ) ;
2019-04-06 09:53:56 +00:00
}
@Test
public void testFunctionPointerNoargCall7 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " function-pointer-noarg-call-7.c " ) ;
2019-04-06 09:53:56 +00:00
}
2019-04-04 18:45:52 +00:00
@Test
public void testFunctionPointerNoargCall6 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " function-pointer-noarg-call-6.c " ) ;
2019-04-04 18:45:52 +00:00
}
2019-04-04 17:23:38 +00:00
@Test
public void testFunctionPointerNoargCall5 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " function-pointer-noarg-call-5.c " ) ;
2019-04-04 17:23:38 +00:00
}
2019-04-04 17:01:47 +00:00
@Test
public void testFunctionPointerNoargCall4 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " function-pointer-noarg-call-4.c " ) ;
2019-04-04 17:01:47 +00:00
}
2019-04-04 16:45:57 +00:00
@Test
public void testFunctionPointerNoargCall3 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " function-pointer-noarg-call-3.c " ) ;
2019-04-04 16:45:57 +00:00
}
2019-04-04 15:44:14 +00:00
@Test
public void testFunctionPointerNoargCall2 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " function-pointer-noarg-call-2.c " ) ;
2019-04-04 15:44:14 +00:00
}
@Test
public void testFunctionPointerNoargCall ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " function-pointer-noarg-call.c " ) ;
2019-04-04 15:44:14 +00:00
}
@Test
public void testFunctionPointerReturn ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " function-pointer-return.c " ) ;
2019-04-04 15:44:14 +00:00
}
2019-04-02 22:03:37 +00:00
@Test
public void testFunctionPointerNoarg3 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " function-pointer-noarg-3.c " ) ;
2019-04-02 22:03:37 +00:00
}
@Test
public void testFunctionPointerNoarg2 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " function-pointer-noarg-2.c " ) ;
2019-04-02 22:03:37 +00:00
}
@Test
public void testFunctionPointerNoarg ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " function-pointer-noarg.c " ) ;
2019-04-02 22:03:37 +00:00
}
2019-04-10 09:12:49 +00:00
@Test
public void testComparisonRewriting ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " comparison-rewriting.c " ) ;
2019-04-10 09:12:49 +00:00
}
2019-04-11 20:24:07 +00:00
@Test
public void testComparisonRewritingPointer ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " comparison-rewriting-pointer.c " ) ;
2019-04-11 20:24:07 +00:00
}
2019-03-31 21:32:25 +00:00
@Test
public void testLoopBreakContinue ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " loop-break-continue.c " ) ;
2019-03-31 21:32:25 +00:00
}
2019-08-18 18:59:57 +00:00
@Test
public void testLoopForEmptyBody ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " loop-for-empty-body.c " ) ;
2019-08-18 18:59:57 +00:00
}
2019-08-10 13:07:51 +00:00
@Test
public void testLoopForContinue ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " loop-for-continue.c " ) ;
2019-08-10 13:07:51 +00:00
}
2019-03-31 18:15:01 +00:00
@Test
public void testLoopWhileContinue ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " loop-while-continue.c " ) ;
2019-03-31 18:15:01 +00:00
}
@Test
public void testLoopContinue ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " loop-continue.c " ) ;
2019-03-31 18:15:01 +00:00
}
@Test
public void testLoopBreakNested ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " loop-break-nested.c " ) ;
2019-03-31 18:15:01 +00:00
}
@Test
public void testLoopBreak ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " loop-break.c " ) ;
2019-03-31 18:15:01 +00:00
}
2019-03-29 23:15:53 +00:00
@Test
2019-03-31 15:10:41 +00:00
public void testLocalScopeLoops ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " localscope-loops.c " ) ;
2019-03-29 23:15:53 +00:00
}
@Test
public void testLocalScopeSimple ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " localscope-simple.c " ) ;
2019-03-29 23:15:53 +00:00
}
2019-03-29 07:01:02 +00:00
@Test
public void testIrqLocalVarOverlap ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " irq-local-var-overlap-problem.c " ) ;
2019-03-29 07:01:02 +00:00
}
2019-03-27 21:54:01 +00:00
@Test
public void testMultiplexerIrq ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " multiplexer-irq/simple-multiplexer-irq.c " , 10 ) ;
2019-03-27 21:54:01 +00:00
}
@Test
public void testIrqVolatileProblem ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " irq-volatile-bool-problem.c " ) ;
2019-03-27 21:54:01 +00:00
}
2019-03-26 20:27:36 +00:00
@Test
public void testMusicIrq ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " examples/music/music_irq.c " ) ;
2019-03-26 20:27:36 +00:00
}
2020-12-30 22:13:55 +00:00
@Test
public void testCrunchingExomizer ( ) throws IOException , URISyntaxException {
compileAndCompare ( " examples/crunching/test-exomizer.c " ) ;
}
@Test
public void testCrunchingByteboozer ( ) throws IOException , URISyntaxException {
compileAndCompare ( " examples/crunching/test-byteboozer.c " ) ;
}
2019-03-26 20:27:36 +00:00
@Test
public void testMusic ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " examples/music/music.c " ) ;
2019-03-26 20:27:36 +00:00
}
2019-03-22 18:50:20 +00:00
@Test
public void testConstEarlyIdentification ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " const-early-identification.c " ) ;
2019-03-22 18:50:20 +00:00
}
2019-03-22 06:25:55 +00:00
@Test
public void testBoolNullPointerException ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " bool-nullpointer-exception.c " ) ;
2019-03-22 06:25:55 +00:00
}
2019-03-21 21:24:39 +00:00
@Test
public void testSignedWordMinusByte ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " test-signed-word-minus-byte.c " ) ;
2019-03-21 21:24:39 +00:00
}
@Test
public void testIrqIdxProblem ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " irq-idx-problem.c " ) ;
2019-03-21 21:24:39 +00:00
}
2019-03-19 06:48:16 +00:00
@Test
public void testInlineKickAsmClobber ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " inline-kasm-clobber.c " ) ;
2019-03-19 06:48:16 +00:00
}
2019-03-09 19:58:51 +00:00
2019-03-18 19:54:08 +00:00
@Test
public void testInlineAsmClobberNone ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " inline-asm-clobber-none.c " ) ;
2019-03-18 19:54:08 +00:00
}
@Test
public void testInlineAsmJsrClobber ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " inline-asm-jsr-clobber.c " ) ;
2019-03-18 19:54:08 +00:00
}
2019-03-18 17:24:03 +00:00
@Test
public void testComplexConditionalProblem ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " complex-conditional-problem.c " ) ;
2019-03-18 17:24:03 +00:00
}
2019-03-16 16:54:38 +00:00
@Test
public void testConstSignedPromotion ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " const-signed-promotion.c " ) ;
2019-03-16 16:54:38 +00:00
}
@Test
public void testSignedIndexedSubtract ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " signed-indexed-subtract.c " ) ;
2019-03-16 16:54:38 +00:00
}
2019-03-15 06:59:25 +00:00
@Test
public void testInlineAsmRefScoped ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " inline-asm-ref-scoped.c " ) ;
2019-03-15 06:59:25 +00:00
}
2019-03-14 23:30:14 +00:00
@Test
public void testInlineAsmRefoutLabel ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " inline-asm-label.c " ) ;
2019-03-14 23:30:14 +00:00
}
2019-03-14 22:09:50 +00:00
@Test
2020-11-01 21:42:09 +00:00
public void testInlineAsmRefout ( ) throws IOException , URISyntaxException {
2020-11-01 22:12:46 +00:00
compileAndCompare ( " inline-asm-refout.c " ) ;
2019-03-14 23:02:33 +00:00
}
@Test
public void testInlineAsmRefoutConst ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " inline-asm-refout-const.c " ) ;
2019-03-14 22:09:50 +00:00
}
2019-03-14 23:02:33 +00:00
@Test
public void testInlineAsmRefoutUndef ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
assertError ( " inline-asm-refout-undef.c " , " Unknown variable qwe " ) ;
2019-03-14 23:02:33 +00:00
}
2019-03-14 22:09:50 +00:00
@Test
public void testConstIfProblem ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " const-if-problem.c " ) ;
2019-03-14 22:09:50 +00:00
}
@Test
public void testTetrisNullPointer ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " tetris-npe.c " ) ;
2019-03-14 22:09:50 +00:00
}
2019-07-06 09:00:15 +00:00
/ *
2019-03-14 22:09:50 +00:00
@Test
public void testUnrollCall ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " unroll-call.c " ) ;
2019-03-14 22:09:50 +00:00
}
* /
2019-03-15 23:33:16 +00:00
@Test
public void testInlineKasmRefout ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " inline-kasm-refout.c " ) ;
2019-03-15 23:33:16 +00:00
}
2019-03-14 22:09:50 +00:00
@Test
public void testInlineKasmLoop ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " inline-kasm-loop.c " ) ;
2019-03-14 22:09:50 +00:00
}
@Test
public void testInlineKasmData ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " inline-kasm-data.c " ) ;
2019-03-14 22:09:50 +00:00
}
@Test
public void testInlineKasmResource ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " inline-kasm-resource.c " ) ;
2019-03-14 22:09:50 +00:00
}
@Test
2020-11-01 21:42:09 +00:00
public void testInlineAsmRefoutVar ( ) throws IOException , URISyntaxException {
compileAndCompare ( " inline-asm-refout-var.c " ) ;
2019-03-14 22:09:50 +00:00
}
@Test
public void testInlineAsmOptimized ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " inline-asm-optimized.c " ) ;
2019-03-14 22:09:50 +00:00
}
2019-04-20 11:08:12 +00:00
@Test
public void testCastNotNeeded2 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " cast-not-needed-2.c " ) ;
2019-04-20 11:08:12 +00:00
}
@Test
public void testCastNotNeeded3 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " cast-not-needed-3.c " ) ;
2019-04-20 11:08:12 +00:00
}
2019-03-14 22:09:50 +00:00
@Test
public void testCastNotNeeded ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " cast-not-needed.c " ) ;
2019-03-14 22:09:50 +00:00
}
2019-03-09 19:58:51 +00:00
@Test
public void testTypeMix ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " type-mix.c " ) ;
2019-02-17 23:12:29 +00:00
}
2019-03-09 17:37:23 +00:00
@Test
public void testClobberProblem ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " scrollbig-clobber.c " ) ;
2019-03-09 17:37:23 +00:00
}
2019-03-09 15:24:44 +00:00
@Test
public void testComparisonsSWord ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " test-comparisons-sword.c " ) ;
2019-03-09 15:24:44 +00:00
}
2019-03-09 13:24:51 +00:00
@Test
public void testComparisonsWord ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " test-comparisons-word.c " ) ;
2019-03-09 13:24:51 +00:00
}
2019-03-08 20:43:37 +00:00
@Test
public void testDuplicateLoopProblem ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " duplicate-loop-problem.c " ) ;
2019-03-08 20:43:37 +00:00
}
2019-03-08 05:33:59 +00:00
@Test
public void testUseUninitialized ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " useuninitialized.c " ) ;
2019-03-08 05:33:59 +00:00
}
@Test
public void testIllegalLValue2 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
assertError ( " illegallvalue2.c " , " Illegal assignment Lvalue " ) ;
2019-03-08 05:33:59 +00:00
}
2019-03-07 05:48:32 +00:00
@Test
public void testWordFragment1 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " wfragment1.c " ) ;
2019-03-07 05:48:32 +00:00
}
2019-03-07 06:23:26 +00:00
@Test
public void testTravis1 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " travis1.c " ) ;
2019-03-07 06:23:26 +00:00
}
2019-03-06 22:52:14 +00:00
@Test
public void testUninitialized ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " uninitialized.c " ) ;
2019-03-06 22:52:14 +00:00
}
2019-02-24 22:23:57 +00:00
@Test
public void testStringConstConsolidationNoRoot ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " string-const-consolidation-noroot.c " ) ;
2019-02-24 22:23:57 +00:00
}
2019-02-24 21:18:27 +00:00
@Test
public void testStringConstConsolidation ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " string-const-consolidation.c " ) ;
2019-02-24 21:18:27 +00:00
}
2020-06-27 18:32:09 +00:00
@Test
public void testCommentsGlobalInit ( ) throws IOException , URISyntaxException {
compileAndCompare ( " test-comments-global.c " ) ;
}
2019-02-17 23:12:29 +00:00
@Test
public void testCommentsBlock ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " test-comments-block.c " ) ;
2018-05-07 22:25:33 +00:00
}
2019-02-17 16:53:19 +00:00
@Test
public void testCommentsLoop ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " test-comments-loop.c " ) ;
2019-02-17 16:53:19 +00:00
}
2019-02-17 10:03:55 +00:00
@Test
public void testCommentsSingle ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " test-comments-single.c " ) ;
2019-02-17 10:03:55 +00:00
}
@Test
public void testCommentsUsage ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " test-comments-usage.c " ) ;
2019-02-17 10:03:55 +00:00
}
2019-02-16 22:23:55 +00:00
@Test
public void testBgBlack ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " bgblack.c " ) ;
2019-02-16 22:23:55 +00:00
}
2019-02-03 16:36:34 +00:00
@Test
public void testNoRecursionHeavy ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " no-recursion-heavy.c " ) ;
2019-02-03 16:36:34 +00:00
}
2019-01-11 19:23:30 +00:00
@Test
public void testScrollUp ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " test-scroll-up.c " ) ;
2019-01-11 19:23:30 +00:00
}
2019-01-12 12:58:12 +00:00
@Test
public void testRollSpriteMsb ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " roll-sprite-msb.c " ) ;
2019-01-12 12:58:12 +00:00
}
@Test
public void testRollVariable ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " roll-variable.c " ) ;
2019-01-12 12:58:12 +00:00
}
2019-01-11 05:42:05 +00:00
@Test
public void testWordsizeArrays ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " test-word-size-arrays.c " ) ;
2019-01-11 05:42:05 +00:00
}
2019-01-10 21:58:00 +00:00
@Test
public void testRuntimeUnusedProcedure ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " runtime-unused-procedure.c " ) ;
2019-01-10 21:58:00 +00:00
}
2019-03-08 20:43:37 +00:00
//@Test
//public void testRobozzle64() throws IOException, URISyntaxException {
2020-04-11 14:06:15 +00:00
// compileAndCompare("complex/robozzle_c64/robozzle64.c", log().verboseSSAOptimize().verboseLoopUnroll());
2019-03-08 20:43:37 +00:00
//}
2019-01-10 21:58:00 +00:00
2019-03-04 22:38:07 +00:00
//@Test
//public void testTravisGame() throws IOException, URISyntaxException {
2020-04-11 14:06:15 +00:00
// compileAndCompare("complex/travis/game.c");
2019-03-04 22:38:07 +00:00
//}
2019-08-25 22:55:22 +00:00
//@Test
//public void testBcmod() throws IOException, URISyntaxException {
2020-04-11 14:06:15 +00:00
// compileAndCompare("complex/bcmod/bcmod5h.c", log());
2019-08-25 22:55:22 +00:00
//}
2019-10-03 20:58:34 +00:00
//@Test
//public void testBcmod5hb() throws IOException, URISyntaxException {
2020-04-11 14:06:15 +00:00
// compileAndCompare("complex/bcmod/bcmod5hb.c", log());
2019-10-03 20:58:34 +00:00
//}
2018-12-29 17:52:23 +00:00
@Test
public void testTetrisSprites ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " complex/tetris/test-sprites.c " ) ;
2018-12-29 17:52:23 +00:00
}
@Test
public void testTetris ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " complex/tetris/tetris.c " ) ;
2018-12-29 17:52:23 +00:00
}
2019-01-07 23:07:24 +00:00
@Test
public void testConsolidateConstantProblem ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " consolidate-constant-problem.c " ) ;
2019-01-07 23:07:24 +00:00
}
2019-01-07 20:58:40 +00:00
@Test
public void testConsolidateArrayIndexProblem ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " consolidate-array-index-problem.c " ) ;
2019-01-07 20:58:40 +00:00
}
2019-01-03 17:54:59 +00:00
@Test
public void testScanDesireProblem ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " scan-desire-problem.c " ) ;
2019-01-03 17:54:59 +00:00
}
2018-12-25 20:33:07 +00:00
@Test
public void testClobberAProblem ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " clobber-a-problem.c " ) ;
2018-12-25 20:33:07 +00:00
}
2018-12-24 10:12:47 +00:00
@Test
2018-12-24 13:14:29 +00:00
public void testInterruptVolatileReuseProblem2 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " interrupt-volatile-reuse-problem2.c " ) ;
2018-12-24 10:12:47 +00:00
}
2018-12-24 13:14:29 +00:00
@Test
public void testInterruptVolatileReuseProblem1 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " interrupt-volatile-reuse-problem1.c " ) ;
2018-12-24 13:14:29 +00:00
}
2018-12-24 10:12:47 +00:00
@Test
public void testInitVolatiles ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " init-volatiles.c " ) ;
2018-12-24 10:12:47 +00:00
}
2018-11-25 01:46:22 +00:00
@Test
2018-12-24 01:27:12 +00:00
public void testInterruptVolatileWrite ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " test-interrupt-volatile-write.c " ) ;
2018-11-25 01:46:22 +00:00
}
2018-12-02 20:31:03 +00:00
@Test
2018-12-24 01:27:12 +00:00
public void testLongbranchInterruptProblem ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " longbranch-interrupt-problem.c " ) ;
2018-12-02 20:31:03 +00:00
}
2018-11-28 06:27:44 +00:00
2018-12-25 21:46:58 +00:00
@Test
public void testVarInitProblem ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " var-init-problem.c " ) ;
2018-12-25 21:46:58 +00:00
}
2018-12-24 01:27:12 +00:00
2018-11-03 18:02:59 +00:00
@Test
public void testFastMultiply8 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " examples/fastmultiply/fastmultiply8.c " ) ;
2018-11-03 18:02:59 +00:00
}
2018-10-30 23:45:59 +00:00
@Test
public void test3DPerspective ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " examples/3d/perspective.c " ) ;
2018-10-30 23:45:59 +00:00
}
2018-10-21 14:03:19 +00:00
@Test
public void test3D ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " examples/3d/3d.c " ) ;
2018-10-21 14:03:19 +00:00
}
@Test
public void testTypeInferenceProblem ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " typeinference-problem.c " ) ;
2018-10-21 14:03:19 +00:00
}
2018-10-18 22:28:57 +00:00
@Test
public void testRotate ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " examples/rotate/rotate.c " ) ;
2018-10-18 22:28:57 +00:00
}
2018-10-17 21:00:54 +00:00
@Test
public void testInfLoopError ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " infloop-error.c " ) ;
2018-10-17 21:00:54 +00:00
}
2018-10-16 23:40:56 +00:00
@Test
public void testMinFastMul16 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " min-fmul-16.c " ) ;
2018-10-16 23:40:56 +00:00
}
2019-08-27 11:26:55 +00:00
@Test
public void testBitwiseNot1 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " bitwise-not-1.c " ) ;
2019-08-27 11:26:55 +00:00
}
2018-09-13 10:08:11 +00:00
@Test
public void testBitwiseNot ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " bitwise-not.c " ) ;
2018-09-13 10:08:11 +00:00
}
2018-08-22 20:23:42 +00:00
@Test
public void testUnrollInfinite ( ) throws IOException , URISyntaxException {
2020-11-15 13:15:07 +00:00
assertError ( " unroll-infinite.c " , " Loop cannot be unrolled. " ) ;
2018-08-22 20:23:42 +00:00
}
2018-08-22 00:45:38 +00:00
2018-08-19 19:48:26 +00:00
@Test
public void testUnusedBlockProblem ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " unusedblockproblem.c " ) ;
2018-08-19 19:48:26 +00:00
}
2018-08-22 00:19:27 +00:00
@Test
public void testUnrollScreenFillForDouble ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " unroll-screenfill-for-double.c " ) ;
2018-08-22 00:19:27 +00:00
}
2018-08-19 19:48:26 +00:00
@Test
2018-08-21 23:42:00 +00:00
public void testUnrollScreenFillFor ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " unroll-screenfill-for.c " ) ;
2018-08-21 23:42:00 +00:00
}
@Test
public void testUnrollScreenFillWhile ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " unroll-screenfill-while.c " ) ;
2018-08-21 23:42:00 +00:00
}
@Test
public void testUnrollModifyVar ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " unroll-loop-modifyvar.c " ) ;
2018-08-19 19:48:26 +00:00
}
2019-08-05 15:32:37 +00:00
@Test
public void testUnrollWhileMin ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " unroll-while-min.c " ) ;
2019-08-05 15:32:37 +00:00
}
@Test
public void testUnrollForMin ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " unroll-for-min.c " ) ;
2019-08-05 15:32:37 +00:00
}
2018-08-19 19:48:26 +00:00
@Test
public void testLoop100 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " loop100.c " ) ;
2018-08-19 19:48:26 +00:00
}
2018-08-11 23:03:44 +00:00
2018-08-11 09:08:43 +00:00
@Test
public void testIrqHardwareClobberJsr ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " irq-hardware-clobber-jsr.c " ) ;
2018-08-11 09:08:43 +00:00
}
2018-08-10 22:48:15 +00:00
@Test
public void testIrqHardwareClobber ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " irq-hardware-clobber.c " ) ;
2018-08-10 22:48:15 +00:00
}
2018-08-10 18:32:45 +00:00
2019-08-19 22:08:49 +00:00
@Test
public void testIrqHardwareStack ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " irq-hardware-stack.c " ) ;
2019-08-19 22:08:49 +00:00
}
2018-08-10 10:46:44 +00:00
@Test
public void testIrqHardware ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " irq-hardware.c " ) ;
2018-08-10 10:46:44 +00:00
}
@Test
public void testIrqKernel ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " irq-kernel.c " ) ;
2018-08-10 10:46:44 +00:00
}
2019-02-16 22:23:55 +00:00
@Test
public void testIrqKernelMinimal ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " irq-kernel-minimal.c " ) ;
2019-02-16 22:23:55 +00:00
}
2018-08-10 10:46:44 +00:00
2018-08-05 22:37:40 +00:00
@Test
2020-12-21 00:04:34 +00:00
public void testIrqUnknownType ( ) throws IOException , URISyntaxException {
assertError ( " irq-unknown-type.c " , " Interrupt type not supported unknown " , false ) ;
}
@Test
public void testIrqPragma ( ) throws IOException , URISyntaxException {
compileAndCompare ( " irq-pragma.c " ) ;
}
@Test
2018-08-05 22:37:40 +00:00
public void testIrqHyperscreen ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " examples/irq/irq-hyperscreen.c " ) ;
2018-08-05 22:37:40 +00:00
}
@Test
public void testIrqRaster ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " irq-raster.c " ) ;
2018-08-05 22:37:40 +00:00
}
2018-08-05 20:40:13 +00:00
@Test
public void testInterruptVolatile ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " test-interrupt-volatile.c " ) ;
2018-08-05 20:40:13 +00:00
}
2018-08-05 11:33:23 +00:00
@Test
public void testInterrupt ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " test-interrupt.c " ) ;
2018-08-05 11:33:23 +00:00
}
2018-09-26 20:44:40 +00:00
@Test
public void testInterruptNoType ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " test-interrupt-notype.c " ) ;
2018-09-26 20:44:40 +00:00
}
2018-08-02 00:53:52 +00:00
@Test
public void testMultiplexer ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " examples/multiplexer/simple-multiplexer.c " , 10 ) ;
2020-06-28 00:00:02 +00:00
}
@Test
public void testForRangedNpe ( ) throws IOException , URISyntaxException {
2020-11-08 19:45:22 +00:00
assertError ( " forranged-npe.c " , " Loop variable not declared i " ) ;
2018-08-02 00:53:52 +00:00
}
2018-07-21 09:13:32 +00:00
@Test
public void testForRangedWords ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " forrangedwords.c " ) ;
2018-07-21 09:13:32 +00:00
}
2018-07-23 14:24:44 +00:00
@Test
public void testArrayLengthSymbolicMin ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " array-length-symbolic-min.c " ) ;
2018-07-23 14:24:44 +00:00
}
2018-07-21 09:13:32 +00:00
@Test
public void testArrayLengthSymbolic ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " array-length-symbolic.c " ) ;
2018-07-21 09:13:32 +00:00
}
2018-07-10 09:56:01 +00:00
@Test
2018-07-12 12:42:45 +00:00
public void testForRangeSymbolic ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " forrangesymbolic.c " ) ;
2018-07-12 12:42:45 +00:00
}
@Test
2018-07-10 09:56:01 +00:00
public void testSinePlotter ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " examples/sinplotter/sine-plotter.c " ) ;
2018-07-10 09:56:01 +00:00
}
2018-07-08 21:58:43 +00:00
@Test
public void testScrollLogo ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " examples/scrolllogo/scrolllogo.c " ) ;
2018-07-08 21:58:43 +00:00
}
2018-07-07 17:23:38 +00:00
@Test
public void testShowLogo ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " examples/showlogo/showlogo.c " ) ;
2018-07-07 17:23:38 +00:00
}
2018-12-28 23:55:34 +00:00
@Test
public void testKasmPc ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " test-kasm-pc.c " ) ;
2018-12-28 23:55:34 +00:00
}
2020-06-22 06:16:47 +00:00
@Test
public void testKasmPcError ( ) throws IOException , URISyntaxException {
assertError ( " test-kasm-pc-error.c " , " mismatched input 'pc' expecting " ) ;
}
2018-07-07 11:55:15 +00:00
@Test
public void testKasm ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " test-kasm.c " ) ;
2018-07-07 11:55:15 +00:00
}
2018-05-07 22:25:33 +00:00
@Test
public void testLineAnim ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " line-anim.c " ) ;
2018-04-22 07:59:08 +00:00
}
2018-05-01 20:37:28 +00:00
@Test
public void testInlineFunctionLevel2 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " inline-function-level2.c " ) ;
2018-05-01 20:37:28 +00:00
}
2018-05-01 20:08:23 +00:00
@Test
public void testInlineFunctionPrint ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " inline-function-print.c " ) ;
2018-05-01 20:08:23 +00:00
}
@Test
public void testInlineFunctionIf ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " inline-function-if.c " ) ;
2018-05-01 20:08:23 +00:00
}
2018-04-29 19:39:12 +00:00
@Test
public void testInlineFunction ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " inline-function.c " ) ;
2018-04-29 19:39:12 +00:00
}
2018-05-01 20:08:23 +00:00
@Test
public void testInlineFunctionMin ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " inline-function-min.c " ) ;
2018-05-01 20:08:23 +00:00
}
2018-04-28 10:06:01 +00:00
@Test
2019-02-10 18:11:50 +00:00
public void testAssignmentCompound ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " assignment-compound.c " ) ;
2018-04-28 10:06:01 +00:00
}
2018-04-28 06:22:53 +00:00
@Test
2019-02-10 18:11:50 +00:00
public void testAssignmentChained ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " assignment-chained.c " ) ;
2018-04-28 06:22:53 +00:00
}
2018-04-27 14:11:42 +00:00
@Test
public void testConstMultDiv ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " const-mult-div.c " ) ;
2018-04-27 14:11:42 +00:00
}
2018-04-27 12:55:46 +00:00
@Test
public void testDoubleAssignment ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " double-assignment.c " ) ;
2018-04-27 12:55:46 +00:00
}
2019-10-03 08:41:10 +00:00
@Test
public void testLoopNpe ( ) throws IOException , URISyntaxException {
2020-11-08 19:45:22 +00:00
assertError ( " loop-npe.c " , " Loop variable not declared " ) ;
2019-10-03 08:41:10 +00:00
}
2018-04-26 21:29:43 +00:00
@Test
public void testConstWordPointer ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " const-word-pointer.c " ) ;
2018-04-26 21:29:43 +00:00
}
2018-04-24 23:11:28 +00:00
@Test
public void testConstParam ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " const-param.c " ) ;
2018-04-24 23:11:28 +00:00
}
2019-04-08 22:05:25 +00:00
@Test
public void testDeepNesting ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " deep-nesting.c " ) ;
2019-04-08 22:05:25 +00:00
}
2018-04-24 08:05:48 +00:00
@Test
public void testHelloWorld ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " examples/helloworld/helloworld.c " ) ;
2018-04-24 08:05:48 +00:00
}
@Test
public void testHelloWorld2 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " helloworld2.c " ) ;
2018-04-24 08:05:48 +00:00
}
2018-08-31 21:43:37 +00:00
@Test
public void testHelloWorld2Inline ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " helloworld2-inline.c " ) ;
2018-08-31 21:43:37 +00:00
}
2018-04-24 08:05:48 +00:00
@Test
public void testChessboard ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " chessboard.c " ) ;
2018-04-24 08:05:48 +00:00
}
2018-04-22 20:49:40 +00:00
@Test
public void testFragmentSynth ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " fragment-synth.c " ) ;
2018-04-22 20:49:40 +00:00
}
2018-04-22 09:24:02 +00:00
@Test
public void testConstPointer ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " const-pointer.c " ) ;
2018-04-22 09:24:02 +00:00
}
2018-04-22 07:59:08 +00:00
@Test
public void testVarForwardProblem ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " var-forward-problem.c " ) ;
2018-04-22 07:59:08 +00:00
}
2019-03-04 22:38:07 +00:00
@Test
public void testVarForwardProblem2 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " var-forward-problem2.c " ) ;
2019-03-04 22:38:07 +00:00
}
2018-04-22 07:59:08 +00:00
@Test
public void testInlineString3 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " inline-string-3.c " ) ;
2018-04-18 18:03:39 +00:00
}
2019-09-09 13:51:39 +00:00
@Test
public void testInlineString4 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " inline-string-4.c " ) ;
2019-09-09 13:51:39 +00:00
}
2018-04-18 23:46:41 +00:00
@Test
public void testEmptyBlockError ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " emptyblock-error.c " ) ;
2018-04-18 23:46:41 +00:00
}
2018-04-21 19:38:30 +00:00
@Test
public void testConstCondition ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " const-condition.c " ) ;
2018-04-21 19:38:30 +00:00
}
2018-04-18 18:03:39 +00:00
@Test
2018-04-20 21:09:18 +00:00
public void testBoolConst ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " bool-const.c " ) ;
2018-04-21 19:38:30 +00:00
}
2020-03-30 18:33:26 +00:00
@Test
public void testBoolIfs ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " bool-ifs.c " ) ;
2020-03-30 18:33:26 +00:00
}
2018-04-26 23:09:34 +00:00
@Test
2019-08-06 07:08:10 +00:00
public void testBoolIfsMin ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " bool-ifs-min.c " ) ;
2018-04-26 23:09:34 +00:00
}
2018-04-21 19:38:30 +00:00
@Test
public void testBoolVars ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " bool-vars.c " ) ;
2017-12-30 20:59:23 +00:00
}
2018-04-26 23:09:34 +00:00
@Test
public void testBoolFunction ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " bool-function.c " ) ;
2018-04-26 23:09:34 +00:00
}
2018-04-27 12:49:35 +00:00
@Test
public void testBoolPointer ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " bool-pointer.c " ) ;
2018-04-27 12:49:35 +00:00
}
2018-04-15 18:02:48 +00:00
@Test
public void testC64DtvBlitterMin ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " c64dtv-blittermin.c " ) ;
2018-04-15 18:02:48 +00:00
}
2019-05-18 20:07:16 +00:00
@Test
public void testC64DtvBlitterBox ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " c64dtv-blitter-box.c " ) ;
2019-05-18 20:07:16 +00:00
}
2018-04-15 18:02:48 +00:00
@Test
public void testC64Dtv8bppChunkyStretch ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " c64dtv-8bppchunkystretch.c " ) ;
2018-04-15 18:02:48 +00:00
}
@Test
public void testC64Dtv8bppCharStretch ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " c64dtv-8bppcharstretch.c " ) ;
2018-04-15 18:02:48 +00:00
}
2018-04-13 18:06:29 +00:00
@Test
public void testInlineString2 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " inline-string-2.c " ) ;
2018-04-13 18:06:29 +00:00
}
2020-10-18 15:46:09 +00:00
@Test
public void testLoopProblem3 ( ) throws IOException , URISyntaxException {
compileAndCompare ( " loop-problem3.c " ) ;
}
2018-04-07 14:01:35 +00:00
@Test
public void testLoopProblem2 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " loop-problem2.c " ) ;
2018-04-01 01:58:07 +00:00
}
2019-06-02 23:51:25 +00:00
@Test
public void testOperatorLoHiProblem1 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " operator-lohi-problem-1.c " ) ;
2019-06-02 23:51:25 +00:00
}
2018-03-26 21:49:07 +00:00
@Test
public void testOperatorLoHiProblem ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " operator-lohi-problem.c " ) ;
2018-03-26 21:49:07 +00:00
}
@Test
public void testKeyboardGlitch ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " keyboard-glitch.c " ) ;
2018-03-26 21:49:07 +00:00
}
2018-03-24 21:37:11 +00:00
@Test
public void testNoromCharset ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " norom-charset.c " ) ;
2018-03-24 21:37:11 +00:00
}
2018-03-22 17:34:04 +00:00
@Test
public void testChargenAnalysis ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " examples/chargen/chargen-analysis.c " ) ;
2018-03-22 17:34:04 +00:00
}
2018-03-19 23:52:55 +00:00
@Test
public void testKeyboardSpace ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " test-keyboard-space.c " ) ;
2018-03-19 23:52:55 +00:00
}
2018-03-19 00:15:18 +00:00
@Test
public void testKeyboard ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " test-keyboard.c " ) ;
2018-03-19 00:15:18 +00:00
}
2018-03-18 15:35:47 +00:00
@Test
public void testC64DtvColor ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " c64dtv-color.c " ) ;
2018-03-18 15:35:47 +00:00
}
2018-03-05 00:00:33 +00:00
@Test
public void testCastPrecedenceProblem ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " cast-precedence-problem.c " ) ;
2018-03-05 00:00:33 +00:00
}
2018-02-25 18:27:36 +00:00
@Test
public void testLoopProblem ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " loop-problem.c " ) ;
2018-02-25 18:27:36 +00:00
}
2018-02-25 13:07:44 +00:00
2018-02-23 21:15:10 +00:00
@Test
public void testLoHiConst ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " test-lohiconst.c " ) ;
2018-02-23 21:15:10 +00:00
}
2018-02-19 07:29:47 +00:00
@Test
2018-02-25 10:10:50 +00:00
public void testSinusGen16 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " sinusgen16.c " ) ;
2018-02-25 10:10:50 +00:00
}
2018-03-05 00:00:33 +00:00
@Test
public void testSinusGen16b ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " sinusgen16b.c " ) ;
2018-03-05 00:00:33 +00:00
}
2018-02-26 22:00:10 +00:00
@Test
public void testSinusGenScale8 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " sinusgenscale8.c " ) ;
2018-02-26 22:00:10 +00:00
}
2018-02-25 10:10:50 +00:00
@Test
public void testSinusGen8 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " sinusgen8.c " ) ;
2018-02-19 07:29:47 +00:00
}
2018-02-25 13:35:20 +00:00
@Test
public void testSinusGen8b ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " sinusgen8b.c " ) ;
2018-02-25 13:35:20 +00:00
}
2018-02-18 16:49:03 +00:00
@Test
public void testLineGen ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " linegen.c " ) ;
2018-02-18 16:49:03 +00:00
}
2018-02-18 14:35:17 +00:00
2018-02-15 18:50:33 +00:00
@Test
public void testLowHigh ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " test-lowhigh.c " ) ;
2018-02-15 18:50:33 +00:00
}
2018-02-13 02:34:01 +00:00
@Test
public void testLongJump2 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " longjump2.c " ) ;
2018-02-13 02:34:01 +00:00
}
@Test
public void testLongJump ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " longjump.c " ) ;
2018-02-13 02:34:01 +00:00
}
2019-07-26 14:12:12 +00:00
@Test
public void testAddressOf3 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " address-of-3.c " ) ;
2019-07-26 14:12:12 +00:00
}
2018-02-10 21:08:36 +00:00
@Test
2019-06-16 13:03:23 +00:00
public void testAddressOf2 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " address-of-2.c " ) ;
2019-06-16 13:03:23 +00:00
}
@Test
public void testAddressOf1 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " address-of-1.c " ) ;
2018-02-10 21:08:36 +00:00
}
2018-02-03 12:20:34 +00:00
@Test
2019-06-16 13:03:23 +00:00
public void testAddressOf0 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " address-of-0.c " ) ;
2018-02-03 12:20:34 +00:00
}
2018-01-31 20:27:22 +00:00
@Test
public void testDivision ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " test-division.c " ) ;
2018-01-31 20:27:22 +00:00
}
2019-08-10 07:02:35 +00:00
@Test
public void testVarExport ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " var-export.c " ) ;
2019-08-10 07:02:35 +00:00
}
2018-01-30 09:04:35 +00:00
@Test
public void testVarRegister ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " var-register.c " ) ;
2018-01-30 09:04:35 +00:00
}
2019-08-10 06:39:42 +00:00
@Test
public void testVarRegisterNoarg ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " var-register-noarg.c " ) ;
2019-08-10 06:39:42 +00:00
}
2019-08-29 20:52:58 +00:00
@Test
public void testVarRegisterZp ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " var-register-zp.c " ) ;
2019-08-29 20:52:58 +00:00
}
@Test
public void testVarRegisterZp3 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " var-register-zp-3.c " ) ;
2019-08-29 20:52:58 +00:00
}
2018-01-28 15:19:15 +00:00
@Test
public void testDword ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " dword.c " ) ;
2018-01-28 15:19:15 +00:00
}
2018-01-24 22:29:44 +00:00
@Test
public void testCastDeref ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " cast-deref.c " ) ;
2018-01-24 22:29:44 +00:00
}
2018-01-15 21:16:25 +00:00
@Test
public void testRasterBars ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " examples/rasterbars/raster-bars.c " ) ;
2018-01-15 21:16:25 +00:00
}
@Test
2018-04-22 07:59:08 +00:00
public void testComparisons ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " test-comparisons.c " , 10 ) ;
2018-04-22 07:59:08 +00:00
}
2018-01-01 14:09:47 +00:00
2018-04-22 07:59:08 +00:00
@Test
2017-12-29 17:20:11 +00:00
public void testMemAlignment ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " mem-alignment.c " ) ;
2017-12-29 17:20:11 +00:00
}
2017-12-30 20:59:23 +00:00
@Test
2018-02-16 07:59:54 +00:00
public void testMultiply8Bit ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " test-multiply-8bit.c " ) ;
2018-02-16 07:59:54 +00:00
}
@Test
public void testMultiply16Bit ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " test-multiply-16bit.c " ) ;
2017-12-28 00:50:55 +00:00
}
2020-04-18 18:54:39 +00:00
@Test
public void testMultiply16BitConst ( ) throws IOException , URISyntaxException {
compileAndCompare ( " multiply-16bit-const.c " ) ;
}
2019-09-09 21:01:04 +00:00
@Test
public void testArraysInitShort ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " arrays-init-short.c " ) ;
2019-09-09 21:01:04 +00:00
}
2020-03-26 15:20:30 +00:00
@Test
public void testArraysNonstandardSyntax ( ) throws IOException , URISyntaxException {
2020-11-08 19:45:22 +00:00
assertError ( " arrays-nonstandard-syntax.c " , " Non-standard array declaration. " ) ;
2020-03-26 15:20:30 +00:00
}
2017-12-30 20:59:23 +00:00
@Test
2017-12-27 22:53:51 +00:00
public void testArraysInit ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " arrays-init.c " ) ;
2017-12-27 22:53:51 +00:00
}
2017-12-30 20:59:23 +00:00
@Test
2017-12-27 12:40:55 +00:00
public void testTrueInlineWords ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " true-inline-words.c " ) ;
2017-12-27 12:40:55 +00:00
}
2017-12-30 20:59:23 +00:00
@Test
2017-12-26 16:38:51 +00:00
public void testIncrementInArray ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " incrementinarray.c " ) ;
2017-12-26 16:38:51 +00:00
}
2017-12-30 20:59:23 +00:00
@Test
2017-12-26 16:24:30 +00:00
public void testForIncrementAssign ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " forincrementassign.c " ) ;
2017-12-26 16:24:30 +00:00
}
2017-12-30 20:59:23 +00:00
@Test
2017-12-26 16:24:30 +00:00
public void testConstants ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " constants.c " ) ;
2017-12-26 16:24:30 +00:00
}
2017-12-30 20:59:23 +00:00
@Test
2017-12-26 16:24:30 +00:00
public void testInlineAssignment ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " inline-assignment.c " ) ;
2017-12-26 16:24:30 +00:00
}
2019-12-22 10:53:37 +00:00
@Test
public void testInlineDWord0 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " inline-dword-0.c " ) ;
2019-12-22 10:53:37 +00:00
}
2019-05-12 19:18:55 +00:00
@Test
public void testInlineWord0 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " inline-word-0.c " ) ;
2019-05-12 19:18:55 +00:00
}
@Test
public void testInlineWord1 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " inline-word-1.c " ) ;
2019-05-12 19:18:55 +00:00
}
@Test
public void testInlineWord2 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " inline-word-2.c " ) ;
2019-05-12 19:18:55 +00:00
}
2017-12-30 20:59:23 +00:00
@Test
2017-12-25 19:19:53 +00:00
public void testInlineWord ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " inline-word.c " ) ;
2017-12-25 19:19:53 +00:00
}
2017-12-30 20:59:23 +00:00
@Test
2017-12-23 01:35:50 +00:00
public void testSignedWords ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " signed-words.c " ) ;
2017-12-23 01:35:50 +00:00
}
2017-12-30 20:59:23 +00:00
@Test
2017-12-04 22:48:14 +00:00
public void testSinusSprites ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " examples/sinsprites/sinus-sprites.c " ) ;
2017-12-04 22:48:14 +00:00
}
2017-12-30 20:59:23 +00:00
@Test
2017-12-03 13:01:31 +00:00
public void testConstantAbsMin ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " constabsmin.c " ) ;
2017-12-03 13:01:31 +00:00
}
2017-12-30 20:59:23 +00:00
@Test
2017-12-03 13:01:31 +00:00
public void testBasicFloats ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " sinus-basic.c " ) ;
2017-12-03 13:01:31 +00:00
}
2017-12-30 20:59:23 +00:00
@Test
2017-12-02 15:56:58 +00:00
public void testDoubleImport ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " double-import.c " ) ;
2017-12-02 15:56:58 +00:00
}
2017-12-30 20:59:23 +00:00
@Test
2017-12-01 23:01:53 +00:00
public void testImporting ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " importing.c " ) ;
2017-12-01 23:01:53 +00:00
}
2017-12-30 20:59:23 +00:00
@Test
2017-11-30 20:51:13 +00:00
public void testUnusedVars ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " unused-vars.c " ) ;
2017-11-30 20:51:13 +00:00
}
2017-12-30 20:59:23 +00:00
@Test
2020-04-18 18:54:39 +00:00
public void testFillscreen3 ( ) throws IOException , URISyntaxException {
compileAndCompare ( " fillscreen-3.c " ) ;
}
@Test
public void testFillscreen2 ( ) throws IOException , URISyntaxException {
compileAndCompare ( " fillscreen-2.c " ) ;
}
@Test
public void testFillscreen1 ( ) throws IOException , URISyntaxException {
compileAndCompare ( " fillscreen-1.c " ) ;
2017-11-30 20:51:13 +00:00
}
2017-12-30 20:59:23 +00:00
@Test
2017-11-29 11:29:57 +00:00
public void testLiverangeCallProblem ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " liverange-call-problem.c " ) ;
2017-11-29 11:29:57 +00:00
}
2017-12-30 20:59:23 +00:00
@Test
2017-11-29 11:29:57 +00:00
public void testPrintProblem ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " print-problem.c " ) ;
2017-11-29 11:29:57 +00:00
}
2017-12-30 20:59:23 +00:00
@Test
2017-12-03 21:59:25 +00:00
public void testPrintMsg ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " printmsg.c " ) ;
2017-11-29 11:29:57 +00:00
}
2017-12-30 20:59:23 +00:00
@Test
2017-11-27 23:39:15 +00:00
public void testUnusedMethod ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " unused-method.c " ) ;
2017-11-27 23:39:15 +00:00
}
2017-12-30 20:59:23 +00:00
@Test
2017-11-29 20:31:20 +00:00
public void testInlineString ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " inline-string.c " ) ;
2017-11-29 20:31:20 +00:00
}
2017-12-30 20:59:23 +00:00
@Test
2017-11-27 22:55:39 +00:00
public void testLocalString ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " local-string.c " ) ;
2017-11-27 22:55:39 +00:00
}
2017-12-30 20:59:23 +00:00
@Test
2017-11-27 22:55:39 +00:00
public void testInlineArrayProblem ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " inlinearrayproblem.c " ) ;
2017-11-27 22:55:39 +00:00
}
2017-12-30 20:59:23 +00:00
@Test
2017-11-27 00:04:12 +00:00
public void testImmZero ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " immzero.c " ) ;
2017-11-27 00:04:12 +00:00
}
2017-12-30 20:59:23 +00:00
@Test
2017-11-26 20:27:00 +00:00
public void testWordExpr ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " wordexpr.c " ) ;
2017-11-26 20:27:00 +00:00
}
2017-12-30 20:59:23 +00:00
@Test
2017-11-26 16:38:44 +00:00
public void testZpptr ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " zpptr.c " ) ;
2017-11-26 16:38:44 +00:00
}
2017-12-30 20:59:23 +00:00
@Test
2017-11-24 22:25:16 +00:00
public void testCasting ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " casting.c " ) ;
2017-11-24 22:25:16 +00:00
}
2017-07-15 20:00:02 +00:00
2017-12-30 20:59:23 +00:00
@Test
2017-11-20 23:30:16 +00:00
public void testSignedBytes ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " signed-bytes.c " ) ;
2017-11-20 23:30:16 +00:00
}
2017-12-30 20:59:23 +00:00
@Test
2017-11-17 08:37:11 +00:00
public void testScrollBig ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " examples/scrollbig/scrollbig.c " ) ;
2017-11-17 08:37:11 +00:00
}
2017-12-30 20:59:23 +00:00
@Test
2017-11-13 20:52:38 +00:00
public void testPtrComplex ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " ptr-complex.c " ) ;
2017-11-13 20:52:38 +00:00
}
2017-12-30 20:59:23 +00:00
@Test
2017-11-12 23:47:05 +00:00
public void testIncD020 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " incd020.c " ) ;
2017-11-12 23:47:05 +00:00
}
2020-07-28 19:31:17 +00:00
@Test
public void testIncD0202 ( ) throws IOException , URISyntaxException {
2020-10-05 15:53:46 +00:00
compileAndCompare ( " incd020-2.c " ) ;
2020-07-28 19:31:17 +00:00
}
2017-12-30 20:59:23 +00:00
@Test
2017-11-09 23:27:56 +00:00
public void testOverlapAllocation2 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " overlap-allocation-2.c " ) ;
2017-11-09 23:27:56 +00:00
}
2017-12-30 20:59:23 +00:00
@Test
2017-11-07 08:32:16 +00:00
public void testOverlapAllocation ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " overlap-allocation.c " ) ;
2017-11-07 08:32:16 +00:00
}
2017-12-30 20:59:23 +00:00
@Test
2017-10-26 10:48:04 +00:00
public void testBitmapBresenham ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " examples/bresenham/bitmap-bresenham.c " ) ;
2017-10-26 10:48:04 +00:00
}
2017-12-30 20:59:23 +00:00
@Test
2017-11-05 08:56:04 +00:00
public void testAsmClobber ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " inline-asm-clobber.c " ) ;
2017-11-05 08:56:04 +00:00
}
2017-12-30 20:59:23 +00:00
@Test
2017-11-05 02:01:32 +00:00
public void testInlineAsm ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " inline-asm.c " ) ;
2017-11-05 02:01:32 +00:00
}
2017-12-30 20:59:23 +00:00
@Test
2017-11-05 08:44:00 +00:00
public void testChargen ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " chargen.c " ) ;
2017-11-05 08:44:00 +00:00
}
2017-12-30 20:59:23 +00:00
@Test
2017-11-03 06:58:02 +00:00
public void testBitmapPlotter ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " bitmap-plotter.c " ) ;
2017-11-03 06:58:02 +00:00
}
2017-12-30 20:59:23 +00:00
@Test
2017-11-03 06:58:02 +00:00
public void testConstIdentification ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " const-identification.c " ) ;
2017-11-03 06:58:02 +00:00
}
2017-12-30 20:59:23 +00:00
@Test
2017-11-01 11:59:29 +00:00
public void testCallConstParam ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " callconstparam.c " ) ;
2017-11-01 11:59:29 +00:00
}
2017-12-30 20:59:23 +00:00
@Test
2017-10-21 11:34:42 +00:00
public void testScrollClobber ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " scroll-clobber.c " ) ;
2017-10-21 11:34:42 +00:00
}
2017-12-30 20:59:23 +00:00
@Test
2017-10-20 15:25:04 +00:00
public void testHalfscii ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " halfscii.c " ) ;
2017-10-20 15:25:04 +00:00
}
2017-10-19 08:21:32 +00:00
2017-12-30 20:59:23 +00:00
@Test
2017-10-18 23:29:44 +00:00
public void testScroll ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " examples/scroll/scroll.c " ) ;
2017-10-18 23:29:44 +00:00
}
2017-12-30 20:59:23 +00:00
@Test
2017-10-02 19:47:12 +00:00
public void testConstantMin ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " constantmin.c " ) ;
2017-10-02 19:47:12 +00:00
}
2020-03-23 06:26:26 +00:00
@Test
public void testLiveRange10 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " liverange-10.c " ) ;
2020-03-23 06:26:26 +00:00
}
2020-03-22 21:26:39 +00:00
@Test
public void testLiveRange9 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " liverange-9.c " ) ;
2020-03-22 21:26:39 +00:00
}
@Test
public void testLiveRange8 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " liverange-8.c " ) ;
2020-03-22 21:26:39 +00:00
}
@Test
public void testLiveRange7 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " liverange-7.c " ) ;
2020-03-22 21:26:39 +00:00
}
@Test
public void testLiveRange6 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " liverange-6.c " ) ;
2020-03-22 21:26:39 +00:00
}
@Test
public void testLiveRange5 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " liverange-5.c " ) ;
2020-03-22 21:26:39 +00:00
}
@Test
public void testLiveRange4 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " liverange-4.c " ) ;
2020-03-22 21:26:39 +00:00
}
@Test
public void testLiveRange3 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " liverange-3.c " ) ;
2020-03-22 21:26:39 +00:00
}
2020-03-16 06:57:56 +00:00
@Test
public void testLiveRange2 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " liverange-2.c " ) ;
2020-03-16 06:57:56 +00:00
}
@Test
public void testLiveRange1 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " liverange-1.c " ) ;
2020-03-16 06:57:56 +00:00
}
2017-12-30 20:59:23 +00:00
@Test
2017-09-03 22:49:00 +00:00
public void testLiveRange ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " liverange.c " ) ;
2017-09-03 22:49:00 +00:00
}
2017-12-30 20:59:23 +00:00
@Test
2017-08-20 23:19:43 +00:00
public void testZpParamMin ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " zpparammin.c " ) ;
2017-08-20 23:19:43 +00:00
}
2017-12-30 20:59:23 +00:00
@Test
2017-08-20 19:09:03 +00:00
public void testInMemArray ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " inmemarray.c " ) ;
2017-08-20 19:09:03 +00:00
}
2017-12-30 20:59:23 +00:00
@Test
2017-12-25 19:19:53 +00:00
public void testInMemConstArray ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " inmem-const-array.c " ) ;
2017-12-25 19:19:53 +00:00
}
2017-12-30 20:59:23 +00:00
@Test
2017-10-17 20:51:16 +00:00
public void testInMemString ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " inmemstring.c " ) ;
2017-10-17 20:51:16 +00:00
}
2017-12-30 20:59:23 +00:00
@Test
2017-08-07 12:53:25 +00:00
public void testVoronoi ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " voronoi.c " ) ;
2017-08-07 12:53:25 +00:00
}
2017-12-30 20:59:23 +00:00
@Test
2017-07-18 20:49:25 +00:00
public void testFlipper ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " flipper-rex2.c " ) ;
2017-07-18 20:49:25 +00:00
}
2017-12-30 20:59:23 +00:00
@Test
2017-07-18 20:49:25 +00:00
public void testBresenham ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " bresenham.c " ) ;
2017-07-15 20:00:02 +00:00
}
2017-12-30 20:59:23 +00:00
@Test
2017-08-23 07:37:16 +00:00
public void testBresenhamArr ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " bresenhamarr.c " ) ;
2017-08-23 07:37:16 +00:00
}
2017-12-30 20:59:23 +00:00
@Test
2017-10-16 10:47:42 +00:00
public void testIterArray ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " iterarray.c " ) ;
2017-07-23 21:29:40 +00:00
}
2017-12-30 20:59:23 +00:00
@Test
2017-07-23 21:29:40 +00:00
public void testLoopMin ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " loopmin.c " ) ;
2017-07-23 21:29:40 +00:00
}
2017-12-30 20:59:23 +00:00
@Test
2017-07-21 10:18:05 +00:00
public void testSumMin ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " summin.c " ) ;
2017-07-21 10:18:05 +00:00
}
2017-12-30 20:59:23 +00:00
@Test
2017-07-27 20:20:50 +00:00
public void testLoopSplit ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " loopsplit.c " ) ;
2017-07-27 20:20:50 +00:00
}
2017-12-30 20:59:23 +00:00
@Test
2017-07-28 01:08:19 +00:00
public void testLoopNest ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " loopnest.c " ) ;
2017-07-28 01:08:19 +00:00
}
2017-12-30 20:59:23 +00:00
@Test
2018-01-15 20:02:49 +00:00
public void testLoopNest2 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " loopnest2.c " ) ;
2017-07-29 09:08:24 +00:00
}
2018-01-15 20:02:49 +00:00
@Test
public void testLoopNest3 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " loopnest3.c " ) ;
2018-01-15 20:02:49 +00:00
}
2017-12-30 20:59:23 +00:00
@Test
2017-07-29 19:04:28 +00:00
public void testFibMem ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " fibmem.c " ) ;
2017-07-29 19:04:28 +00:00
}
2017-12-30 20:59:23 +00:00
@Test
2017-07-30 09:08:44 +00:00
public void testPtrTest ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " ptrtest.c " ) ;
2017-07-30 09:08:44 +00:00
}
2017-12-30 20:59:23 +00:00
@Test
2017-08-06 11:31:29 +00:00
public void testPtrTestMin ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " ptrtestmin.c " ) ;
2017-08-06 11:31:29 +00:00
}
2017-12-30 20:59:23 +00:00
@Test
2017-07-30 14:31:59 +00:00
public void testUseGlobal ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " useglobal.c " ) ;
2017-07-30 14:31:59 +00:00
}
2017-07-29 19:04:28 +00:00
2017-12-30 20:59:23 +00:00
@Test
2017-08-11 22:15:59 +00:00
public void testModGlobal ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " modglobal.c " ) ;
2017-08-11 22:15:59 +00:00
}
2017-12-30 20:59:23 +00:00
@Test
2017-08-11 22:22:46 +00:00
public void testModGlobalMin ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " modglobalmin.c " ) ;
2017-08-11 22:22:46 +00:00
}
2017-12-30 20:59:23 +00:00
@Test
2017-08-12 22:44:48 +00:00
public void testIfMin ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " ifmin.c " ) ;
2017-08-12 22:44:48 +00:00
}
2019-08-01 19:15:33 +00:00
@Test
public void testLoopWhileMin ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " loop-while-min.c " ) ;
2019-08-01 19:15:33 +00:00
}
2019-08-03 23:50:00 +00:00
@Test
public void testLoopMemsetMin ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " loop-memset-min.c " ) ;
2019-08-03 23:50:00 +00:00
}
2019-08-01 19:15:33 +00:00
@Test
public void testLoopWhileSideeffect ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " loop-while-sideeffect.c " ) ;
2019-08-01 19:15:33 +00:00
}
@Test
public void testLoopForSideeffect ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " loop-for-sideeffect.c " ) ;
2019-08-01 19:15:33 +00:00
}
2017-12-30 20:59:23 +00:00
@Test
2017-08-17 22:28:39 +00:00
public void testForClassicMin ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " forclassicmin.c " ) ;
2017-08-17 22:28:39 +00:00
}
2017-12-30 20:59:23 +00:00
@Test
2017-08-17 22:28:39 +00:00
public void testForRangeMin ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " forrangemin.c " ) ;
2017-08-17 22:28:39 +00:00
}
2017-12-30 20:59:23 +00:00
@Test
2017-12-03 13:26:28 +00:00
public void testAssignConst ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
assertError ( " assign-const.c " , " const variable may not be modified " ) ;
2017-12-03 13:26:28 +00:00
}
2017-12-30 20:59:23 +00:00
@Test
2017-12-01 22:25:53 +00:00
public void testStmtOutsideMethod ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
assertError ( " stmt-outside-method.c " , " Error parsing " ) ;
2017-12-01 22:25:53 +00:00
}
2017-12-30 20:59:23 +00:00
@Test
2017-07-30 14:31:59 +00:00
public void testUseUndeclared ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
assertError ( " useundeclared.c " , " Unknown variable " ) ;
2017-07-30 14:31:59 +00:00
}
2017-11-26 23:34:59 +00:00
2019-03-04 22:38:07 +00:00
@Test
public void testassignUndeclared ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
assertError ( " assignundeclared.c " , " Unknown variable " ) ;
2019-03-04 22:38:07 +00:00
}
2018-04-22 10:22:48 +00:00
@Test
public void testUseUninitialized2 ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
assertError ( " useuninitialized2.c " , " Variable used before being defined " ) ;
2018-04-22 10:22:48 +00:00
}
2017-12-30 20:59:23 +00:00
@Test
2017-11-26 23:34:59 +00:00
public void testTypeMismatch ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
assertError ( " typemismatch.c " , " Type mismatch " ) ;
2017-11-26 23:34:59 +00:00
}
2017-07-30 14:31:59 +00:00
2017-12-30 20:59:23 +00:00
@Test
2017-12-03 16:01:23 +00:00
public void testToManyParams ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
assertError ( " tomanyparams.c " , " Wrong number of parameters in call " ) ;
2017-12-03 16:01:23 +00:00
}
2017-12-30 20:59:23 +00:00
@Test
2017-12-03 16:01:23 +00:00
public void testToFewParams ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
assertError ( " tofewparams.c " , " Wrong number of parameters in call " ) ;
2017-12-03 21:57:54 +00:00
}
2020-04-19 21:29:37 +00:00
@Test
public void testToFewParamsVarlength ( ) throws IOException , URISyntaxException {
assertError ( " tofewparams-varlength.c " , " Wrong number of parameters in call " ) ;
}
@Test
public void testVarlengthError ( ) throws IOException , URISyntaxException {
assertError ( " varlength-error.c " , " Variable length parameter list is only legal as the last parameter. " ) ;
}
2017-12-30 20:59:23 +00:00
@Test
2017-12-03 21:57:54 +00:00
public void testNoReturn ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
assertError ( " noreturn.c " , " Method must end with a return statement " , false ) ;
2017-12-03 21:57:54 +00:00
}
2020-04-13 08:50:57 +00:00
@Test
public void testReturnFromVoid ( ) throws IOException , URISyntaxException {
2020-11-08 19:45:22 +00:00
assertError ( " returnfromvoid.c " , " Return value from void function " ) ;
2020-04-13 08:50:57 +00:00
}
2017-12-30 20:59:23 +00:00
@Test
2017-12-03 21:57:54 +00:00
public void testProcedureNotFound ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
assertError ( " procedurenotfound.c " , " Called procedure not found " ) ;
2017-12-03 21:57:54 +00:00
}
2017-12-30 20:59:23 +00:00
@Test
2017-12-26 16:24:30 +00:00
public void testIllegalLValue ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
assertError ( " illegallvalue.c " , " LValue is illegal " ) ;
2017-12-26 16:24:30 +00:00
}
2017-12-30 20:59:23 +00:00
@Test
2017-12-27 19:52:37 +00:00
public void testInvalidConstType ( ) throws IOException , URISyntaxException {
2020-11-15 13:15:07 +00:00
assertError ( " invalid-consttype.c " , " Constant init-value has a non-matching type " ) ;
2017-12-27 19:52:37 +00:00
}
2017-12-30 20:59:23 +00:00
@Test
2017-12-27 22:53:51 +00:00
public void testArrayUninitialized ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
assertError ( " array-uninitialized.c " , " Array has no declared size. " ) ;
2017-12-27 22:53:51 +00:00
}
2017-12-30 20:59:23 +00:00
@Test
2017-12-27 23:17:39 +00:00
public void testArrayLengthMismatch ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
assertError ( " array-length-mismatch.c " , " Array length mismatch " , false ) ;
2017-12-27 23:17:39 +00:00
}
2017-12-30 20:59:23 +00:00
@Test
2017-12-27 23:17:39 +00:00
public void testStringLengthMismatch ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
assertError ( " string-length-mismatch.c " , " Array length mismatch " , false ) ;
2017-12-27 23:17:39 +00:00
}
2017-12-30 20:59:23 +00:00
@Test
2017-12-29 17:20:11 +00:00
public void testIllegalAlignment ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
assertError ( " illegal-alignment.c " , " Cannot align variable " ) ;
2017-12-29 17:20:11 +00:00
}
2018-01-30 21:23:07 +00:00
@Test
public void testRegisterClobber ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
assertError ( " register-clobber.c " , " register clobber problem " , false ) ;
2018-01-30 21:23:07 +00:00
}
2018-04-22 21:46:26 +00:00
@Test
public void testRecursionError ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
assertError ( " recursion-error.c " , " Recursion " , false ) ;
2018-04-22 21:46:26 +00:00
}
@Test
public void testRecursionComplexError ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
assertError ( " recursion-error-complex.c " , " Recursion " , false ) ;
2018-04-22 21:46:26 +00:00
}
2018-04-27 12:49:35 +00:00
@Test
public void testConstPointerModifyError ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
assertError ( " const-pointer-modify.c " , " Constants can not be modified " ) ;
2018-04-27 12:49:35 +00:00
}
2018-04-22 21:46:26 +00:00
2018-04-27 14:11:42 +00:00
@Test
public void testNoMulRuntime ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
assertError ( " no-mul-runtime.c " , " Runtime multiplication not supported " ) ;
2018-04-27 14:11:42 +00:00
}
@Test
public void testNoDivRuntime ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
assertError ( " no-div-runtime.c " , " Runtime division not supported " ) ;
2018-04-27 14:11:42 +00:00
}
@Test
2018-04-28 11:00:20 +00:00
public void testNoModRuntime ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
assertError ( " no-mod-runtime.c " , " Runtime modulo not supported " ) ;
2018-04-27 14:11:42 +00:00
}
2018-08-04 11:07:21 +00:00
@Test
public void testNoInlineInterrupt ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
assertError ( " no-inlineinterrupt.c " , " Interrupts cannot be inlined " , false ) ;
2018-08-04 11:07:21 +00:00
}
@Test
public void testNoCalledInterrupt ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
assertError ( " no-calledinterrupt.c " , " Interrupts cannot be called. " ) ;
2018-08-04 11:07:21 +00:00
}
2018-04-27 14:11:42 +00:00
2018-08-05 11:33:23 +00:00
@Test
public void testNoParamInterrupt ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
assertError ( " no-paraminterrupt.c " , " Interrupts cannot have parameters. " , false ) ;
2018-08-05 11:33:23 +00:00
}
@Test
public void testNoReturnInterrupt ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
assertError ( " no-returninterrupt.c " , " Interrupts cannot return anything. " , false ) ;
2018-08-05 11:33:23 +00:00
}
2019-01-17 22:28:39 +00:00
@Test
public void testConditionTypeMismatch ( ) throws IOException , URISyntaxException {
2020-04-11 14:06:15 +00:00
compileAndCompare ( " condition-type-mismatch.c " ) ;
2019-01-17 22:28:39 +00:00
}
2020-12-06 02:23:38 +00:00
@Test
public void testIssue594 ( ) throws IOException , URISyntaxException {
compileAndCompare ( " issue-594-case.c " ) ;
}
2020-08-24 19:00:16 +00:00
@BeforeAll
2019-03-20 06:20:00 +00:00
public static void setUp ( ) {
2020-11-02 14:00:09 +00:00
TmpDirManager . init ( new File ( " " ) . toPath ( ) ) ;
2019-03-20 06:20:00 +00:00
}
2020-08-24 19:00:16 +00:00
@AfterAll
2019-03-20 06:20:00 +00:00
public static void tearDown ( ) {
2020-11-02 14:00:09 +00:00
if ( TmpDirManager . MANAGER ! = null )
TmpDirManager . MANAGER . cleanup ( ) ;
2019-07-15 07:47:47 +00:00
//AsmFragmentTemplateUsages.logUsages(log, false, false, false, false, false, false);
//printGCStats();
2019-05-31 13:48:20 +00:00
}
public static void printGCStats ( ) {
long totalGarbageCollections = 0 ;
long garbageCollectionTime = 0 ;
for ( GarbageCollectorMXBean gc :
ManagementFactory . getGarbageCollectorMXBeans ( ) ) {
long count = gc . getCollectionCount ( ) ;
if ( count > = 0 ) {
totalGarbageCollections + = count ;
}
long time = gc . getCollectionTime ( ) ;
if ( time > = 0 ) {
garbageCollectionTime + = time ;
}
}
System . out . println ( " Total Garbage Collections: "
+ totalGarbageCollections ) ;
System . out . println ( " Total Garbage Collection Time (ms): "
+ garbageCollectionTime ) ;
MemoryUsage heapMemoryUsage = ManagementFactory . getMemoryMXBean ( ) . getHeapMemoryUsage ( ) ;
MemoryUsage nonHeapMemoryUsage = ManagementFactory . getMemoryMXBean ( ) . getNonHeapMemoryUsage ( ) ;
System . out . println ( " Heap Memory Usage: "
+ heapMemoryUsage . toString ( ) ) ;
System . out . println ( " Non-Heap Memory Usage: "
+ nonHeapMemoryUsage . toString ( ) ) ;
2019-03-20 06:20:00 +00:00
}
2019-04-04 23:05:15 +00:00
private static CompileLog log ( ) {
2019-03-20 06:20:00 +00:00
CompileLog log = new CompileLog ( ) ;
log . setSysOut ( true ) ;
return log ;
}
2017-12-03 21:57:54 +00:00
private void assertError ( String kcFile , String expectError ) throws IOException , URISyntaxException {
2019-03-10 08:29:02 +00:00
assertError ( kcFile , expectError , true ) ;
}
2020-11-15 13:15:07 +00:00
private void assertError ( String kcFile , String expectError , boolean expectSource ) throws IOException , URISyntaxException {
2017-12-03 16:01:23 +00:00
try {
2017-12-03 21:57:54 +00:00
compileAndCompare ( kcFile ) ;
2018-04-22 07:59:08 +00:00
} catch ( CompileError e ) {
2020-11-15 13:15:07 +00:00
final String error = e . format ( ) ;
System . out . println ( " Got error: " + error ) ;
2017-12-03 16:01:23 +00:00
// expecting error!
2020-11-15 13:15:07 +00:00
assertTrue ( error . contains ( expectError ) , " Error message expected ' " + expectError + " ' - was: " + error ) ;
if ( expectSource ) {
2020-11-08 19:45:22 +00:00
// expecting a source for the error, so it may be related back to a file/line
2020-11-15 13:15:07 +00:00
assertNotNull ( e . getSource ( ) , " Error source expected " ) ;
assertNotNull ( e . getSource ( ) . getFileName ( ) , " Error file name expected " ) ;
assertNotNull ( e . getSource ( ) . getLineNumber ( ) , " Error line number expected " ) ;
assertNotNull ( e . getSource ( ) . getCharPosInLine ( ) , " Error charpos expected " ) ;
} else {
assertTrue ( e . getSource ( ) = = null | | e . getSource ( ) . getFileName ( ) = = null , " No error information expected " ) ;
2019-03-10 08:29:02 +00:00
}
2017-12-03 16:01:23 +00:00
return ;
}
fail ( " Expected compile error. " ) ;
}
2017-07-30 14:31:59 +00:00
private void compileAndCompare ( String filename ) throws IOException , URISyntaxException {
2017-10-29 10:41:35 +00:00
TestPrograms tester = new TestPrograms ( ) ;
2019-03-18 19:54:08 +00:00
tester . testFile ( filename , null , null ) ;
}
private void compileAndCompare ( String filename , CompileLog compileLog ) throws IOException , URISyntaxException {
TestPrograms tester = new TestPrograms ( ) ;
tester . testFile ( filename , null , compileLog ) ;
2017-07-30 14:31:59 +00:00
}
2017-07-28 01:08:19 +00:00
2018-09-26 20:01:15 +00:00
private void compileAndCompare ( String filename , int upliftCombinations ) throws IOException , URISyntaxException {
TestPrograms tester = new TestPrograms ( ) ;
2019-03-18 19:54:08 +00:00
tester . testFile ( filename , upliftCombinations , null ) ;
2018-09-26 20:01:15 +00:00
}
2019-10-19 21:08:30 +00:00
private void compileAndCompare ( String filename , int upliftCombinations , CompileLog log ) throws IOException , URISyntaxException {
2019-03-20 16:09:22 +00:00
TestPrograms tester = new TestPrograms ( ) ;
tester . testFile ( filename , upliftCombinations , log ) ;
}
2019-10-03 08:29:58 +00:00
private void testFile ( String fileName , Integer upliftCombinations , CompileLog compileLog ) throws IOException {
2017-12-02 15:35:13 +00:00
System . out . println ( " Testing output for " + fileName ) ;
2017-07-15 20:00:02 +00:00
Compiler compiler = new Compiler ( ) ;
2019-10-05 06:29:28 +00:00
compiler . setWarnFragmentMissing ( true ) ;
2019-09-08 13:28:33 +00:00
compiler . setAsmFragmentBaseFolder ( new File ( " src/main/fragment/ " ) . toPath ( ) ) ;
2019-08-27 11:26:55 +00:00
if ( compileLog ! = null ) {
2019-03-18 19:54:08 +00:00
compiler . setLog ( compileLog ) ;
}
2020-04-11 19:15:34 +00:00
compiler . addIncludePath ( testPath ) ;
2020-05-11 00:36:37 +00:00
compiler . addIncludePath ( stdIncludePath ) ;
2020-04-11 19:15:34 +00:00
compiler . addLibraryPath ( stdLibPath ) ;
2020-05-11 00:36:37 +00:00
compiler . addTargetPlatformPath ( stdPlatformPath ) ;
2018-09-30 23:14:59 +00:00
if ( upliftCombinations ! = null ) {
2018-09-26 20:01:15 +00:00
compiler . setUpliftCombinations ( upliftCombinations ) ;
}
2020-04-11 11:03:36 +00:00
final ArrayList < Path > files = new ArrayList < > ( ) ;
final Path filePath = Paths . get ( fileName ) ;
files . add ( filePath ) ;
2020-04-11 11:41:10 +00:00
Program program = compiler . getProgram ( ) ;
2020-06-01 23:56:23 +00:00
// Initialize the master ASM fragment synthesizer
2020-06-02 21:28:32 +00:00
program . initAsmFragmentMasterSynthesizer ( true ) ;
2020-05-15 06:19:26 +00:00
final File platformFile = SourceLoader . loadFile ( TargetPlatform . DEFAULT_NAME + " . " + CTargetPlatformParser . FILE_EXTENSION , filePath , program . getTargetPlatformPaths ( ) ) ;
final TargetPlatform targetPlatform = CTargetPlatformParser . parseTargetPlatformFile ( TargetPlatform . DEFAULT_NAME , platformFile , filePath , program . getTargetPlatformPaths ( ) ) ;
program . setTargetPlatform ( targetPlatform ) ;
2020-05-22 13:52:51 +00:00
program . addReservedZps ( program . getTargetPlatform ( ) . getReservedZps ( ) ) ;
2020-09-28 20:25:15 +00:00
final Map < String , String > defines = new HashMap < > ( ) ;
defines . put ( " __KICKC__ " , " 1 " ) ;
defines . putAll ( program . getTargetPlatform ( ) . getDefines ( ) ) ;
compiler . compile ( files , defines ) ;
2018-02-13 02:34:01 +00:00
compileAsm ( fileName , program ) ;
2017-07-21 10:18:05 +00:00
boolean success = true ;
2018-10-07 00:31:25 +00:00
ReferenceHelper helper = new ReferenceHelperFolder ( refPath ) ;
2020-04-11 14:06:15 +00:00
String baseFileName = Compiler . removeFileNameExtension ( fileName ) ;
success & = helper . testOutput ( baseFileName , " .asm " , program . getAsm ( ) . toString ( new AsmProgram . AsmPrintState ( false , true , false , false ) , program ) ) ;
2020-06-27 19:18:00 +00:00
success & = helper . testOutput ( baseFileName , " .sym " , program . getScope ( ) . toString ( program , false ) ) ;
success & = helper . testOutput ( baseFileName , " .cfg " , program . getGraph ( ) . toString ( program ) ) ;
success & = helper . testOutput ( baseFileName , " .log " , program . getLog ( ) . toString ( ) ) ;
2018-04-22 07:59:08 +00:00
if ( ! success ) {
2020-12-09 11:18:07 +00:00
// System.out.println("\nCOMPILE LOG");
// System.out.println(program.getLog().toString());
2017-07-21 10:18:05 +00:00
fail ( " Output does not match reference! " ) ;
}
2020-06-01 23:56:23 +00:00
// Save the ASM fragment caches (if there are any changes)
compiler . getAsmFragmentMasterSynthesizer ( ) . finalize ( program . getLog ( ) ) ;
2017-07-15 20:00:02 +00:00
}
2018-02-13 02:34:01 +00:00
private void compileAsm ( String fileName , Program program ) throws IOException {
2020-04-11 14:06:15 +00:00
String baseFileName = Compiler . removeFileNameExtension ( fileName ) ;
writeBinFile ( baseFileName , " .asm " , program . getAsm ( ) . toString ( new AsmProgram . AsmPrintState ( false ) , program ) ) ;
2018-07-07 17:23:38 +00:00
for ( Path asmResourceFile : program . getAsmResourceFiles ( ) ) {
2020-04-11 14:06:15 +00:00
File asmFile = getBinFile ( baseFileName , " .asm " ) ;
2018-09-30 23:14:59 +00:00
String asmFolder = asmFile . getParent ( ) ;
File resFile = new File ( asmFolder , asmResourceFile . getFileName ( ) . toString ( ) ) ;
mkPath ( resFile ) ;
2018-07-09 16:39:01 +00:00
try {
2018-09-30 23:14:59 +00:00
Files . copy ( asmResourceFile , resFile . toPath ( ) ) ;
2018-07-09 16:39:01 +00:00
} catch ( FileAlreadyExistsException e ) {
// Ignore this
}
}
2018-07-07 17:23:38 +00:00
2020-04-11 14:06:15 +00:00
File asmFile = getBinFile ( baseFileName , " .asm " ) ;
File asmPrgFile = getBinFile ( baseFileName , " .prg " ) ;
File asmLogFile = getBinFile ( baseFileName , " .log " ) ;
2018-02-13 02:34:01 +00:00
ByteArrayOutputStream kickAssOut = new ByteArrayOutputStream ( ) ;
System . setOut ( new PrintStream ( kickAssOut ) ) ;
2019-07-07 15:54:06 +00:00
int asmRes = - 1 ;
try {
2019-08-03 11:32:34 +00:00
CharToPetsciiConverter . setCurrentEncoding ( " screencode_mixed " ) ;
2020-07-26 00:25:33 +00:00
asmRes = KickAssembler65CE02 . main2 ( new String [ ] { asmFile . getAbsolutePath ( ) , " -log " , asmLogFile . getAbsolutePath ( ) , " -o " , asmPrgFile . getAbsolutePath ( ) , " -vicesymbols " , " -showmem " , " -bytedump " } ) ;
2019-07-07 15:54:06 +00:00
} catch ( Throwable e ) {
fail ( " KickAssembling file failed! " + e . getMessage ( ) ) ;
} finally {
System . setOut ( new PrintStream ( new FileOutputStream ( FileDescriptor . out ) ) ) ;
}
2018-04-22 07:59:08 +00:00
if ( asmRes ! = 0 ) {
fail ( " KickAssembling file failed! " + kickAssOut . toString ( ) ) ;
2018-02-13 02:34:01 +00:00
}
}
public File writeBinFile ( String fileName , String extension , String outputString ) throws IOException {
// Write output file
File file = getBinFile ( fileName , extension ) ;
FileOutputStream outputStream = new FileOutputStream ( file ) ;
OutputStreamWriter writer = new OutputStreamWriter ( outputStream ) ;
writer . write ( outputString ) ;
writer . close ( ) ;
outputStream . close ( ) ;
System . out . println ( " ASM written to " + file . getAbsolutePath ( ) ) ;
return file ;
}
public File getBinFile ( String fileName , String extension ) {
2018-09-30 23:14:59 +00:00
File binFile = new File ( getBinDir ( ) , fileName + extension ) ;
mkPath ( binFile ) ;
return binFile ;
2018-02-13 02:34:01 +00:00
}
2018-09-30 23:14:59 +00:00
/ * *
* Ensures that the path to the passed file is created .
2018-12-25 21:46:58 +00:00
*
2018-09-30 23:14:59 +00:00
* @param file The file to create a path for
* /
2019-07-15 07:47:47 +00:00
private static void mkPath ( File file ) {
2018-09-30 23:14:59 +00:00
Path parent = file . toPath ( ) . getParent ( ) ;
File dir = parent . toFile ( ) ;
if ( ! dir . exists ( ) ) {
mkPath ( dir ) ;
dir . mkdir ( ) ;
}
2018-07-07 17:23:38 +00:00
}
2019-07-15 07:47:47 +00:00
public static File getBinDir ( ) {
2018-10-07 00:31:25 +00:00
Path tempDir = ReferenceHelper . getTempDir ( ) ;
2018-02-13 02:34:01 +00:00
File binDir = new File ( tempDir . toFile ( ) , " bin " ) ;
if ( ! binDir . exists ( ) ) {
binDir . mkdir ( ) ;
}
return binDir ;
}
2019-07-15 07:47:47 +00:00
public static File getFragmentCacheDir ( ) {
Path tempDir = ReferenceHelper . getTempDir ( ) ;
File binDir = new File ( tempDir . toFile ( ) , " cache " ) ;
if ( ! binDir . exists ( ) ) {
binDir . mkdir ( ) ;
}
return binDir ;
}
2018-11-07 22:45:29 +00:00
2017-07-15 20:00:02 +00:00
}