Skip to content

Commit c794429

Browse files
committed
Change default target to jvm-9 in test
1 parent ad9aaca commit c794429

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

Diff for: compiler/src/dotty/tools/backend/jvm/BCodeSkelBuilder.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ trait BCodeSkelBuilder extends BCodeHelpers {
129129
// reverse all the effects of this transformation, which would be counter-productive.
130130

131131

132-
// TODO: enable once we change lazy val encoding
132+
// TODO: enable once we change lazy val encoding (https://github.com/lampepfl/dotty/issues/7140)
133133
//
134134
// Lazy val encoding assumes bitmap fields are non-static
135135
//

Diff for: compiler/test/dotty/tools/vulpix/TestConfiguration.scala

+18-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ object TestConfiguration {
88

99
val noCheckOptions = Array(
1010
"-pagewidth", "120",
11-
"-color:never"
11+
"-color:never",
12+
"-target", defaultTarget
1213
)
1314

1415
val checkOptions = Array(
@@ -76,4 +77,20 @@ object TestConfiguration {
7677

7778
/** Enables explicit nulls */
7879
val explicitNullsOptions = defaultOptions and "-Yexplicit-nulls"
80+
81+
/** Default target of the generated class files */
82+
private def defaultTarget: String = {
83+
val javaVersion: Int =
84+
if (Properties.javaVersion.startsWith("1.")) {
85+
Properties.javaVersion.substring(2, 3).toInt
86+
}
87+
else {
88+
val dot = Properties.javaVersion.indexOf(".")
89+
assert(dot != -1, "unknown java version: " + Properties.javaVersion)
90+
Properties.javaVersion.substring(0, dot).toInt
91+
}
92+
93+
if (javaVersion < 9) "jvm-1.8"
94+
else "jvm-9"
95+
}
7996
}

0 commit comments

Comments
 (0)