JVM: do not write trivial SMAPs to classes outside inline funs
where trivial == those that map the file to itself.
This commit is contained in:
+10
@@ -3522,6 +3522,16 @@ public class BlackBoxInlineCodegenTestGenerated extends AbstractBlackBoxInlineCo
|
||||
public void testReifiedProperty() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxInline/smap/inlineOnly/reifiedProperty.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("stdlibInlineOnly.kt")
|
||||
public void testStdlibInlineOnly() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxInline/smap/inlineOnly/stdlibInlineOnly.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("stdlibInlineOnlyOneLine.kt")
|
||||
public void testStdlibInlineOnlyOneLine() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxInline/smap/inlineOnly/stdlibInlineOnlyOneLine.kt");
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/codegen/boxInline/smap/newsmap")
|
||||
|
||||
Generated
+10
@@ -3522,6 +3522,16 @@ public class CompileKotlinAgainstInlineKotlinTestGenerated extends AbstractCompi
|
||||
public void testReifiedProperty() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxInline/smap/inlineOnly/reifiedProperty.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("stdlibInlineOnly.kt")
|
||||
public void testStdlibInlineOnly() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxInline/smap/inlineOnly/stdlibInlineOnly.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("stdlibInlineOnlyOneLine.kt")
|
||||
public void testStdlibInlineOnlyOneLine() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxInline/smap/inlineOnly/stdlibInlineOnlyOneLine.kt");
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/codegen/boxInline/smap/newsmap")
|
||||
|
||||
+10
@@ -3522,6 +3522,16 @@ public class IrBlackBoxInlineCodegenTestGenerated extends AbstractIrBlackBoxInli
|
||||
public void testReifiedProperty() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxInline/smap/inlineOnly/reifiedProperty.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("stdlibInlineOnly.kt")
|
||||
public void testStdlibInlineOnly() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxInline/smap/inlineOnly/stdlibInlineOnly.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("stdlibInlineOnlyOneLine.kt")
|
||||
public void testStdlibInlineOnlyOneLine() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxInline/smap/inlineOnly/stdlibInlineOnlyOneLine.kt");
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/codegen/boxInline/smap/newsmap")
|
||||
|
||||
Generated
+10
@@ -3522,6 +3522,16 @@ public class IrCompileKotlinAgainstInlineKotlinTestGenerated extends AbstractIrC
|
||||
public void testReifiedProperty() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxInline/smap/inlineOnly/reifiedProperty.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("stdlibInlineOnly.kt")
|
||||
public void testStdlibInlineOnly() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxInline/smap/inlineOnly/stdlibInlineOnly.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("stdlibInlineOnlyOneLine.kt")
|
||||
public void testStdlibInlineOnlyOneLine() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxInline/smap/inlineOnly/stdlibInlineOnlyOneLine.kt");
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/codegen/boxInline/smap/newsmap")
|
||||
|
||||
+1
-21
@@ -438,32 +438,12 @@ class CompileKotlinAgainstCustomBinariesTest : AbstractKotlinCompilerIntegration
|
||||
|
||||
compileKotlin("source.kt", tmpdir, listOf(tmpdir))
|
||||
|
||||
var debugInfo: String? = null
|
||||
val resultFile = File(tmpdir.absolutePath, "test/B.class")
|
||||
ClassReader(resultFile.readBytes()).accept(object : ClassVisitor(Opcodes.API_VERSION) {
|
||||
override fun visitSource(source: String?, debug: String?) {
|
||||
debugInfo = debug
|
||||
assertEquals(null, debug)
|
||||
}
|
||||
}, 0)
|
||||
|
||||
val expected = """
|
||||
SMAP
|
||||
source.kt
|
||||
Kotlin
|
||||
*S Kotlin
|
||||
*F
|
||||
+ 1 source.kt
|
||||
test/B
|
||||
*L
|
||||
1#1,13:1
|
||||
*E
|
||||
""".trimIndent() + "\n"
|
||||
|
||||
if (GENERATE_SMAP) {
|
||||
assertEquals(expected, debugInfo)
|
||||
} else {
|
||||
assertEquals(null, debugInfo)
|
||||
}
|
||||
}
|
||||
|
||||
/* Regression test for KT-37107: compile against .class file without any constructors. */
|
||||
|
||||
Reference in New Issue
Block a user