From f8fc001971f5ed641cb42ad1a9f5994767395b20 Mon Sep 17 00:00:00 2001 From: Karol Stasiak Date: Sun, 15 Dec 2019 23:48:22 +0100 Subject: [PATCH] 6809: Enable and fix more tests --- src/test/scala/millfork/test/BitOpSuite.scala | 16 ++-- .../test/BooleanOptimizationSuite.scala | 2 +- .../millfork/test/BreakContinueSuite.scala | 12 +-- src/test/scala/millfork/test/CmosSuite.scala | 6 +- .../scala/millfork/test/ComparisonSuite.scala | 74 ++++++++++++------- .../scala/millfork/test/ConstantSuite.scala | 2 +- src/test/scala/millfork/test/DerefSuite.scala | 6 +- src/test/scala/millfork/test/ShiftSuite.scala | 4 +- 8 files changed, 73 insertions(+), 49 deletions(-) diff --git a/src/test/scala/millfork/test/BitOpSuite.scala b/src/test/scala/millfork/test/BitOpSuite.scala index 15143c12..bf08c252 100644 --- a/src/test/scala/millfork/test/BitOpSuite.scala +++ b/src/test/scala/millfork/test/BitOpSuite.scala @@ -10,7 +10,7 @@ import org.scalatest.{FunSuite, Matchers} class BitOpSuite extends FunSuite with Matchers { test("Word AND") { - EmuCrossPlatformBenchmarkRun(Cpu.Mos, Cpu.Z80, Cpu.Intel8080, Cpu.Sharp, Cpu.Intel8086)(""" + EmuCrossPlatformBenchmarkRun(Cpu.Mos, Cpu.Z80, Cpu.Intel8080, Cpu.Sharp, Cpu.Intel8086, Cpu.Motorola6809)(""" | word output @$c000 | void main () { | byte b @@ -36,7 +36,7 @@ class BitOpSuite extends FunSuite with Matchers { } test("Smart bit set/reset") { - EmuCrossPlatformBenchmarkRun(Cpu.Cmos, Cpu.Z80, Cpu.Intel8080, Cpu.Sharp, Cpu.Intel8086)(""" + EmuCrossPlatformBenchmarkRun(Cpu.Cmos, Cpu.Z80, Cpu.Intel8080, Cpu.Sharp, Cpu.Intel8086, Cpu.Motorola6809)(""" | byte output @$c000 | void main () { | output = 5 @@ -46,21 +46,21 @@ class BitOpSuite extends FunSuite with Matchers { | output |= 2 | } | noinline void barrier() { } - """.stripMargin)(_.readLong(0xc000) should equal(6)) + """.stripMargin)(_.readByte(0xc000) should equal(6)) } test("Smart bit set/reset 2") { - EmuCrossPlatformBenchmarkRun(Cpu.Cmos, Cpu.Z80, Cpu.Intel8080, Cpu.Sharp, Cpu.Intel8086)(""" + EmuCrossPlatformBenchmarkRun(Cpu.Cmos, Cpu.Z80, Cpu.Intel8080, Cpu.Sharp, Cpu.Intel8086, Cpu.Motorola6809)(""" | byte output @$c000 | void main () { | output = 5 | output &= 0xfe | output |= 2 | } - """.stripMargin)(_.readLong(0xc000) should equal(6)) + """.stripMargin)(_.readByte(0xc000) should equal(6)) } test("Word AND 2") { - EmuCrossPlatformBenchmarkRun(Cpu.Mos, Cpu.Z80, Cpu.Intel8080, Cpu.Sharp, Cpu.Intel8086)(""" + EmuCrossPlatformBenchmarkRun(Cpu.Mos, Cpu.Z80, Cpu.Intel8080, Cpu.Sharp, Cpu.Intel8086, Cpu.Motorola6809)(""" | word output @$c000 | void main () { | word v, w @@ -87,11 +87,11 @@ class BitOpSuite extends FunSuite with Matchers { | } | """.stripMargin - EmuCrossPlatformBenchmarkRun(Cpu.Mos, Cpu.Z80)(code)(_.readByte(0xc000) should equal(2)) + EmuCrossPlatformBenchmarkRun(Cpu.Mos, Cpu.Z80, Cpu.Motorola6809)(code)(_.readByte(0xc000) should equal(2)) } test("Multiple words") { - EmuCrossPlatformBenchmarkRun(Cpu.Mos, Cpu.Z80, Cpu.Intel8080, Cpu.Sharp, Cpu.Intel8086)(""" + EmuCrossPlatformBenchmarkRun(Cpu.Mos, Cpu.Z80, Cpu.Intel8080, Cpu.Sharp, Cpu.Intel8086, Cpu.Motorola6809)(""" | word output @$c000 | void main () { | word v, w diff --git a/src/test/scala/millfork/test/BooleanOptimizationSuite.scala b/src/test/scala/millfork/test/BooleanOptimizationSuite.scala index c2ca4f06..cc8578b6 100644 --- a/src/test/scala/millfork/test/BooleanOptimizationSuite.scala +++ b/src/test/scala/millfork/test/BooleanOptimizationSuite.scala @@ -10,7 +10,7 @@ import org.scalatest.{FunSuite, Matchers} class BooleanOptimizationSuite extends FunSuite with Matchers { test("Cases") { - EmuCrossPlatformBenchmarkRun(Cpu.Mos)( + EmuCrossPlatformBenchmarkRun(Cpu.Mos, Cpu.Z80, Cpu.Motorola6809)( """ | noinline bool f1(byte a) = a & 1 != 0 | noinline bool f2(byte a) = a & 4 != 4 diff --git a/src/test/scala/millfork/test/BreakContinueSuite.scala b/src/test/scala/millfork/test/BreakContinueSuite.scala index e76135ef..e4c69d18 100644 --- a/src/test/scala/millfork/test/BreakContinueSuite.scala +++ b/src/test/scala/millfork/test/BreakContinueSuite.scala @@ -10,7 +10,7 @@ import org.scalatest.{FunSuite, Matchers} class BreakContinueSuite extends FunSuite with Matchers { test("Break from one-iteration loop 1") { - EmuCrossPlatformBenchmarkRun(Cpu.Mos, Cpu.Z80, Cpu.Intel8080, Cpu.Sharp, Cpu.Intel8086)( + EmuCrossPlatformBenchmarkRun(Cpu.Mos, Cpu.Z80, Cpu.Intel8080, Cpu.Sharp, Cpu.Intel8086, Cpu.Motorola6809)( """ | byte output @$c000 | void main () { @@ -24,7 +24,7 @@ class BreakContinueSuite extends FunSuite with Matchers { } test("Break from one-iteration loop 2") { - EmuCrossPlatformBenchmarkRun(Cpu.Mos, Cpu.Z80, Cpu.Intel8080, Cpu.Sharp, Cpu.Intel8086)( + EmuCrossPlatformBenchmarkRun(Cpu.Mos, Cpu.Z80, Cpu.Intel8080, Cpu.Sharp, Cpu.Intel8086, Cpu.Motorola6809)( """ | byte output @$c000 | void main () { @@ -39,7 +39,7 @@ class BreakContinueSuite extends FunSuite with Matchers { } test("Break from infinite loop 1") { - EmuCrossPlatformBenchmarkRun(Cpu.Mos, Cpu.Z80, Cpu.Intel8080, Cpu.Sharp, Cpu.Intel8086)( + EmuCrossPlatformBenchmarkRun(Cpu.Mos, Cpu.Z80, Cpu.Intel8080, Cpu.Sharp, Cpu.Intel8086, Cpu.Motorola6809)( """ | byte output @$c000 | void main () { @@ -54,7 +54,7 @@ class BreakContinueSuite extends FunSuite with Matchers { } test("Break and continue from infinite loop 1") { - EmuCrossPlatformBenchmarkRun(Cpu.Mos, Cpu.Z80, Cpu.Intel8080, Cpu.Sharp, Cpu.Intel8086)( + EmuCrossPlatformBenchmarkRun(Cpu.Mos, Cpu.Z80, Cpu.Intel8080, Cpu.Sharp, Cpu.Intel8086, Cpu.Motorola6809)( """ | byte output @$c000 | void main () { @@ -70,7 +70,7 @@ class BreakContinueSuite extends FunSuite with Matchers { } test("Nested break") { - EmuCrossPlatformBenchmarkRun(Cpu.Mos, Cpu.Z80, Cpu.Intel8080, Cpu.Sharp, Cpu.Intel8086)( + EmuCrossPlatformBenchmarkRun(Cpu.Mos, Cpu.Z80, Cpu.Intel8080, Cpu.Sharp, Cpu.Intel8086, Cpu.Motorola6809)( """ | byte output @$c000 | void main () { @@ -87,7 +87,7 @@ class BreakContinueSuite extends FunSuite with Matchers { } test("Continue in for loop 1") { - EmuCrossPlatformBenchmarkRun(Cpu.Mos, Cpu.Z80, Cpu.Intel8080, Cpu.Sharp, Cpu.Intel8086)( + EmuCrossPlatformBenchmarkRun(Cpu.Mos, Cpu.Z80, Cpu.Intel8080, Cpu.Sharp, Cpu.Intel8086, Cpu.Motorola6809)( """ | byte output @$c000 | byte counter @$c001 diff --git a/src/test/scala/millfork/test/CmosSuite.scala b/src/test/scala/millfork/test/CmosSuite.scala index 2a4a36c7..6850082f 100644 --- a/src/test/scala/millfork/test/CmosSuite.scala +++ b/src/test/scala/millfork/test/CmosSuite.scala @@ -10,7 +10,7 @@ import org.scalatest.{FunSuite, Matchers} class CmosSuite extends FunSuite with Matchers { test("Zero store 1") { - EmuCrossPlatformBenchmarkRun(Cpu.Cmos, Cpu.Z80, Cpu.Intel8080, Cpu.Sharp)(""" + EmuCrossPlatformBenchmarkRun(Cpu.Cmos, Cpu.Z80, Cpu.Intel8080, Cpu.Sharp, Cpu.Motorola6809)(""" | word output @$c000 | void main () { | output = 1 @@ -19,7 +19,7 @@ class CmosSuite extends FunSuite with Matchers { """.stripMargin)(_.readWord(0xc000) should equal(0)) } test("Zero store 2") { - EmuCrossPlatformBenchmarkRun(Cpu.Cmos, Cpu.Z80, Cpu.Intel8080, Cpu.Sharp)(""" + EmuCrossPlatformBenchmarkRun(Cpu.Cmos, Cpu.Z80, Cpu.Intel8080, Cpu.Sharp, Cpu.Motorola6809)(""" | byte output @$c000 | void main () { | output = 1 @@ -27,6 +27,6 @@ class CmosSuite extends FunSuite with Matchers { | output += 1 | output <<= 1 | } - """.stripMargin)(_.readWord(0xc000) should equal(2)) + """.stripMargin)(_.readByte(0xc000) should equal(2)) } } diff --git a/src/test/scala/millfork/test/ComparisonSuite.scala b/src/test/scala/millfork/test/ComparisonSuite.scala index 8598a690..3a1bd2bf 100644 --- a/src/test/scala/millfork/test/ComparisonSuite.scala +++ b/src/test/scala/millfork/test/ComparisonSuite.scala @@ -10,7 +10,7 @@ import org.scalatest.{FunSuite, Matchers} class ComparisonSuite extends FunSuite with Matchers { test("Equality and inequality") { - EmuCrossPlatformBenchmarkRun(Cpu.Mos, Cpu.Z80, Cpu.Intel8080, Cpu.Sharp, Cpu.Intel8086)( + EmuCrossPlatformBenchmarkRun(Cpu.Mos, Cpu.Z80, Cpu.Intel8080, Cpu.Sharp, Cpu.Intel8086, Cpu.Motorola6809)( """ | byte output @$c000 | void main () { @@ -28,7 +28,7 @@ class ComparisonSuite extends FunSuite with Matchers { } test("Less") { - EmuCrossPlatformBenchmarkRun(Cpu.Mos, Cpu.Z80, Cpu.Intel8080, Cpu.Sharp, Cpu.Intel8086)( + EmuCrossPlatformBenchmarkRun(Cpu.Mos, Cpu.Z80, Cpu.Intel8080, Cpu.Sharp, Cpu.Intel8086, Cpu.Motorola6809)( """ | byte output @$c000 | void main () { @@ -41,7 +41,7 @@ class ComparisonSuite extends FunSuite with Matchers { } test("Compare to zero") { - EmuCrossPlatformBenchmarkRun(Cpu.Mos, Cpu.Z80, Cpu.Intel8080, Cpu.Sharp, Cpu.Intel8086)( + EmuCrossPlatformBenchmarkRun(Cpu.Mos, Cpu.Z80, Cpu.Intel8080, Cpu.Sharp, Cpu.Intel8086, Cpu.Motorola6809)( """ | byte output @$c000 | void main () { @@ -76,7 +76,7 @@ class ComparisonSuite extends FunSuite with Matchers { } test("Does it even work") { - EmuCrossPlatformBenchmarkRun(Cpu.Mos, Cpu.Z80, Cpu.Intel8080, Cpu.Sharp, Cpu.Intel8086)( + EmuCrossPlatformBenchmarkRun(Cpu.Mos, Cpu.Z80, Cpu.Intel8080, Cpu.Sharp, Cpu.Intel8086, Cpu.Motorola6809)( """ | word output @$c000 | void main () { @@ -99,7 +99,9 @@ class ComparisonSuite extends FunSuite with Matchers { | if 2222 == 3333 { output -= 1 } | } """.stripMargin - EmuCrossPlatformBenchmarkRun(Cpu.Mos, Cpu.Z80, Cpu.Intel8080, Cpu.Sharp, Cpu.Intel8086)(src)(_.readByte(0xc000) should equal(src.count(_ == '+'))) + EmuCrossPlatformBenchmarkRun(Cpu.Mos, Cpu.Z80, Cpu.Intel8080, Cpu.Sharp, Cpu.Intel8086, Cpu.Motorola6809)(src) { m => + m.readByte(0xc000) should equal(src.count(_ == '+')) + } } test("Word comparison == and !=") { @@ -122,7 +124,9 @@ class ComparisonSuite extends FunSuite with Matchers { | if a != 0 { output += 1 } | } """.stripMargin - EmuCrossPlatformBenchmarkRun(Cpu.Mos, Cpu.Z80, Cpu.Intel8080, Cpu.Sharp, Cpu.Intel8086)(src)(_.readByte(0xc000) should equal(src.count(_ == '+'))) + EmuCrossPlatformBenchmarkRun(Cpu.Mos, Cpu.Z80, Cpu.Intel8080, Cpu.Sharp, Cpu.Intel8086, Cpu.Motorola6809)(src){ m => + m.readByte(0xc000) should equal(src.count(_ == '+')) + } } test("Word comparison <=") { @@ -143,7 +147,9 @@ class ComparisonSuite extends FunSuite with Matchers { | if a <= c { output += 1 } | } """.stripMargin - EmuCrossPlatformBenchmarkRun(Cpu.Mos, Cpu.Z80, Cpu.Intel8080, Cpu.Sharp, Cpu.Intel8086)(src)(_.readByte(0xc000) should equal(src.count(_ == '+'))) + EmuCrossPlatformBenchmarkRun(Cpu.Mos, Cpu.Z80, Cpu.Intel8080, Cpu.Sharp, Cpu.Intel8086, Cpu.Motorola6809)(src){m => + m.readByte(0xc000) should equal(src.count(_ == '+')) + } } test("Word comparison <") { val src = @@ -162,7 +168,9 @@ class ComparisonSuite extends FunSuite with Matchers { | if a < 257 { output += 1 } | } """.stripMargin - EmuCrossPlatformBenchmarkRun(Cpu.Mos, Cpu.Z80, Cpu.Intel8080, Cpu.Sharp, Cpu.Intel8086)(src)(_.readByte(0xc000) should equal(src.count(_ == '+'))) + EmuCrossPlatformBenchmarkRun(Cpu.Mos, Cpu.Z80, Cpu.Intel8080, Cpu.Sharp, Cpu.Intel8086, Cpu.Motorola6809)(src){m => + m.readByte(0xc000) should equal(src.count(_ == '+')) + } } @@ -183,7 +191,9 @@ class ComparisonSuite extends FunSuite with Matchers { | if c > 0 { output += 1 } | } """.stripMargin - EmuCrossPlatformBenchmarkRun(Cpu.Mos, Cpu.Z80, Cpu.Intel8080, Cpu.Sharp, Cpu.Intel8086)(src)(_.readByte(0xc000) should equal(src.count(_ == '+'))) + EmuCrossPlatformBenchmarkRun(Cpu.Mos, Cpu.Z80, Cpu.Intel8080, Cpu.Sharp, Cpu.Intel8086, Cpu.Motorola6809)(src){m => + m.readByte(0xc000) should equal(src.count(_ == '+')) } + } test("Word comparison >=") { @@ -206,7 +216,9 @@ class ComparisonSuite extends FunSuite with Matchers { | if a >= 0 { output += 1 } | } """.stripMargin - EmuCrossPlatformBenchmarkRun(Cpu.Mos, Cpu.Z80, Cpu.Intel8080, Cpu.Sharp, Cpu.Intel8086)(src)(_.readByte(0xc000) should equal(src.count(_ == '+'))) + EmuCrossPlatformBenchmarkRun(Cpu.Mos, Cpu.Z80, Cpu.Intel8080, Cpu.Sharp, Cpu.Intel8086, Cpu.Motorola6809)(src){m => + m.readByte(0xc000) should equal(src.count(_ == '+')) + } } test("Signed comparison >=") { @@ -229,7 +241,9 @@ class ComparisonSuite extends FunSuite with Matchers { | if a >= 0 { output += 1 } | } """.stripMargin - EmuCrossPlatformBenchmarkRun(Cpu.Mos, Cpu.Z80, Cpu.Intel8080, Cpu.Sharp, Cpu.Intel8086)(src)(_.readByte(0xc000) should equal(src.count(_ == '+'))) + EmuCrossPlatformBenchmarkRun(Cpu.Mos, Cpu.Z80, Cpu.Intel8080, Cpu.Sharp, Cpu.Intel8086, Cpu.Motorola6809)(src){m => + m.readByte(0xc000) should equal(src.count(_ == '+')) + } } test("Signed comparison with overflow") { @@ -263,7 +277,9 @@ class ComparisonSuite extends FunSuite with Matchers { | if c > -1 { output += 1 } | } """.stripMargin - EmuCrossPlatformBenchmarkRun(Cpu.Mos, Cpu.Z80, Cpu.Intel8080, Cpu.Sharp, Cpu.Intel8086)(src)(_.readByte(0xc000) should equal(src.count(_ == '+'))) + EmuCrossPlatformBenchmarkRun(Cpu.Mos, Cpu.Z80, Cpu.Intel8080, Cpu.Sharp, Cpu.Intel8086, Cpu.Motorola6809)(src){m => + m.readByte(0xc000) should equal(src.count(_ == '+')) + } } test("Signed comparison < and <=") { @@ -295,11 +311,13 @@ class ComparisonSuite extends FunSuite with Matchers { | if c <= -1 { output -= 7 } | } """.stripMargin - EmuCrossPlatformBenchmarkRun(Cpu.Mos, Cpu.Z80, Cpu.Intel8080, Cpu.Sharp, Cpu.Intel8086)(src)(_.readByte(0xc000) should equal(src.count(_ == '+'))) + EmuCrossPlatformBenchmarkRun(Cpu.Mos, Cpu.Z80, Cpu.Intel8080, Cpu.Sharp, Cpu.Intel8086, Cpu.Motorola6809)(src){m => + m.readByte(0xc000) should equal(src.count(_ == '+')) + } } test("Multiple params for equality") { - EmuCrossPlatformBenchmarkRun(Cpu.Mos, Cpu.Z80, Cpu.Intel8080, Cpu.Sharp, Cpu.Intel8086)( + EmuCrossPlatformBenchmarkRun(Cpu.Mos, Cpu.Z80, Cpu.Intel8080, Cpu.Sharp, Cpu.Intel8086, Cpu.Motorola6809)( """ | byte output @$c000 | void main () { @@ -315,7 +333,7 @@ class ComparisonSuite extends FunSuite with Matchers { } test("Multiple params for inequality") { - EmuCrossPlatformBenchmarkRun(Cpu.Mos, Cpu.Z80, Cpu.Intel8080, Cpu.Sharp, Cpu.Intel8086)( + EmuCrossPlatformBenchmarkRun(Cpu.Mos, Cpu.Z80, Cpu.Intel8080, Cpu.Sharp, Cpu.Intel8086, Cpu.Motorola6809)( """ | byte output @$c000 | void main () { @@ -331,7 +349,7 @@ class ComparisonSuite extends FunSuite with Matchers { } test("Warnings") { - EmuCrossPlatformBenchmarkRun(Cpu.Mos, Cpu.Z80, Cpu.Intel8080, Cpu.Sharp, Cpu.Intel8086)( + EmuCrossPlatformBenchmarkRun(Cpu.Mos, Cpu.Z80, Cpu.Intel8080, Cpu.Sharp, Cpu.Intel8086, Cpu.Motorola6809)( """ | byte output @$c000 | void main () { @@ -373,7 +391,9 @@ class ComparisonSuite extends FunSuite with Matchers { | if c > 335444 { output += 1 } | } """.stripMargin - EmuCrossPlatformBenchmarkRun(Cpu.Mos, Cpu.Z80, Cpu.Intel8080, Cpu.Sharp, Cpu.Intel8086)(src)(_.readByte(0xc000) should equal(src.count(_ == '+'))) + EmuCrossPlatformBenchmarkRun(Cpu.Mos, Cpu.Z80, Cpu.Intel8080, Cpu.Sharp, Cpu.Intel8086)(src){m => + m.readByte(0xc000) should equal(src.count(_ == '+')) + } } test("Mixed type comparison") { @@ -391,7 +411,9 @@ class ComparisonSuite extends FunSuite with Matchers { | if x < z { output += 1 } | } """.stripMargin - EmuCrossPlatformBenchmarkRun(Cpu.Mos, Cpu.Z80, Cpu.Intel8080, Cpu.Sharp, Cpu.Intel8086)(src)(_.readByte(0xc000) should equal(1)) + EmuCrossPlatformBenchmarkRun(Cpu.Mos, Cpu.Z80, Cpu.Intel8080, Cpu.Sharp, Cpu.Intel8086, Cpu.Motorola6809)(src){m => + m.readByte(0xc000) should equal(1) + } } test("Compare beyond 2.2") { @@ -419,7 +441,7 @@ class ComparisonSuite extends FunSuite with Matchers { } test("Compare to $ffff") { - EmuCrossPlatformBenchmarkRun(Cpu.Mos, Cpu.Z80, Cpu.Intel8086)( + EmuCrossPlatformBenchmarkRun(Cpu.Mos, Cpu.Z80, Cpu.Intel8086, Cpu.Motorola6809)( """ | byte output @$c000 | void main() { @@ -439,7 +461,7 @@ class ComparisonSuite extends FunSuite with Matchers { } test("Compare to 0") { - EmuCrossPlatformBenchmarkRun(Cpu.Mos, Cpu.Z80, Cpu.Intel8086)( + EmuCrossPlatformBenchmarkRun(Cpu.Mos, Cpu.Z80, Cpu.Intel8086, Cpu.Motorola6809)( """ | byte output @$c000 | void main() { @@ -459,7 +481,7 @@ class ComparisonSuite extends FunSuite with Matchers { } test("Signed compare to 0") { - EmuCrossPlatformBenchmarkRun(Cpu.Mos, Cpu.Z80, Cpu.Intel8086)( + EmuCrossPlatformBenchmarkRun(Cpu.Mos, Cpu.Z80, Cpu.Intel8086, Cpu.Motorola6809)( """ | byte output @$c000 | void main() { @@ -477,7 +499,7 @@ class ComparisonSuite extends FunSuite with Matchers { } test("Signed compare to 1") { - EmuCrossPlatformBenchmarkRun(Cpu.Mos, Cpu.Z80, Cpu.Intel8086)( + EmuCrossPlatformBenchmarkRun(Cpu.Mos, Cpu.Z80, Cpu.Intel8086, Cpu.Motorola6809)( """ | byte output @$c000 | void main() { @@ -538,7 +560,9 @@ class ComparisonSuite extends FunSuite with Matchers { | } | noinline word id(word x) = x |""".stripMargin - EmuCrossPlatformBenchmarkRun(Cpu.Mos, Cpu.Sixteen, Cpu.Z80, Cpu.Intel8080, Cpu.Sharp)(code) {m => m.readByte(0xc000) should equal (code.count(_ == '↑'))} + EmuCrossPlatformBenchmarkRun(Cpu.Mos, Cpu.Sixteen, Cpu.Z80, Cpu.Intel8080, Cpu.Sharp)(code) {m => + m.readByte(0xc000) should equal (code.count(_ == '↑')) + } } test("Comparison optimization") { @@ -576,7 +600,7 @@ class ComparisonSuite extends FunSuite with Matchers { | if ff() >= 10 { output += 1 } // ↑ | } |""".stripMargin - EmuUnoptimizedCrossPlatformRun(Cpu.Mos, Cpu.Z80)(code) { m => + EmuUnoptimizedCrossPlatformRun(Cpu.Mos, Cpu.Z80, Cpu.Motorola6809)(code) { m => m.readByte(0xc000) should equal(code.count(_ == '↑')) } } @@ -624,7 +648,7 @@ class ComparisonSuite extends FunSuite with Matchers { | | } |""".stripMargin - EmuUnoptimizedCrossPlatformRun(Cpu.Mos, Cpu.Z80)(code) { m => + EmuUnoptimizedCrossPlatformRun(Cpu.Mos, Cpu.Z80, Cpu.Motorola6809)(code) { m => m.readByte(0xc000) should equal(code.count(_ == '↑')) } } diff --git a/src/test/scala/millfork/test/ConstantSuite.scala b/src/test/scala/millfork/test/ConstantSuite.scala index 0a1c967f..efe15d7e 100644 --- a/src/test/scala/millfork/test/ConstantSuite.scala +++ b/src/test/scala/millfork/test/ConstantSuite.scala @@ -11,7 +11,7 @@ import org.scalatest.{FunSuite, Matchers} class ConstantSuite extends FunSuite with Matchers { test("Constants should fold") { - EmuUnoptimizedCrossPlatformRun(Cpu.Mos, Cpu.Z80, Cpu.Intel8086)( + EmuUnoptimizedCrossPlatformRun(Cpu.Mos, Cpu.Z80, Cpu.Intel8086, Cpu.Motorola6809)( """ | array Sieve[4] | const byte two = 2 diff --git a/src/test/scala/millfork/test/DerefSuite.scala b/src/test/scala/millfork/test/DerefSuite.scala index bf12e46d..15bf5252 100644 --- a/src/test/scala/millfork/test/DerefSuite.scala +++ b/src/test/scala/millfork/test/DerefSuite.scala @@ -9,7 +9,7 @@ import org.scalatest.{FunSuite, Matchers} */ class DerefSuite extends FunSuite with Matchers { test("Basic deref test") { - EmuUnoptimizedCrossPlatformRun(Cpu.Mos, Cpu.Z80, Cpu.Intel8086)( + EmuUnoptimizedCrossPlatformRun(Cpu.Mos, Cpu.Z80, Cpu.Intel8086, Cpu.Motorola6809)( """ | | byte output @$c000 @@ -33,7 +33,7 @@ class DerefSuite extends FunSuite with Matchers { } test("Byte arithmetic deref test") { - EmuUnoptimizedCrossPlatformRun(Cpu.Mos, Cpu.Z80, Cpu.Intel8086)( + EmuUnoptimizedCrossPlatformRun(Cpu.Mos, Cpu.Z80, Cpu.Intel8086, Cpu.Motorola6809)( """ | | byte output1 @$c000 @@ -59,7 +59,7 @@ class DerefSuite extends FunSuite with Matchers { } test("Word arithmetic deref test") { - EmuUnoptimizedCrossPlatformRun(Cpu.Mos, Cpu.Z80, Cpu.Intel8086)( + EmuUnoptimizedCrossPlatformRun(Cpu.Mos, Cpu.Z80, Cpu.Intel8086, Cpu.Motorola6809)( """ | | word output1 @$c000 diff --git a/src/test/scala/millfork/test/ShiftSuite.scala b/src/test/scala/millfork/test/ShiftSuite.scala index 4a6c8884..b19e3c73 100644 --- a/src/test/scala/millfork/test/ShiftSuite.scala +++ b/src/test/scala/millfork/test/ShiftSuite.scala @@ -94,7 +94,7 @@ class ShiftSuite extends FunSuite with Matchers { } test("Variable shifting") { - EmuCrossPlatformBenchmarkRun(Cpu.Mos, Cpu.Z80, Cpu.Intel8080, Cpu.Sharp, Cpu.Intel8086)(""" + EmuCrossPlatformBenchmarkRun(Cpu.Mos, Cpu.Z80, Cpu.Intel8080, Cpu.Sharp, Cpu.Intel8086, Cpu.Motorola6809)(""" | word output0 @$c000 | word output2 @$c002 | byte output4 @$c004 @@ -120,7 +120,7 @@ class ShiftSuite extends FunSuite with Matchers { } test("Zero shifting") { - EmuCrossPlatformBenchmarkRun(Cpu.Mos, Cpu.Z80, Cpu.Intel8080, Cpu.Sharp, Cpu.Intel8086)(""" + EmuCrossPlatformBenchmarkRun(Cpu.Mos, Cpu.Z80, Cpu.Intel8080, Cpu.Sharp, Cpu.Intel8086, Cpu.Motorola6809)(""" | byte output0 @$c000 | byte output1 @$c001 | noinline byte sl(byte input, byte amount) {