From c0ac607a1d988ab9f84e0657eecaa52a4649369c Mon Sep 17 00:00:00 2001 From: Dmitry Petrov Date: Tue, 6 Sep 2016 17:30:13 +0300 Subject: [PATCH] Additional tests for integer literal type promotion. --- compiler/testData/ir/irText/expressions/literals.kt | 7 ++++++- compiler/testData/ir/irText/expressions/literals.txt | 12 ++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/compiler/testData/ir/irText/expressions/literals.kt b/compiler/testData/ir/irText/expressions/literals.kt index 2d660548150..ddd6b51c617 100644 --- a/compiler/testData/ir/irText/expressions/literals.kt +++ b/compiler/testData/ir/irText/expressions/literals.kt @@ -10,4 +10,9 @@ val test9 = 1.0 val test10 = -1.0 val test11 = 1.0f val test12 = -1.0f -val test13 = 'a' \ No newline at end of file +val test13 = 'a' + +val testB: Byte = 1 +val testS: Short = 1 +val testI: Int = 1 +val testL: Long = 1 diff --git a/compiler/testData/ir/irText/expressions/literals.txt b/compiler/testData/ir/irText/expressions/literals.txt index 38cca831037..fa394fdaab4 100644 --- a/compiler/testData/ir/irText/expressions/literals.txt +++ b/compiler/testData/ir/irText/expressions/literals.txt @@ -38,3 +38,15 @@ FILE /literals.kt PROPERTY public val test13: kotlin.Char = \u0061 ('a') EXPRESSION_BODY CONST Char type=kotlin.Char value='a' + PROPERTY public val testB: kotlin.Byte = 1.toByte() + EXPRESSION_BODY + CONST Byte type=kotlin.Byte value='1' + PROPERTY public val testS: kotlin.Short = 1.toShort() + EXPRESSION_BODY + CONST Short type=kotlin.Short value='1' + PROPERTY public val testI: kotlin.Int = 1 + EXPRESSION_BODY + CONST Int type=kotlin.Int value='1' + PROPERTY public val testL: kotlin.Long = 1.toLong() + EXPRESSION_BODY + CONST Long type=kotlin.Long value='1'