ProperNumberComparisons is disabled by default (until LDC decision)
This commit is contained in:
@@ -3239,7 +3239,7 @@ public class ExpressionCodegen extends KtVisitor<StackValue, StackValue> impleme
|
||||
rightType = right754Type.type;
|
||||
}
|
||||
}
|
||||
else if (shouldUseProperNumberComparisons()) {
|
||||
else if (shouldUseProperIeee754Comparisons()) {
|
||||
Type comparisonType = comparisonOperandType(left754Type.type, right754Type.type);
|
||||
if (comparisonType == Type.FLOAT_TYPE || comparisonType == Type.DOUBLE_TYPE) {
|
||||
return Ieee754Equality.create(
|
||||
@@ -3453,14 +3453,14 @@ public class ExpressionCodegen extends KtVisitor<StackValue, StackValue> impleme
|
||||
TypeAndNullability right754Type = calcTypeForIeee754ArithmeticIfNeeded(right, getRightOperandType(primitiveNumericComparisonInfo));
|
||||
Callable callable = resolveToCallable((FunctionDescriptor) resolvedCall.getResultingDescriptor(), false, resolvedCall);
|
||||
boolean isSame754ArithmeticTypes = left754Type != null && right754Type != null && left754Type.type.equals(right754Type.type);
|
||||
boolean properNumberComparisons = shouldUseProperNumberComparisons();
|
||||
boolean properIeee754Comparisons = shouldUseProperIeee754Comparisons();
|
||||
|
||||
if (properNumberComparisons && left754Type != null && right754Type != null) {
|
||||
if (properIeee754Comparisons && left754Type != null && right754Type != null) {
|
||||
type = comparisonOperandType(leftType, rightType);
|
||||
leftValue = gen(left);
|
||||
rightValue = gen(right);
|
||||
}
|
||||
else if (!properNumberComparisons &&
|
||||
else if (!properIeee754Comparisons &&
|
||||
callable instanceof IntrinsicCallable && ((isPrimitive(leftType) && isPrimitive(rightType)) || isSame754ArithmeticTypes)) {
|
||||
type = isSame754ArithmeticTypes ? left754Type.type : comparisonOperandType(leftType, rightType);
|
||||
leftValue = gen(left);
|
||||
@@ -3482,7 +3482,7 @@ public class ExpressionCodegen extends KtVisitor<StackValue, StackValue> impleme
|
||||
if (expression == null) {
|
||||
return null;
|
||||
}
|
||||
else if (shouldUseProperNumberComparisons()) {
|
||||
else if (shouldUseProperIeee754Comparisons()) {
|
||||
return Ieee754Kt.calcProperTypeForIeee754ArithmeticIfNeeded(expression, bindingContext, inferredPrimitiveType, typeMapper);
|
||||
}
|
||||
else {
|
||||
@@ -3491,8 +3491,8 @@ public class ExpressionCodegen extends KtVisitor<StackValue, StackValue> impleme
|
||||
}
|
||||
}
|
||||
|
||||
private boolean shouldUseProperNumberComparisons() {
|
||||
return state.getLanguageVersionSettings().supportsFeature(LanguageFeature.ProperNumberComparisons);
|
||||
private boolean shouldUseProperIeee754Comparisons() {
|
||||
return state.getLanguageVersionSettings().supportsFeature(LanguageFeature.ProperIeee754Comparisons);
|
||||
}
|
||||
|
||||
private StackValue generateAssignmentExpression(KtBinaryExpression expression) {
|
||||
|
||||
+6
@@ -224,6 +224,12 @@ class K2JVMCompilerArguments : CommonCompilerArguments() {
|
||||
)
|
||||
var noExceptionOnExplicitEqualsForBoxedNull by FreezableVar(false)
|
||||
|
||||
@Argument(
|
||||
value = "-Xproper-ieee754-comparisons",
|
||||
description = "Generate proper IEEE 754 comparisons in all cases if values are statically known to be of primitive numeric types"
|
||||
)
|
||||
var properIeee754Comparisons by FreezableVar(false)
|
||||
|
||||
// Paths to output directories for friend modules.
|
||||
var friendPaths: Array<String>? by FreezableVar(null)
|
||||
|
||||
|
||||
@@ -235,6 +235,10 @@ class K2JVMCompiler : CLICompiler<K2JVMCompilerArguments>() {
|
||||
extraLanguageFeatures[LanguageFeature.StrictJavaNullabilityAssertions] = LanguageFeature.State.ENABLED
|
||||
}
|
||||
|
||||
if (commandLineArguments.properIeee754Comparisons) {
|
||||
extraLanguageFeatures[LanguageFeature.ProperIeee754Comparisons] = LanguageFeature.State.ENABLED
|
||||
}
|
||||
|
||||
super.setupPlatformSpecificLanguageFeatureSettings(extraLanguageFeatures, commandLineArguments)
|
||||
}
|
||||
|
||||
|
||||
+1
@@ -28,6 +28,7 @@ where advanced options include:
|
||||
-Xno-optimize Disable optimizations
|
||||
-Xno-param-assertions Don't generate not-null assertions on parameters of methods accessible from Java
|
||||
-Xno-receiver-assertions Don't generate not-null assertion for extension receiver arguments of platform types
|
||||
-Xproper-ieee754-comparisons Generate proper IEEE 754 comparisons in all cases if values are statically known to be of primitive numeric types
|
||||
-Xreport-perf Report detailed performance statistics
|
||||
-Xscript-resolver-environment=<key=value[,]>
|
||||
Script resolver environment in key-value pairs (the value could be quoted and escaped)
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
// IGNORE_BACKEND: JS
|
||||
|
||||
val minus: Any = -0.0
|
||||
|
||||
fun box(): String {
|
||||
if (minus is Double) {
|
||||
if ((minus as Comparable<Double>) >= 0.0) return "fail 0"
|
||||
if ((minus as Comparable<Double>) == 0.0) return "fail 1"
|
||||
if (minus == (0.0 as Comparable<Double>)) return "fail 2"
|
||||
if (minus == (0.0F as Comparable<Float>)) return "fail 3"
|
||||
}
|
||||
return "OK"
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
// !LANGUAGE: +ProperIeee754Comparisons
|
||||
// IGNORE_BACKEND: JS
|
||||
|
||||
val minus: Any = -0.0
|
||||
|
||||
fun box(): String {
|
||||
if (minus is Double) {
|
||||
if ((minus as Comparable<Double>) >= 0.0) return "fail 0"
|
||||
if ((minus as Comparable<Double>) == 0.0) return "fail 1"
|
||||
if (minus == (0.0 as Comparable<Double>)) return "fail 2"
|
||||
if (minus == (0.0F as Comparable<Float>)) return "fail 3"
|
||||
}
|
||||
return "OK"
|
||||
}
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// LANGUAGE_VERSION: 1.3
|
||||
// !LANGUAGE: +ProperIeee754Comparisons
|
||||
|
||||
fun less(x: Comparable<Float>, y: Float) = x is Float && x < y
|
||||
fun less(x: Comparable<Double>, y: Double) = x is Double && x < y
|
||||
+3
-3
@@ -1,4 +1,4 @@
|
||||
// LANGUAGE_VERSION: 1.3
|
||||
// !LANGUAGE: +ProperIeee754Comparisons
|
||||
|
||||
fun testF(x: Any) =
|
||||
when (x) {
|
||||
@@ -15,10 +15,10 @@ fun testD(x: Any) =
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
val tf = testF(0.0F)
|
||||
val tf = testF(-0.0F)
|
||||
if (tf != "0.0") return "Fail 1: $tf"
|
||||
|
||||
val td = testD(0.0)
|
||||
val td = testD(-0.0)
|
||||
if (td != "0.0") return "Fail 2: $td"
|
||||
|
||||
return "OK"
|
||||
+75
@@ -0,0 +1,75 @@
|
||||
// IGNORE_BACKEND: JS
|
||||
|
||||
fun eqDI(x: Any?, y: Any?) = x is Double? && y is Int? && x == y
|
||||
fun eqDL(x: Any?, y: Any?) = x is Double? && y is Long? && x == y
|
||||
fun eqID(x: Any?, y: Any?) = x is Int? && y is Double? && x == y
|
||||
fun eqLD(x: Any?, y: Any?) = x is Long? && y is Double? && x == y
|
||||
fun eqFI(x: Any?, y: Any?) = x is Float? && y is Int? && x == y
|
||||
fun eqFL(x: Any?, y: Any?) = x is Float? && y is Long? && x == y
|
||||
fun eqIF(x: Any?, y: Any?) = x is Int? && y is Float? && x == y
|
||||
fun eqLF(x: Any?, y: Any?) = x is Long? && y is Float? && x == y
|
||||
|
||||
fun testNullNull() {
|
||||
if (!eqDI(null, null)) throw Exception()
|
||||
if (!eqDL(null, null)) throw Exception()
|
||||
if (!eqID(null, null)) throw Exception()
|
||||
if (!eqLD(null, null)) throw Exception()
|
||||
if (!eqFI(null, null)) throw Exception()
|
||||
if (!eqFL(null, null)) throw Exception()
|
||||
if (!eqIF(null, null)) throw Exception()
|
||||
if (!eqLF(null, null)) throw Exception()
|
||||
}
|
||||
|
||||
fun testNull0() {
|
||||
if (eqDI(null, 0)) throw Exception()
|
||||
if (eqDL(null, 0L)) throw Exception()
|
||||
if (eqID(null, 0.0)) throw Exception()
|
||||
if (eqLD(null, 0.0)) throw Exception()
|
||||
if (eqFI(null, 0)) throw Exception()
|
||||
if (eqFL(null, 0L)) throw Exception()
|
||||
if (eqIF(null, 0.0F)) throw Exception()
|
||||
if (eqLF(null, 0.0F)) throw Exception()
|
||||
}
|
||||
|
||||
fun test0Null() {
|
||||
if (eqDI(0.0, null)) throw Exception()
|
||||
if (eqDL(0.0, null)) throw Exception()
|
||||
if (eqID(0, null)) throw Exception()
|
||||
if (eqLD(0L, null)) throw Exception()
|
||||
if (eqFI(0.0F, null)) throw Exception()
|
||||
if (eqFL(0.0F, null)) throw Exception()
|
||||
if (eqIF(0, null)) throw Exception()
|
||||
if (eqLF(0L, null)) throw Exception()
|
||||
}
|
||||
|
||||
fun testPlusMinus0() {
|
||||
if (eqDI(-0.0, 0)) throw Exception()
|
||||
if (eqDL(-0.0, 0L)) throw Exception()
|
||||
if (eqID(0, -0.0)) throw Exception()
|
||||
if (eqLD(0L, -0.0)) throw Exception()
|
||||
if (eqFI(-0.0F, 0)) throw Exception()
|
||||
if (eqFL(-0.0F, 0L)) throw Exception()
|
||||
if (eqIF(0, -0.0F)) throw Exception()
|
||||
if (eqLF(0L, -0.0F)) throw Exception()
|
||||
}
|
||||
|
||||
fun test01() {
|
||||
if (eqDI(0.0, 1)) throw Exception()
|
||||
if (eqDL(0.0, 1L)) throw Exception()
|
||||
if (eqID(0, 1.0)) throw Exception()
|
||||
if (eqLD(0L, 1.0)) throw Exception()
|
||||
if (eqFI(0.0F, 1)) throw Exception()
|
||||
if (eqFL(0.0F, 1L)) throw Exception()
|
||||
if (eqIF(0, 1.0F)) throw Exception()
|
||||
if (eqLF(0L, 1.0F)) throw Exception()
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
testNullNull()
|
||||
testNull0()
|
||||
test0Null()
|
||||
testPlusMinus0()
|
||||
test01()
|
||||
|
||||
return "OK"
|
||||
}
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// LANGUAGE_VERSION: 1.3
|
||||
// !LANGUAGE: +ProperIeee754Comparisons
|
||||
// IGNORE_BACKEND: JS
|
||||
|
||||
fun eqDI(x: Any?, y: Any?) = x is Double? && y is Int? && x == y
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// LANGUAGE_VERSION: 1.3
|
||||
// !LANGUAGE: +ProperIeee754Comparisons
|
||||
|
||||
fun ne(x: Any, y: Any) = x is Double && y is Float && x != y
|
||||
fun lt(x: Any, y: Any) = x is Double && y is Float && x < y
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
// !LANGUAGE: +ProperIeee754Comparisons
|
||||
|
||||
val minus: Any = -0.0
|
||||
|
||||
fun box(): String {
|
||||
if (minus is Comparable<*> && minus is Double) {
|
||||
if (minus < 0.0) return "fail 0"
|
||||
if ((minus) != 0.0) return "fail 1"
|
||||
if (minus != 0.0) return "fail 2"
|
||||
if (minus != 0.0F) return "fail 3"
|
||||
}
|
||||
return "OK"
|
||||
}
|
||||
Generated
+36
-12
@@ -9993,9 +9993,21 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("comparableToTWithTLV13.kt")
|
||||
public void testComparableToTWithTLV13() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/comparableToTWithTLV13.kt");
|
||||
@TestMetadata("asComparableToDouble.kt")
|
||||
public void testAsComparableToDouble() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/asComparableToDouble.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("asComparableToDouble_properIeeeComparisons.kt")
|
||||
public void testAsComparableToDouble_properIeeeComparisons() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/asComparableToDouble_properIeeeComparisons.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("comparableToTWithT_properIeeeComparisons.kt")
|
||||
public void testComparableToTWithT_properIeeeComparisons() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/comparableToTWithT_properIeeeComparisons.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@@ -10161,9 +10173,9 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("smartCastOnWhenSubjectAfterCheckInBranchLV13.kt")
|
||||
public void testSmartCastOnWhenSubjectAfterCheckInBranchLV13() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/smartCastOnWhenSubjectAfterCheckInBranchLV13.kt");
|
||||
@TestMetadata("smartCastOnWhenSubjectAfterCheckInBranch_properIeeeComparisons.kt")
|
||||
public void testSmartCastOnWhenSubjectAfterCheckInBranch_properIeeeComparisons() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/smartCastOnWhenSubjectAfterCheckInBranch_properIeeeComparisons.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@@ -10173,15 +10185,27 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("smartCastToDifferentTypesLV13.kt")
|
||||
public void testSmartCastToDifferentTypesLV13() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/smartCastToDifferentTypesLV13.kt");
|
||||
@TestMetadata("smartCastToDifferentTypesWithNumericPromotion.kt")
|
||||
public void testSmartCastToDifferentTypesWithNumericPromotion() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/smartCastToDifferentTypesWithNumericPromotion.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("smartCastToDifferentTypesWithNumericPromotionLV13.kt")
|
||||
public void testSmartCastToDifferentTypesWithNumericPromotionLV13() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/smartCastToDifferentTypesWithNumericPromotionLV13.kt");
|
||||
@TestMetadata("smartCastToDifferentTypesWithNumericPromotion_properIeeeComparisons.kt")
|
||||
public void testSmartCastToDifferentTypesWithNumericPromotion_properIeeeComparisons() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/smartCastToDifferentTypesWithNumericPromotion_properIeeeComparisons.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("smartCastToDifferentTypes_properIeeeComparisons.kt")
|
||||
public void testSmartCastToDifferentTypes_properIeeeComparisons() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/smartCastToDifferentTypes_properIeeeComparisons.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("smartCastToDoubleAndComparableToDouble.kt")
|
||||
public void testSmartCastToDoubleAndComparableToDouble() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/smartCastToDoubleAndComparableToDouble.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
|
||||
+36
-12
@@ -9993,9 +9993,21 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("comparableToTWithTLV13.kt")
|
||||
public void testComparableToTWithTLV13() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/comparableToTWithTLV13.kt");
|
||||
@TestMetadata("asComparableToDouble.kt")
|
||||
public void testAsComparableToDouble() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/asComparableToDouble.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("asComparableToDouble_properIeeeComparisons.kt")
|
||||
public void testAsComparableToDouble_properIeeeComparisons() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/asComparableToDouble_properIeeeComparisons.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("comparableToTWithT_properIeeeComparisons.kt")
|
||||
public void testComparableToTWithT_properIeeeComparisons() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/comparableToTWithT_properIeeeComparisons.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@@ -10161,9 +10173,9 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("smartCastOnWhenSubjectAfterCheckInBranchLV13.kt")
|
||||
public void testSmartCastOnWhenSubjectAfterCheckInBranchLV13() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/smartCastOnWhenSubjectAfterCheckInBranchLV13.kt");
|
||||
@TestMetadata("smartCastOnWhenSubjectAfterCheckInBranch_properIeeeComparisons.kt")
|
||||
public void testSmartCastOnWhenSubjectAfterCheckInBranch_properIeeeComparisons() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/smartCastOnWhenSubjectAfterCheckInBranch_properIeeeComparisons.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@@ -10173,15 +10185,27 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("smartCastToDifferentTypesLV13.kt")
|
||||
public void testSmartCastToDifferentTypesLV13() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/smartCastToDifferentTypesLV13.kt");
|
||||
@TestMetadata("smartCastToDifferentTypesWithNumericPromotion.kt")
|
||||
public void testSmartCastToDifferentTypesWithNumericPromotion() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/smartCastToDifferentTypesWithNumericPromotion.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("smartCastToDifferentTypesWithNumericPromotionLV13.kt")
|
||||
public void testSmartCastToDifferentTypesWithNumericPromotionLV13() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/smartCastToDifferentTypesWithNumericPromotionLV13.kt");
|
||||
@TestMetadata("smartCastToDifferentTypesWithNumericPromotion_properIeeeComparisons.kt")
|
||||
public void testSmartCastToDifferentTypesWithNumericPromotion_properIeeeComparisons() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/smartCastToDifferentTypesWithNumericPromotion_properIeeeComparisons.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("smartCastToDifferentTypes_properIeeeComparisons.kt")
|
||||
public void testSmartCastToDifferentTypes_properIeeeComparisons() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/smartCastToDifferentTypes_properIeeeComparisons.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("smartCastToDoubleAndComparableToDouble.kt")
|
||||
public void testSmartCastToDoubleAndComparableToDouble() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/smartCastToDoubleAndComparableToDouble.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
|
||||
+36
-12
@@ -9993,9 +9993,21 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("comparableToTWithTLV13.kt")
|
||||
public void testComparableToTWithTLV13() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/comparableToTWithTLV13.kt");
|
||||
@TestMetadata("asComparableToDouble.kt")
|
||||
public void testAsComparableToDouble() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/asComparableToDouble.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("asComparableToDouble_properIeeeComparisons.kt")
|
||||
public void testAsComparableToDouble_properIeeeComparisons() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/asComparableToDouble_properIeeeComparisons.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("comparableToTWithT_properIeeeComparisons.kt")
|
||||
public void testComparableToTWithT_properIeeeComparisons() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/comparableToTWithT_properIeeeComparisons.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@@ -10161,9 +10173,9 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("smartCastOnWhenSubjectAfterCheckInBranchLV13.kt")
|
||||
public void testSmartCastOnWhenSubjectAfterCheckInBranchLV13() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/smartCastOnWhenSubjectAfterCheckInBranchLV13.kt");
|
||||
@TestMetadata("smartCastOnWhenSubjectAfterCheckInBranch_properIeeeComparisons.kt")
|
||||
public void testSmartCastOnWhenSubjectAfterCheckInBranch_properIeeeComparisons() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/smartCastOnWhenSubjectAfterCheckInBranch_properIeeeComparisons.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@@ -10173,15 +10185,27 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("smartCastToDifferentTypesLV13.kt")
|
||||
public void testSmartCastToDifferentTypesLV13() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/smartCastToDifferentTypesLV13.kt");
|
||||
@TestMetadata("smartCastToDifferentTypesWithNumericPromotion.kt")
|
||||
public void testSmartCastToDifferentTypesWithNumericPromotion() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/smartCastToDifferentTypesWithNumericPromotion.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("smartCastToDifferentTypesWithNumericPromotionLV13.kt")
|
||||
public void testSmartCastToDifferentTypesWithNumericPromotionLV13() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/smartCastToDifferentTypesWithNumericPromotionLV13.kt");
|
||||
@TestMetadata("smartCastToDifferentTypesWithNumericPromotion_properIeeeComparisons.kt")
|
||||
public void testSmartCastToDifferentTypesWithNumericPromotion_properIeeeComparisons() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/smartCastToDifferentTypesWithNumericPromotion_properIeeeComparisons.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("smartCastToDifferentTypes_properIeeeComparisons.kt")
|
||||
public void testSmartCastToDifferentTypes_properIeeeComparisons() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/smartCastToDifferentTypes_properIeeeComparisons.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("smartCastToDoubleAndComparableToDouble.kt")
|
||||
public void testSmartCastToDoubleAndComparableToDouble() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/smartCastToDoubleAndComparableToDouble.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
|
||||
@@ -66,9 +66,9 @@ enum class LanguageFeature(
|
||||
NestedClassesInAnnotations(KOTLIN_1_3),
|
||||
JvmStaticInInterface(KOTLIN_1_3),
|
||||
InlineClasses(KOTLIN_1_3),
|
||||
ProperNumberComparisons(KOTLIN_1_3),
|
||||
|
||||
StrictJavaNullabilityAssertions(sinceVersion = null, defaultState = State.DISABLED),
|
||||
ProperIeee754Comparisons(sinceVersion = null, defaultState = State.DISABLED),
|
||||
|
||||
ReadDeserializedContracts(KOTLIN_1_3),
|
||||
UseReturnsEffect(KOTLIN_1_3),
|
||||
|
||||
+57
-15
@@ -10917,9 +10917,33 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("comparableToTWithTLV13.kt")
|
||||
public void testComparableToTWithTLV13() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/comparableToTWithTLV13.kt");
|
||||
@TestMetadata("asComparableToDouble.kt")
|
||||
public void testAsComparableToDouble() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/asComparableToDouble.kt");
|
||||
try {
|
||||
doTest(fileName);
|
||||
}
|
||||
catch (Throwable ignore) {
|
||||
return;
|
||||
}
|
||||
throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that.");
|
||||
}
|
||||
|
||||
@TestMetadata("asComparableToDouble_properIeeeComparisons.kt")
|
||||
public void testAsComparableToDouble_properIeeeComparisons() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/asComparableToDouble_properIeeeComparisons.kt");
|
||||
try {
|
||||
doTest(fileName);
|
||||
}
|
||||
catch (Throwable ignore) {
|
||||
return;
|
||||
}
|
||||
throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that.");
|
||||
}
|
||||
|
||||
@TestMetadata("comparableToTWithT_properIeeeComparisons.kt")
|
||||
public void testComparableToTWithT_properIeeeComparisons() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/comparableToTWithT_properIeeeComparisons.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@@ -11115,9 +11139,9 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
|
||||
throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that.");
|
||||
}
|
||||
|
||||
@TestMetadata("smartCastOnWhenSubjectAfterCheckInBranchLV13.kt")
|
||||
public void testSmartCastOnWhenSubjectAfterCheckInBranchLV13() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/smartCastOnWhenSubjectAfterCheckInBranchLV13.kt");
|
||||
@TestMetadata("smartCastOnWhenSubjectAfterCheckInBranch_properIeeeComparisons.kt")
|
||||
public void testSmartCastOnWhenSubjectAfterCheckInBranch_properIeeeComparisons() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/smartCastOnWhenSubjectAfterCheckInBranch_properIeeeComparisons.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@@ -11133,15 +11157,9 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
|
||||
throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that.");
|
||||
}
|
||||
|
||||
@TestMetadata("smartCastToDifferentTypesLV13.kt")
|
||||
public void testSmartCastToDifferentTypesLV13() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/smartCastToDifferentTypesLV13.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("smartCastToDifferentTypesWithNumericPromotionLV13.kt")
|
||||
public void testSmartCastToDifferentTypesWithNumericPromotionLV13() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/smartCastToDifferentTypesWithNumericPromotionLV13.kt");
|
||||
@TestMetadata("smartCastToDifferentTypesWithNumericPromotion.kt")
|
||||
public void testSmartCastToDifferentTypesWithNumericPromotion() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/smartCastToDifferentTypesWithNumericPromotion.kt");
|
||||
try {
|
||||
doTest(fileName);
|
||||
}
|
||||
@@ -11151,6 +11169,30 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
|
||||
throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that.");
|
||||
}
|
||||
|
||||
@TestMetadata("smartCastToDifferentTypesWithNumericPromotion_properIeeeComparisons.kt")
|
||||
public void testSmartCastToDifferentTypesWithNumericPromotion_properIeeeComparisons() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/smartCastToDifferentTypesWithNumericPromotion_properIeeeComparisons.kt");
|
||||
try {
|
||||
doTest(fileName);
|
||||
}
|
||||
catch (Throwable ignore) {
|
||||
return;
|
||||
}
|
||||
throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that.");
|
||||
}
|
||||
|
||||
@TestMetadata("smartCastToDifferentTypes_properIeeeComparisons.kt")
|
||||
public void testSmartCastToDifferentTypes_properIeeeComparisons() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/smartCastToDifferentTypes_properIeeeComparisons.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("smartCastToDoubleAndComparableToDouble.kt")
|
||||
public void testSmartCastToDoubleAndComparableToDouble() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/smartCastToDoubleAndComparableToDouble.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("when.kt")
|
||||
public void testWhen() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/when.kt");
|
||||
|
||||
Reference in New Issue
Block a user