[IR] Extract toString interpretation test of float value into new file
We need to distinguish `toString` results for JVM and JS
This commit is contained in:
+6
@@ -28430,6 +28430,12 @@ public class FirLightTreeBlackBoxCodegenTestGenerated extends AbstractFirLightTr
|
||||
runTest("compiler/testData/codegen/box/involvesIrInterpreter/dumpIrAndCheck/intOperations.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("jvmFloatDoubleToString.kt")
|
||||
public void testJvmFloatDoubleToString() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/involvesIrInterpreter/dumpIrAndCheck/jvmFloatDoubleToString.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kCallableName.kt")
|
||||
public void testKCallableName() throws Exception {
|
||||
|
||||
+6
@@ -28430,6 +28430,12 @@ public class FirPsiBlackBoxCodegenTestGenerated extends AbstractFirPsiBlackBoxCo
|
||||
runTest("compiler/testData/codegen/box/involvesIrInterpreter/dumpIrAndCheck/intOperations.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("jvmFloatDoubleToString.kt")
|
||||
public void testJvmFloatDoubleToString() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/involvesIrInterpreter/dumpIrAndCheck/jvmFloatDoubleToString.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kCallableName.kt")
|
||||
public void testKCallableName() throws Exception {
|
||||
|
||||
-11
@@ -87,12 +87,6 @@ const val equals2 = <!EVALUATED("true")!>twoVal == twoVal<!>
|
||||
const val equals3 = <!EVALUATED("false")!>threeVal == twoVal<!>
|
||||
const val equals4 = <!EVALUATED("false")!>fourVal == twoVal<!>
|
||||
|
||||
const val toString1 = oneVal.<!EVALUATED("1.0")!>toString()<!>
|
||||
const val toString2 = twoVal.<!EVALUATED("2.0")!>toString()<!>
|
||||
const val toString3 = oneAndAHalf.<!EVALUATED("1.5")!>toString()<!>
|
||||
|
||||
fun <T> T.id(): T = this
|
||||
|
||||
fun box(): String {
|
||||
if (<!EVALUATED("false")!>compareTo1 != -1<!>) return "Fail 1.1"
|
||||
if (<!EVALUATED("false")!>compareTo2 != 0<!>) return "Fail 1.2"
|
||||
@@ -164,10 +158,5 @@ fun box(): String {
|
||||
if (<!EVALUATED("false")!>equals3 != false<!>) return "Fail 9.3"
|
||||
if (<!EVALUATED("false")!>equals4 != false<!>) return "Fail 9.4"
|
||||
|
||||
// id is needed to avoid evaluation and so match different cases for JVM and JS
|
||||
if (<!EVALUATED("1.0")!>toString1<!>.id() != "1.0" && <!EVALUATED("1.0")!>toString1<!>.id() != "1" /* JS */) return "Fail 10.1"
|
||||
if (<!EVALUATED("2.0")!>toString2<!>.id() != "2.0" && <!EVALUATED("2.0")!>toString2<!>.id() != "2" /* JS */) return "Fail 10.2"
|
||||
if (<!EVALUATED("1.5")!>toString3<!>.id() != "1.5") return "Fail 10.3"
|
||||
|
||||
return "OK"
|
||||
}
|
||||
|
||||
-11
@@ -87,12 +87,6 @@ const val equals2 = <!EVALUATED("true")!>twoVal == twoVal<!>
|
||||
const val equals3 = <!EVALUATED("false")!>threeVal == twoVal<!>
|
||||
const val equals4 = <!EVALUATED("false")!>fourVal == twoVal<!>
|
||||
|
||||
const val toString1 = oneVal.<!EVALUATED("1.0")!>toString()<!>
|
||||
const val toString2 = twoVal.<!EVALUATED("2.0")!>toString()<!>
|
||||
const val toString3 = oneAndAHalf.<!EVALUATED("1.5")!>toString()<!>
|
||||
|
||||
fun <T> T.id(): T = this
|
||||
|
||||
fun box(): String {
|
||||
if (<!EVALUATED("false")!>compareTo1 != -1<!>) return "Fail 1.1"
|
||||
if (<!EVALUATED("false")!>compareTo2 != 0<!>) return "Fail 1.2"
|
||||
@@ -164,10 +158,5 @@ fun box(): String {
|
||||
if (<!EVALUATED("false")!>equals3 != false<!>) return "Fail 9.3"
|
||||
if (<!EVALUATED("false")!>equals4 != false<!>) return "Fail 9.4"
|
||||
|
||||
// id is needed to avoid evaluation and so match different cases for JVM and JS
|
||||
if (<!EVALUATED("1.0")!>toString1<!>.id() != "1.0" && <!EVALUATED("1.0")!>toString1<!>.id() != "1" /* JS */) return "Fail 10.1"
|
||||
if (<!EVALUATED("2.0")!>toString2<!>.id() != "2.0" && <!EVALUATED("2.0")!>toString2<!>.id() != "2" /* JS */) return "Fail 10.2"
|
||||
if (<!EVALUATED("1.5")!>toString3<!>.id() != "1.5") return "Fail 10.3"
|
||||
|
||||
return "OK"
|
||||
}
|
||||
|
||||
Vendored
+27
@@ -0,0 +1,27 @@
|
||||
// TARGET_BACKEND: JS_IR
|
||||
// IGNORE_BACKEND_K1: JS_IR, JS_IR_ES6
|
||||
|
||||
const val toStringDouble1 = 1.0.<!EVALUATED("1")!>toString()<!>
|
||||
const val toStringDouble2 = 2.0.<!EVALUATED("2")!>toString()<!>
|
||||
const val toStringDouble3 = 1.5.<!EVALUATED("1.5")!>toString()<!>
|
||||
|
||||
const val toStringFloat1 = 1.0f.<!EVALUATED("1")!>toString()<!>
|
||||
const val toStringFloat2 = 2.0f.<!EVALUATED("2")!>toString()<!>
|
||||
const val toStringFloat3 = 1.5f.<!EVALUATED("1.5")!>toString()<!>
|
||||
|
||||
fun box(): String {
|
||||
if (<!EVALUATED("false")!>toStringDouble1 != "1"<!>) return "Fail 1.1"
|
||||
if (<!EVALUATED("false")!>toStringDouble2 != "2"<!>) return "Fail 1.2"
|
||||
if (<!EVALUATED("false")!>toStringDouble3 != "1.5"<!>) return "Fail 1.3"
|
||||
|
||||
if (<!EVALUATED("false")!>toStringFloat1 != "1"<!>) return "Fail 2.1"
|
||||
if (<!EVALUATED("false")!>toStringFloat2 != "2"<!>) return "Fail 2.2"
|
||||
if (<!EVALUATED("false")!>toStringFloat3 != "1.5"<!>) return "Fail 2.3"
|
||||
|
||||
val localDoubleToString = 1.0.<!EVALUATED("1")!>toString()<!>
|
||||
val localFloatToString = 1.0f.<!EVALUATED("1")!>toString()<!>
|
||||
if (localDoubleToString != <!EVALUATED("1")!>toStringDouble1<!>) return "Fail 3.1"
|
||||
if (localFloatToString != <!EVALUATED("1")!>toStringFloat1<!>) return "Fail 3.2"
|
||||
|
||||
return "OK"
|
||||
}
|
||||
Vendored
+27
@@ -0,0 +1,27 @@
|
||||
// TARGET_BACKEND: JVM_IR
|
||||
// TARGET_BACKEND: NATIVE
|
||||
|
||||
const val toStringDouble1 = 1.0.<!EVALUATED("1.0")!>toString()<!>
|
||||
const val toStringDouble2 = 2.0.<!EVALUATED("2.0")!>toString()<!>
|
||||
const val toStringDouble3 = 1.5.<!EVALUATED("1.5")!>toString()<!>
|
||||
|
||||
const val toStringFloat1 = 1.0f.<!EVALUATED("1.0")!>toString()<!>
|
||||
const val toStringFloat2 = 2.0f.<!EVALUATED("2.0")!>toString()<!>
|
||||
const val toStringFloat3 = 1.5f.<!EVALUATED("1.5")!>toString()<!>
|
||||
|
||||
fun box(): String {
|
||||
if (<!EVALUATED("false")!>toStringDouble1 != "1.0"<!>) return "Fail 1.1"
|
||||
if (<!EVALUATED("false")!>toStringDouble2 != "2.0"<!>) return "Fail 1.2"
|
||||
if (<!EVALUATED("false")!>toStringDouble3 != "1.5"<!>) return "Fail 1.3"
|
||||
|
||||
if (<!EVALUATED("false")!>toStringFloat1 != "1.0"<!>) return "Fail 2.1"
|
||||
if (<!EVALUATED("false")!>toStringFloat2 != "2.0"<!>) return "Fail 2.2"
|
||||
if (<!EVALUATED("false")!>toStringFloat3 != "1.5"<!>) return "Fail 2.3"
|
||||
|
||||
val localDoubleToString = 1.0.<!EVALUATED("1.0")!>toString()<!>
|
||||
val localFloatToString = 1.0f.<!EVALUATED("1.0")!>toString()<!>
|
||||
if (localDoubleToString != <!EVALUATED("1.0")!>toStringDouble1<!>) return "Fail 3.1"
|
||||
if (localFloatToString != <!EVALUATED("1.0")!>toStringFloat1<!>) return "Fail 3.2"
|
||||
|
||||
return "OK"
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
// TARGET_BACKEND: JS_IR
|
||||
// IGNORE_BACKEND_K1: JS_IR, JS_IR_ES6
|
||||
|
||||
const val toStringInConst = 1.0.<!EVALUATED("1")!>toString()<!>
|
||||
|
||||
fun box(): String {
|
||||
if (<!EVALUATED("false")!>toStringInConst != "1"<!>) return "Fail 1"
|
||||
if (<!EVALUATED("false")!>1.0.toString() != toStringInConst<!>) return "Fail 2"
|
||||
return "OK"
|
||||
}
|
||||
+6
@@ -28430,6 +28430,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
|
||||
runTest("compiler/testData/codegen/box/involvesIrInterpreter/dumpIrAndCheck/intOperations.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("jvmFloatDoubleToString.kt")
|
||||
public void testJvmFloatDoubleToString() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/involvesIrInterpreter/dumpIrAndCheck/jvmFloatDoubleToString.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kCallableName.kt")
|
||||
public void testKCallableName() throws Exception {
|
||||
|
||||
+6
@@ -28430,6 +28430,12 @@ public class IrBlackBoxCodegenWithIrInlinerTestGenerated extends AbstractIrBlack
|
||||
runTest("compiler/testData/codegen/box/involvesIrInterpreter/dumpIrAndCheck/intOperations.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("jvmFloatDoubleToString.kt")
|
||||
public void testJvmFloatDoubleToString() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/involvesIrInterpreter/dumpIrAndCheck/jvmFloatDoubleToString.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kCallableName.kt")
|
||||
public void testKCallableName() throws Exception {
|
||||
|
||||
+6
-6
@@ -21085,12 +21085,6 @@ public class FirJsCodegenBoxTestGenerated extends AbstractFirJsCodegenBoxTest {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/involvesIrInterpreter"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR, true);
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("jsIrToConst.kt")
|
||||
public void testJsIrToConst() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/involvesIrInterpreter/jsIrToConst.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt55912.kt")
|
||||
public void testKt55912() throws Exception {
|
||||
@@ -21166,6 +21160,12 @@ public class FirJsCodegenBoxTestGenerated extends AbstractFirJsCodegenBoxTest {
|
||||
runTest("compiler/testData/codegen/box/involvesIrInterpreter/dumpIrAndCheck/intOperations.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("jsFloatDoubleToString.kt")
|
||||
public void testJsFloatDoubleToString() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/involvesIrInterpreter/dumpIrAndCheck/jsFloatDoubleToString.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("longOperations.kt")
|
||||
public void testLongOperations() throws Exception {
|
||||
|
||||
+6
-6
@@ -21085,12 +21085,6 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/involvesIrInterpreter"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR, true);
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("jsIrToConst.kt")
|
||||
public void testJsIrToConst() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/involvesIrInterpreter/jsIrToConst.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt55912.kt")
|
||||
public void testKt55912() throws Exception {
|
||||
@@ -21166,6 +21160,12 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
|
||||
runTest("compiler/testData/codegen/box/involvesIrInterpreter/dumpIrAndCheck/intOperations.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("jsFloatDoubleToString.kt")
|
||||
public void testJsFloatDoubleToString() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/involvesIrInterpreter/dumpIrAndCheck/jsFloatDoubleToString.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("longOperations.kt")
|
||||
public void testLongOperations() throws Exception {
|
||||
|
||||
+6
-6
@@ -21085,12 +21085,6 @@ public class IrJsES6CodegenBoxTestGenerated extends AbstractIrJsES6CodegenBoxTes
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/involvesIrInterpreter"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR_ES6, true);
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("jsIrToConst.kt")
|
||||
public void testJsIrToConst() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/involvesIrInterpreter/jsIrToConst.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt55912.kt")
|
||||
public void testKt55912() throws Exception {
|
||||
@@ -21166,6 +21160,12 @@ public class IrJsES6CodegenBoxTestGenerated extends AbstractIrJsES6CodegenBoxTes
|
||||
runTest("compiler/testData/codegen/box/involvesIrInterpreter/dumpIrAndCheck/intOperations.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("jsFloatDoubleToString.kt")
|
||||
public void testJsFloatDoubleToString() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/involvesIrInterpreter/dumpIrAndCheck/jsFloatDoubleToString.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("longOperations.kt")
|
||||
public void testLongOperations() throws Exception {
|
||||
|
||||
+6
@@ -24360,6 +24360,12 @@ public class FirNativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTe
|
||||
runTest("compiler/testData/codegen/box/involvesIrInterpreter/dumpIrAndCheck/intOperations.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("jvmFloatDoubleToString.kt")
|
||||
public void testJvmFloatDoubleToString() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/involvesIrInterpreter/dumpIrAndCheck/jvmFloatDoubleToString.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("longOperations.kt")
|
||||
public void testLongOperations() throws Exception {
|
||||
|
||||
+6
@@ -24830,6 +24830,12 @@ public class FirNativeCodegenBoxTestNoPLGenerated extends AbstractNativeCodegenB
|
||||
runTest("compiler/testData/codegen/box/involvesIrInterpreter/dumpIrAndCheck/intOperations.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("jvmFloatDoubleToString.kt")
|
||||
public void testJvmFloatDoubleToString() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/involvesIrInterpreter/dumpIrAndCheck/jvmFloatDoubleToString.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("longOperations.kt")
|
||||
public void testLongOperations() throws Exception {
|
||||
|
||||
+6
@@ -24125,6 +24125,12 @@ public class NativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTest
|
||||
runTest("compiler/testData/codegen/box/involvesIrInterpreter/dumpIrAndCheck/intOperations.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("jvmFloatDoubleToString.kt")
|
||||
public void testJvmFloatDoubleToString() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/involvesIrInterpreter/dumpIrAndCheck/jvmFloatDoubleToString.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("longOperations.kt")
|
||||
public void testLongOperations() throws Exception {
|
||||
|
||||
+6
@@ -24595,6 +24595,12 @@ public class NativeCodegenBoxTestNoPLGenerated extends AbstractNativeCodegenBoxT
|
||||
runTest("compiler/testData/codegen/box/involvesIrInterpreter/dumpIrAndCheck/intOperations.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("jvmFloatDoubleToString.kt")
|
||||
public void testJvmFloatDoubleToString() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/involvesIrInterpreter/dumpIrAndCheck/jvmFloatDoubleToString.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("longOperations.kt")
|
||||
public void testLongOperations() throws Exception {
|
||||
|
||||
Reference in New Issue
Block a user