Files
kotlin-fork/compiler/testData/ir/irCfg/when/ifChain.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

176 lines
7.6 KiB
Plaintext
Vendored

// FILE: /ifChain.kt
// FUN: minBiRoot
BB 0
CONTENT
1 FUN name:minBiRoot visibility:public modality:FINAL <> (a:kotlin.Double, b:kotlin.Double, c:kotlin.Double) returnType:Double flags:
2 WHEN type=kotlin.Unit origin=null
3 GET_VAR 'value-parameter a: Double' type=kotlin.Double origin=null
4 CONST Double type=kotlin.Double value=0.0
OUTGOING -> BB 1, 6
CALL 'ieee754equals(Double?, Double?): Boolean' type=kotlin.Boolean origin=EQEQ
BB 1
INCOMING <- BB 0
CALL 'ieee754equals(Double?, Double?): Boolean' type=kotlin.Boolean origin=EQEQ
CONTENT
1 WHEN type=kotlin.Unit origin=null
2 GET_VAR 'value-parameter b: Double' type=kotlin.Double origin=null
3 CONST Double type=kotlin.Double value=0.0
OUTGOING -> BB 2, 3
CALL 'ieee754equals(Double?, Double?): Boolean' type=kotlin.Boolean origin=EQEQ
BB 2
INCOMING <- BB 1
CALL 'ieee754equals(Double?, Double?): Boolean' type=kotlin.Boolean origin=EQEQ
CONTENT
1 CONST Double type=kotlin.Double value=1.0
2 RETURN type=kotlin.Nothing from='minBiRoot(Double, Double, Double): Double'
OUTGOING -> NONE
Function exit: FUN name:minBiRoot visibility:public modality:FINAL <> (a:kotlin.Double, b:kotlin.Double, c:kotlin.Double) returnType:Double flags:
BB 3
INCOMING <- BB 1
CALL 'ieee754equals(Double?, Double?): Boolean' type=kotlin.Boolean origin=EQEQ
CONTENT
1 GET_VAR 'value-parameter c: Double' type=kotlin.Double origin=null
2 CALL 'unaryMinus(): Double' type=kotlin.Double origin=UMINUS
3 GET_VAR 'value-parameter b: Double' type=kotlin.Double origin=null
4 CALL 'div(Double): Double' type=kotlin.Double origin=DIV
5 VAR name:bc type:kotlin.Double flags:val
6 WHEN type=kotlin.Unit origin=null
7 GET_VAR 'bc: Double' type=kotlin.Double origin=null
8 CONST Double type=kotlin.Double value=0.0
OUTGOING -> BB 4, 5
CALL 'less(Double, Double): Boolean' type=kotlin.Boolean origin=LT
BB 4
INCOMING <- BB 3
CALL 'less(Double, Double): Boolean' type=kotlin.Boolean origin=LT
CONTENT
1 CONST Double type=kotlin.Double value=2.0
2 RETURN type=kotlin.Nothing from='minBiRoot(Double, Double, Double): Double'
OUTGOING -> NONE
Function exit: FUN name:minBiRoot visibility:public modality:FINAL <> (a:kotlin.Double, b:kotlin.Double, c:kotlin.Double) returnType:Double flags:
BB 5
INCOMING <- BB 3
CALL 'less(Double, Double): Boolean' type=kotlin.Boolean origin=LT
CONTENT
1 GET_VAR 'bc: Double' type=kotlin.Double origin=null
2 CALL 'unaryMinus(): Double' type=kotlin.Double origin=UMINUS
3 RETURN type=kotlin.Nothing from='minBiRoot(Double, Double, Double): Double'
OUTGOING -> NONE
Function exit: FUN name:minBiRoot visibility:public modality:FINAL <> (a:kotlin.Double, b:kotlin.Double, c:kotlin.Double) returnType:Double flags:
BB 6
INCOMING <- BB 0
CALL 'ieee754equals(Double?, Double?): Boolean' type=kotlin.Boolean origin=EQEQ
CONTENT
1 GET_VAR 'value-parameter b: Double' type=kotlin.Double origin=null
2 GET_VAR 'value-parameter b: Double' type=kotlin.Double origin=null
3 CALL 'times(Double): Double' type=kotlin.Double origin=MUL
4 CONST Int type=kotlin.Int value=4
5 GET_VAR 'value-parameter a: Double' type=kotlin.Double origin=null
6 CALL 'times(Double): Double' type=kotlin.Double origin=MUL
7 GET_VAR 'value-parameter c: Double' type=kotlin.Double origin=null
8 CALL 'times(Double): Double' type=kotlin.Double origin=MUL
9 CALL 'minus(Double): Double' type=kotlin.Double origin=MINUS
10 VAR name:d type:kotlin.Double flags:val
11 WHEN type=kotlin.Unit origin=null
12 GET_VAR 'd: Double' type=kotlin.Double origin=null
13 CONST Double type=kotlin.Double value=0.0
OUTGOING -> BB 7, 8
CALL 'less(Double, Double): Boolean' type=kotlin.Boolean origin=LT
BB 7
INCOMING <- BB 6
CALL 'less(Double, Double): Boolean' type=kotlin.Boolean origin=LT
CONTENT
1 CONST Double type=kotlin.Double value=3.0
2 RETURN type=kotlin.Nothing from='minBiRoot(Double, Double, Double): Double'
OUTGOING -> NONE
Function exit: FUN name:minBiRoot visibility:public modality:FINAL <> (a:kotlin.Double, b:kotlin.Double, c:kotlin.Double) returnType:Double flags:
BB 8
INCOMING <- BB 6
CALL 'less(Double, Double): Boolean' type=kotlin.Boolean origin=LT
CONTENT
1 GET_VAR 'value-parameter b: Double' type=kotlin.Double origin=null
2 CALL 'unaryMinus(): Double' type=kotlin.Double origin=UMINUS
3 GET_VAR 'd: Double' type=kotlin.Double origin=null
4 CALL 'plus(Double): Double' type=kotlin.Double origin=PLUS
5 CONST Int type=kotlin.Int value=2
6 GET_VAR 'value-parameter a: Double' type=kotlin.Double origin=null
7 CALL 'times(Double): Double' type=kotlin.Double origin=MUL
8 CALL 'div(Double): Double' type=kotlin.Double origin=DIV
9 VAR name:y1 type:kotlin.Double flags:val
10 GET_VAR 'value-parameter b: Double' type=kotlin.Double origin=null
11 CALL 'unaryMinus(): Double' type=kotlin.Double origin=UMINUS
12 GET_VAR 'd: Double' type=kotlin.Double origin=null
13 CALL 'minus(Double): Double' type=kotlin.Double origin=MINUS
14 CONST Int type=kotlin.Int value=2
15 GET_VAR 'value-parameter a: Double' type=kotlin.Double origin=null
16 CALL 'times(Double): Double' type=kotlin.Double origin=MUL
17 CALL 'div(Double): Double' type=kotlin.Double origin=DIV
18 VAR name:y2 type:kotlin.Double flags:val
19 WHEN type=kotlin.Double origin=null
20 GET_VAR 'y1: Double' type=kotlin.Double origin=null
21 GET_VAR 'y2: Double' type=kotlin.Double origin=null
OUTGOING -> BB 9, 10
CALL 'greater(Double, Double): Boolean' type=kotlin.Boolean origin=GT
BB 9
INCOMING <- BB 8
CALL 'greater(Double, Double): Boolean' type=kotlin.Boolean origin=GT
CONTENT
OUTGOING -> BB 11
CONST Boolean type=kotlin.Boolean value=true
BB 10
INCOMING <- BB 8
CALL 'greater(Double, Double): Boolean' type=kotlin.Boolean origin=GT
CONTENT
1 GET_VAR 'y1: Double' type=kotlin.Double origin=null
OUTGOING -> BB 12
When exit: WHEN type=kotlin.Double origin=null
BB 11
INCOMING <- BB 9
CONST Boolean type=kotlin.Boolean value=true
CONTENT
1 GET_VAR 'y2: Double' type=kotlin.Double origin=null
OUTGOING -> BB 12
When exit: WHEN type=kotlin.Double origin=null
BB 12
INCOMING <- BB 10, 11
When exit: WHEN type=kotlin.Double origin=null
CONTENT
1 VAR name:y3 type:kotlin.Double flags:val
2 WHEN type=kotlin.Double origin=null
3 GET_VAR 'y3: Double' type=kotlin.Double origin=null
4 CONST Double type=kotlin.Double value=0.0
OUTGOING -> BB 13, 14
CALL 'less(Double, Double): Boolean' type=kotlin.Boolean origin=LT
BB 13
INCOMING <- BB 12
CALL 'less(Double, Double): Boolean' type=kotlin.Boolean origin=LT
CONTENT
OUTGOING -> BB 15
CONST Boolean type=kotlin.Boolean value=true
BB 14
INCOMING <- BB 12
CALL 'less(Double, Double): Boolean' type=kotlin.Boolean origin=LT
CONTENT
1 CONST Double type=kotlin.Double value=4.0
OUTGOING -> BB 16
When exit: WHEN type=kotlin.Double origin=null
BB 15
INCOMING <- BB 13
CONST Boolean type=kotlin.Boolean value=true
CONTENT
1 GET_VAR 'y3: Double' type=kotlin.Double origin=null
2 CALL 'unaryMinus(): Double' type=kotlin.Double origin=UMINUS
OUTGOING -> BB 16
When exit: WHEN type=kotlin.Double origin=null
BB 16
INCOMING <- BB 14, 15
When exit: WHEN type=kotlin.Double origin=null
CONTENT
1 RETURN type=kotlin.Nothing from='minBiRoot(Double, Double, Double): Double'
OUTGOING -> NONE
Function exit: FUN name:minBiRoot visibility:public modality:FINAL <> (a:kotlin.Double, b:kotlin.Double, c:kotlin.Double) returnType:Double flags:
// END FUN: minBiRoot
// END FILE: /ifChain.kt