Files
kotlin-fork/compiler/fir/analysis-tests/testData/resolve/fib.fir.txt
T
Dmitriy Novozhilov e6b5cb5216 [TD] Update diagnostics test data due to new test runners
Update includes:
- Changing syntax of `OI/`NI` tags from `<!NI;TAG!>` to `<!TAG{NI}!>`
- Fix some incorrect directives
- Change order of diagnostics in some places
- Remove ignored diagnostics from FIR test data (previously `DIAGNOSTICS` didn't work)
- Update FIR dumps in some places and add `FIR_IDENTICAL` if needed
- Replace all JAVAC_SKIP with SKIP_JAVAC directive
2020-12-16 19:52:25 +03:00

21 lines
896 B
Plaintext
Vendored

FILE: fib.kt
public final fun fibIterative(n: R|kotlin/Int|): R|kotlin/Int| {
when () {
CMP(<, R|<local>/n|.R|kotlin/Int.compareTo|(Int(2))) -> {
^fibIterative Int(1)
}
}
lvar current: R|kotlin/Int| = Int(1)
lvar prev: R|kotlin/Int| = Int(1)
lval <iterator>: R|kotlin/collections/IntIterator| = Int(2).R|kotlin/Int.rangeTo|(R|<local>/n|).R|kotlin/ranges/IntProgression.iterator|()
while(R|<local>/<iterator>|.R|kotlin/collections/Iterator.hasNext|()) {
lval i: R|kotlin/Int| = R|<local>/<iterator>|.R|kotlin/collections/IntIterator.next|()
lval temp: R|kotlin/Int| = R|<local>/current|
R|<local>/current| = R|<local>/current|.R|kotlin/Int.plus|(R|<local>/prev|)
R|<local>/prev| = R|<local>/temp|
}
^fibIterative R|<local>/current|
}