Files
kotlin-fork/compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointCompareTo.txt
T
Dmitry Petrov 9137e68d4e Implement special desugaring for numeric comparisons in PSI2IR
This introduces the following IR built-in functions required for proper
implementation of the number comparisons:

- ieee754Equals(T, T): Boolean,
    for each T in {Float?, Double?}

- less(T, T): Boolean
  lessOrEqual(T, T): Boolean
  greater(T, T): Boolean
  greaterOrEqual(T, T): Boolean
    for each T in {Int, Long, Float, Double}
2018-02-07 14:30:59 +03:00

202 lines
13 KiB
Plaintext
Vendored

FILE fqName:<root> fileName:/floatingPointCompareTo.kt
FUN name:test1d visibility:public modality:FINAL <> (x:kotlin.Double, y:kotlin.Double) returnType:Int flags:
VALUE_PARAMETER name:x index:0 type:kotlin.Double flags:
VALUE_PARAMETER name:y index:1 type:kotlin.Double flags:
BLOCK_BODY
RETURN type=kotlin.Nothing from='test1d(Double, Double): Int'
CALL 'compareTo(Double): Int' type=kotlin.Int origin=null
$this: GET_VAR 'value-parameter x: Double' type=kotlin.Double origin=null
other: GET_VAR 'value-parameter y: Double' type=kotlin.Double origin=null
FUN name:test2d visibility:public modality:FINAL <> (x:kotlin.Double, y:kotlin.Any) returnType:Boolean flags:
VALUE_PARAMETER name:x index:0 type:kotlin.Double flags:
VALUE_PARAMETER name:y index:1 type:kotlin.Any flags:
BLOCK_BODY
RETURN type=kotlin.Nothing from='test2d(Double, Any): Boolean'
WHEN type=kotlin.Boolean origin=ANDAND
BRANCH
if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Double
GET_VAR 'value-parameter y: Any' type=kotlin.Any origin=null
then: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
arg0: CALL 'compareTo(Double): Int' type=kotlin.Int origin=null
$this: GET_VAR 'value-parameter x: Double' type=kotlin.Double origin=null
other: TYPE_OP type=kotlin.Double origin=IMPLICIT_CAST typeOperand=kotlin.Double
GET_VAR 'value-parameter y: Any' type=kotlin.Any origin=null
arg1: CONST Int type=kotlin.Int value=0
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: CONST Boolean type=kotlin.Boolean value=false
FUN name:test3d visibility:public modality:FINAL <> (x:kotlin.Any, y:kotlin.Any) returnType:Boolean flags:
VALUE_PARAMETER name:x index:0 type:kotlin.Any flags:
VALUE_PARAMETER name:y index:1 type:kotlin.Any flags:
BLOCK_BODY
RETURN type=kotlin.Nothing from='test3d(Any, Any): Boolean'
WHEN type=kotlin.Boolean origin=ANDAND
BRANCH
if: WHEN type=kotlin.Boolean origin=ANDAND
BRANCH
if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Double
GET_VAR 'value-parameter x: Any' type=kotlin.Any origin=null
then: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Double
GET_VAR 'value-parameter y: Any' type=kotlin.Any origin=null
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: CONST Boolean type=kotlin.Boolean value=false
then: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
arg0: CALL 'compareTo(Double): Int' type=kotlin.Int origin=null
$this: TYPE_OP type=kotlin.Double origin=IMPLICIT_CAST typeOperand=kotlin.Double
GET_VAR 'value-parameter x: Any' type=kotlin.Any origin=null
other: TYPE_OP type=kotlin.Double origin=IMPLICIT_CAST typeOperand=kotlin.Double
GET_VAR 'value-parameter y: Any' type=kotlin.Any origin=null
arg1: CONST Int type=kotlin.Int value=0
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: CONST Boolean type=kotlin.Boolean value=false
FUN name:test1f visibility:public modality:FINAL <> (x:kotlin.Float, y:kotlin.Float) returnType:Int flags:
VALUE_PARAMETER name:x index:0 type:kotlin.Float flags:
VALUE_PARAMETER name:y index:1 type:kotlin.Float flags:
BLOCK_BODY
RETURN type=kotlin.Nothing from='test1f(Float, Float): Int'
CALL 'compareTo(Float): Int' type=kotlin.Int origin=null
$this: GET_VAR 'value-parameter x: Float' type=kotlin.Float origin=null
other: GET_VAR 'value-parameter y: Float' type=kotlin.Float origin=null
FUN name:test2f visibility:public modality:FINAL <> (x:kotlin.Float, y:kotlin.Any) returnType:Boolean flags:
VALUE_PARAMETER name:x index:0 type:kotlin.Float flags:
VALUE_PARAMETER name:y index:1 type:kotlin.Any flags:
BLOCK_BODY
RETURN type=kotlin.Nothing from='test2f(Float, Any): Boolean'
WHEN type=kotlin.Boolean origin=ANDAND
BRANCH
if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Float
GET_VAR 'value-parameter y: Any' type=kotlin.Any origin=null
then: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
arg0: CALL 'compareTo(Float): Int' type=kotlin.Int origin=null
$this: GET_VAR 'value-parameter x: Float' type=kotlin.Float origin=null
other: TYPE_OP type=kotlin.Float origin=IMPLICIT_CAST typeOperand=kotlin.Float
GET_VAR 'value-parameter y: Any' type=kotlin.Any origin=null
arg1: CONST Int type=kotlin.Int value=0
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: CONST Boolean type=kotlin.Boolean value=false
FUN name:test3f visibility:public modality:FINAL <> (x:kotlin.Any, y:kotlin.Any) returnType:Boolean flags:
VALUE_PARAMETER name:x index:0 type:kotlin.Any flags:
VALUE_PARAMETER name:y index:1 type:kotlin.Any flags:
BLOCK_BODY
RETURN type=kotlin.Nothing from='test3f(Any, Any): Boolean'
WHEN type=kotlin.Boolean origin=ANDAND
BRANCH
if: WHEN type=kotlin.Boolean origin=ANDAND
BRANCH
if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Float
GET_VAR 'value-parameter x: Any' type=kotlin.Any origin=null
then: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Float
GET_VAR 'value-parameter y: Any' type=kotlin.Any origin=null
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: CONST Boolean type=kotlin.Boolean value=false
then: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
arg0: CALL 'compareTo(Float): Int' type=kotlin.Int origin=null
$this: TYPE_OP type=kotlin.Float origin=IMPLICIT_CAST typeOperand=kotlin.Float
GET_VAR 'value-parameter x: Any' type=kotlin.Any origin=null
other: TYPE_OP type=kotlin.Float origin=IMPLICIT_CAST typeOperand=kotlin.Float
GET_VAR 'value-parameter y: Any' type=kotlin.Any origin=null
arg1: CONST Int type=kotlin.Int value=0
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: CONST Boolean type=kotlin.Boolean value=false
FUN name:testFD visibility:public modality:FINAL <> (x:kotlin.Any, y:kotlin.Any) returnType:Boolean flags:
VALUE_PARAMETER name:x index:0 type:kotlin.Any flags:
VALUE_PARAMETER name:y index:1 type:kotlin.Any flags:
BLOCK_BODY
RETURN type=kotlin.Nothing from='testFD(Any, Any): Boolean'
WHEN type=kotlin.Boolean origin=ANDAND
BRANCH
if: WHEN type=kotlin.Boolean origin=ANDAND
BRANCH
if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Float
GET_VAR 'value-parameter x: Any' type=kotlin.Any origin=null
then: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Double
GET_VAR 'value-parameter y: Any' type=kotlin.Any origin=null
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: CONST Boolean type=kotlin.Boolean value=false
then: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
arg0: CALL 'compareTo(Double): Int' type=kotlin.Int origin=null
$this: TYPE_OP type=kotlin.Float origin=IMPLICIT_CAST typeOperand=kotlin.Float
GET_VAR 'value-parameter x: Any' type=kotlin.Any origin=null
other: TYPE_OP type=kotlin.Double origin=IMPLICIT_CAST typeOperand=kotlin.Double
GET_VAR 'value-parameter y: Any' type=kotlin.Any origin=null
arg1: CONST Int type=kotlin.Int value=0
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: CONST Boolean type=kotlin.Boolean value=false
FUN name:testDF visibility:public modality:FINAL <> (x:kotlin.Any, y:kotlin.Any) returnType:Boolean flags:
VALUE_PARAMETER name:x index:0 type:kotlin.Any flags:
VALUE_PARAMETER name:y index:1 type:kotlin.Any flags:
BLOCK_BODY
RETURN type=kotlin.Nothing from='testDF(Any, Any): Boolean'
WHEN type=kotlin.Boolean origin=ANDAND
BRANCH
if: WHEN type=kotlin.Boolean origin=ANDAND
BRANCH
if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Double
GET_VAR 'value-parameter x: Any' type=kotlin.Any origin=null
then: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Float
GET_VAR 'value-parameter y: Any' type=kotlin.Any origin=null
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: CONST Boolean type=kotlin.Boolean value=false
then: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
arg0: CALL 'compareTo(Float): Int' type=kotlin.Int origin=null
$this: TYPE_OP type=kotlin.Double origin=IMPLICIT_CAST typeOperand=kotlin.Double
GET_VAR 'value-parameter x: Any' type=kotlin.Any origin=null
other: TYPE_OP type=kotlin.Float origin=IMPLICIT_CAST typeOperand=kotlin.Float
GET_VAR 'value-parameter y: Any' type=kotlin.Any origin=null
arg1: CONST Int type=kotlin.Int value=0
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: CONST Boolean type=kotlin.Boolean value=false
FUN name:test1fr visibility:public modality:FINAL <> ($receiver:kotlin.Float, x:kotlin.Float) returnType:Int flags:
$receiver: VALUE_PARAMETER name:<this> type:kotlin.Float flags:
VALUE_PARAMETER name:x index:0 type:kotlin.Float flags:
BLOCK_BODY
RETURN type=kotlin.Nothing from='test1fr(Float) on Float: Int'
CALL 'compareTo(Float): Int' type=kotlin.Int origin=null
$this: GET_VAR 'this@test1fr: Float' type=kotlin.Float origin=null
other: GET_VAR 'value-parameter x: Float' type=kotlin.Float origin=null
FUN name:test2fr visibility:public modality:FINAL <> ($receiver:kotlin.Float, x:kotlin.Any) returnType:Boolean flags:
$receiver: VALUE_PARAMETER name:<this> type:kotlin.Float flags:
VALUE_PARAMETER name:x index:0 type:kotlin.Any flags:
BLOCK_BODY
RETURN type=kotlin.Nothing from='test2fr(Any) on Float: Boolean'
WHEN type=kotlin.Boolean origin=ANDAND
BRANCH
if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Float
GET_VAR 'value-parameter x: Any' type=kotlin.Any origin=null
then: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
arg0: CALL 'compareTo(Float): Int' type=kotlin.Int origin=null
$this: GET_VAR 'this@test2fr: Float' type=kotlin.Float origin=null
other: TYPE_OP type=kotlin.Float origin=IMPLICIT_CAST typeOperand=kotlin.Float
GET_VAR 'value-parameter x: Any' type=kotlin.Any origin=null
arg1: CONST Int type=kotlin.Int value=0
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: CONST Boolean type=kotlin.Boolean value=false
FUN name:test3fr visibility:public modality:FINAL <> ($receiver:kotlin.Float, x:kotlin.Any) returnType:Boolean flags:
$receiver: VALUE_PARAMETER name:<this> type:kotlin.Float flags:
VALUE_PARAMETER name:x index:0 type:kotlin.Any flags:
BLOCK_BODY
RETURN type=kotlin.Nothing from='test3fr(Any) on Float: Boolean'
WHEN type=kotlin.Boolean origin=ANDAND
BRANCH
if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Double
GET_VAR 'value-parameter x: Any' type=kotlin.Any origin=null
then: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
arg0: CALL 'compareTo(Double): Int' type=kotlin.Int origin=null
$this: GET_VAR 'this@test3fr: Float' type=kotlin.Float origin=null
other: TYPE_OP type=kotlin.Double origin=IMPLICIT_CAST typeOperand=kotlin.Double
GET_VAR 'value-parameter x: Any' type=kotlin.Any origin=null
arg1: CONST Int type=kotlin.Int value=0
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: CONST Boolean type=kotlin.Boolean value=false