backend: Add caching for unary and binary operation symbols
This commit is contained in:
@@ -309,7 +309,7 @@ task sum_3const(type: RunKonanTest) {
|
||||
|
||||
task codegen_basics_for_loops(type: RunKonanTest) {
|
||||
source = "codegen/basics/for_loops.kt"
|
||||
goldValue = "01234\n0123\n43210\n\n024\n02\n420\n\n036\n03\n630\n\n"
|
||||
goldValue = "01234\n0123\n43210\n\n024\n02\n420\n\n036\n03\n630\n\n024\n02\n420\n\n"
|
||||
}
|
||||
|
||||
task codegen_basics_for_loops_types(type: RunKonanTest) {
|
||||
|
||||
@@ -51,4 +51,24 @@ fun main(args: Array<String>) {
|
||||
}
|
||||
println()
|
||||
println()
|
||||
|
||||
// Without constants
|
||||
val a = 0
|
||||
val b = 4
|
||||
val s = 2
|
||||
for (i in a..b step s) {
|
||||
print(i)
|
||||
}
|
||||
println()
|
||||
|
||||
for (i in a until b step s) {
|
||||
print(i)
|
||||
}
|
||||
println()
|
||||
|
||||
for (i in b downTo a step s) {
|
||||
print(i)
|
||||
}
|
||||
println()
|
||||
println()
|
||||
}
|
||||
Reference in New Issue
Block a user