From b9c30c739e291b3ce946bcfcf275fe527eca1eeb Mon Sep 17 00:00:00 2001 From: Michael Bogdanov Date: Fri, 29 Jan 2016 12:13:16 +0300 Subject: [PATCH] Test for obsolete KT-7224: Redundant result boxing on ?. call on a primitive #KT-7224 Obsolete --- .../codegen/bytecodeText/boxingOptimization/kt7224.kt | 7 +++++++ .../kotlin/codegen/BytecodeTextTestGenerated.java | 6 ++++++ 2 files changed, 13 insertions(+) create mode 100644 compiler/testData/codegen/bytecodeText/boxingOptimization/kt7224.kt diff --git a/compiler/testData/codegen/bytecodeText/boxingOptimization/kt7224.kt b/compiler/testData/codegen/bytecodeText/boxingOptimization/kt7224.kt new file mode 100644 index 00000000000..ec6fa03d080 --- /dev/null +++ b/compiler/testData/codegen/bytecodeText/boxingOptimization/kt7224.kt @@ -0,0 +1,7 @@ +fun box(): String { + 230?.hashCode() + + return "OK" +} + +// 1 INVOKESTATIC java/lang/Integer.valueOf \ No newline at end of file diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/BytecodeTextTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/BytecodeTextTestGenerated.java index 7a7ed32813d..d10219e7db0 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/BytecodeTextTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/BytecodeTextTestGenerated.java @@ -376,6 +376,12 @@ public class BytecodeTextTestGenerated extends AbstractBytecodeTextTest { doTest(fileName); } + @TestMetadata("kt7224.kt") + public void testKt7224() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/bytecodeText/boxingOptimization/kt7224.kt"); + doTest(fileName); + } + @TestMetadata("nullCheck.kt") public void testNullCheck() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/bytecodeText/boxingOptimization/nullCheck.kt");