Skip to content

Commit 5302373

Browse files
committed
Delete DottyByteCodeTest
I am giving up. This is the worst sort of blindly testing the status quo! It tests some random code and if that code has changed (because there is some optimization applied now) it fails. Great! Problem is there's no way to automatically update the code. One has to go in manually and fix the expected program including all labels! Copy pasting from the diff does not work and there's no --update-check. As long as things are like this I am afraid that bytecode tests are throwaway tests. They blindly test the status quo, and if that changes our best action is to throw away the test.
1 parent 30e131f commit 5302373

File tree

1 file changed

+0
-44
lines changed

1 file changed

+0
-44
lines changed

compiler/test/dotty/tools/backend/jvm/DottyBytecodeTests.scala

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -401,50 +401,6 @@ class TestBCode extends DottyBytecodeTest {
401401
}
402402
}
403403

404-
@Test def returnThrowInPatternMatch = {
405-
val source =
406-
"""class Test {
407-
| def test(a: Any): Int = {
408-
| a match {
409-
| case _: Test => ???
410-
| }
411-
| }
412-
|}
413-
""".stripMargin
414-
415-
checkBCode(source) { dir =>
416-
val moduleIn = dir.lookupName("Test.class", directory = false)
417-
val moduleNode = loadClassNode(moduleIn.input)
418-
val method = getMethod(moduleNode, "test")
419-
420-
val instructions = instructionsFromMethod(method)
421-
val expected = List(
422-
VarOp(ASTORE, 2)
423-
VarOp(ALOAD, 2)
424-
TypeOp(INSTANCEOF, Test)
425-
Jump(IFEQ, Label(8))
426-
Field(GETSTATIC, scala/Predef$, MODULE$, Lscala/Predef$;)
427-
Invoke(INVOKEVIRTUAL, scala/Predef$, $qmark$qmark$qmark, ()Lscala/runtime/Nothing$;, false)
428-
Op(ATHROW)
429-
Label(8)
430-
FrameEntry(1, List(java/lang/Object), List())
431-
TypeOp(NEW, scala/MatchError)
432-
Op(DUP)
433-
VarOp(ALOAD, 2)
434-
Invoke(INVOKESPECIAL, scala/MatchError, <init>, (Ljava/lang/Object;)V, false)
435-
Op(ATHROW)
436-
Label(15)
437-
FrameEntry(0, List(), List(java/lang/Throwable))
438-
Op(ATHROW)
439-
Label(18)
440-
FrameEntry(4, List(), List(java/lang/Throwable))
441-
Op(ATHROW)
442-
)
443-
assert(instructions == expected,
444-
"`test` was not properly generated\n" + diffInstructions(instructions, expected))
445-
}
446-
}
447-
448404
/** Test that type lambda applications are properly dealias */
449405
@Test def i5090 = {
450406
val source =

0 commit comments

Comments
 (0)