JVM_IR. Support compile time constants

This commit is contained in:
Georgy Bronnikov
2018-09-18 14:49:43 +03:00
parent 985934a40a
commit 055215c54f
39 changed files with 35 additions and 42 deletions
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JVM_IR
fun box(): String {
val c1: Char = Char.MIN_VALUE
val c2 = c1 - 1
-1
View File
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JVM_IR
// IGNORE_BACKEND: JS_IR
fun box(): String {
val i1: Int = Int.MAX_VALUE
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JVM_IR
// IGNORE_BACKEND: JS_IR
fun box(): String {
val a: Long = 2147483647 + 1
+1
View File
@@ -1,3 +1,4 @@
// !LANGUAGE: -NoConstantValueAttributeForNonConstVals
// IGNORE_BACKEND: JVM_IR
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND: NATIVE
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JVM_IR
// IGNORE_BACKEND: JS_IR
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND: JS, NATIVE
-1
View File
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JVM_IR
// IGNORE_BACKEND: JS_IR
fun test(i: Int): Int {
return i
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JVM_IR
// IGNORE_BACKEND: JS_IR
fun test(i: Int): Int {
return i
-1
View File
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JVM_IR
// IGNORE_BACKEND: JS_IR
val MAX_LONG = "9223372036854775807"
val PREFIX = "max = "
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JVM_IR
fun <T> assertEquals(a: T, b: T) { if (a != b) throw AssertionError("$a != $b") }
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JVM_IR
fun <T> assertEquals(a: T, b: T) { if (a != b) throw AssertionError("$a != $b") }
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JVM_IR
fun <T> assertEquals(a: T, b: T) { if (a != b) throw AssertionError("$a != $b") }
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JVM_IR
fun <T> assertEquals(a: T, b: T) { if (a != b) throw AssertionError("$a != $b") }
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JVM_IR
fun <T> assertEquals(a: T, b: T) { if (a != b) throw AssertionError("$a != $b") }
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JVM_IR
// IGNORE_BACKEND: JS_IR
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND: JS
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JVM_IR
// IGNORE_BACKEND: JS_IR
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND: JS
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JVM_IR
// IGNORE_BACKEND: JS_IR
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND: JS
@@ -1,5 +1,4 @@
// TODO: muted automatically, investigate should it be ran for JVM_IR or not
// IGNORE_BACKEND: JVM_IR
// Auto-generated by org.jetbrains.kotlin.generators.tests.GenerateRangesCodegenTestData. DO NOT EDIT!
// WITH_RUNTIME
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JVM_IR
// WITH_RUNTIME
import kotlin.test.assertEquals
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JVM_IR
// WITH_RUNTIME
import kotlin.test.assertEquals
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JVM_IR
// WITH_RUNTIME
import kotlin.test.assertEquals
@@ -1,5 +1,4 @@
// WITH_RUNTIME
// IGNORE_BACKEND: JVM_IR
const val M = Char.MIN_VALUE
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JVM_IR
// WITH_RUNTIME
const val M = Char.MIN_VALUE
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JVM_IR
// WITH_RUNTIME
const val M = Int.MIN_VALUE
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JVM_IR
// WITH_RUNTIME
const val M = Int.MIN_VALUE
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JVM_IR
// WITH_RUNTIME
const val M = Long.MIN_VALUE
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JVM_IR
// WITH_RUNTIME
const val M = Long.MIN_VALUE
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JVM_IR
const val M = Char.MAX_VALUE
fun box(): String {
@@ -11,4 +10,4 @@ fun box(): String {
}
if (count != 1) throw AssertionError("Should be executed once")
return "OK"
}
}
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JVM_IR
// WITH_RUNTIME
const val M = Char.MAX_VALUE
@@ -13,4 +12,4 @@ fun box(): String {
}
if (count != 1) throw AssertionError("Should be executed once")
return "OK"
}
}
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JVM_IR
const val M = Int.MAX_VALUE
fun box(): String {
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JVM_IR
// WITH_RUNTIME
const val M = Int.MAX_VALUE
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JVM_IR
const val M = Long.MAX_VALUE
fun box(): String {
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JVM_IR
// WITH_RUNTIME
const val M = Long.MAX_VALUE
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JVM_IR
// WITH_RUNTIME
const val M = Int.MIN_VALUE
@@ -1,5 +1,4 @@
// TODO: muted automatically, investigate should it be ran for JVM_IR or not
// IGNORE_BACKEND: JVM_IR
// Auto-generated by org.jetbrains.kotlin.generators.tests.GenerateRangesCodegenTestData. DO NOT EDIT!
// WITH_RUNTIME