[K1] Fix string offsets to include quotes in the same way it's done in FIR

This commit is contained in:
Artem Kobzar
2024-02-02 14:43:46 +00:00
committed by Space Team
parent 434470a4f5
commit 4f521aa05c
42 changed files with 147 additions and 154 deletions
+10 -10
View File
@@ -1,4 +1,4 @@
// IGNORE_BACKEND_K2: WASM
// FILE: test.kt
fun stringSwitch(x: String) {
@@ -106,7 +106,7 @@ fun box() {
// EXPECTATIONS WASM
// test.kt:1 $box
// test.kt:27 $box (18, 18, 18, 18, 4)
// test.kt:27 $box (17, 17, 17, 17, 4)
// String.kt:141 $kotlin.stringLiteral (17, 28, 17, 17, 28, 17, 17, 28, 17, 17, 28, 17, 17, 28, 17, 17, 28, 17, 17, 28, 17, 17, 28, 17, 17, 28, 17)
// Array.kt:59 $kotlin.Array.get (19, 26, 34, 8, 19, 26, 34, 8, 19, 26, 34, 8, 19, 26, 34, 8, 19, 26, 34, 8, 19, 26, 34, 8, 19, 26, 34, 8, 19, 26, 34, 8, 19, 26, 34, 8)
// ThrowHelpers.kt:29 $kotlin.wasm.internal.rangeCheck (6, 14, 6, 19, 28, 19, 6, 14, 6, 19, 28, 19, 6, 14, 6, 19, 28, 19, 6, 14, 6, 19, 28, 19, 6, 14, 6, 19, 28, 19, 6, 14, 6, 19, 28, 19, 6, 14, 6, 19, 28, 19, 6, 14, 6, 19, 28, 19, 6, 14, 6, 19, 28, 19, 6, 14, 6, 19, 28, 19, 6, 14, 6, 19, 28, 19, 6, 14, 6, 19, 28, 19)
@@ -120,7 +120,7 @@ fun box() {
// Array.kt:75 $kotlin.Array.set (8, 20, 27, 16, 8, 20, 27, 16, 8, 20, 27, 16)
// Array.kt:76 $kotlin.Array.set (5, 5, 5)
// String.kt:149 $kotlin.stringLiteral (11, 4, 11, 4, 11, 4)
// test.kt:6 $stringSwitch (8, 14, 14, 14, 14, 8, 20, 8, 8)
// test.kt:6 $stringSwitch (8, 13, 13, 13, 13, 8, 20, 8, 8)
// String.kt:122 $kotlin.String.hashCode (12, 25, 12, 12, 12, 25, 12, 12, 35, 28, 12, 25, 12, 12, 35, 28, 12, 25, 12, 12, 12, 25, 12, 12, 35, 28, 12, 25, 12, 12, 35, 28, 12, 25, 12, 12, 12, 25, 12, 12, 35, 28, 12, 25, 12, 12, 35, 28)
// String.kt:123 $kotlin.String.hashCode (30, 30, 30)
// String.kt:124 $kotlin.String.hashCode (12, 26, 12, 12, 26, 12, 12, 26, 12)
@@ -144,16 +144,16 @@ fun box() {
// test.kt:1 $stringSwitch (0, 0, 0, 0, 0, 0)
// test.kt:5 $stringSwitch (4, 4, 4)
// test.kt:11 $stringSwitch (19, 4, 19, 4, 19, 4)
// test.kt:12 $stringSwitch (8, 9, 9, 9, 9, 8, 15, 8, 8)
// test.kt:12 $stringSwitch (8, 15, 8, 8)
// test.kt:18 $stringSwitch (9, 9, 9)
// test.kt:20 $stringSwitch (8, 9, 9, 9, 9, 8, 15, 8, 8)
// test.kt:20 $stringSwitch (8, 15, 8, 8)
// test.kt:17 $stringSwitch (4, 4, 4)
// test.kt:24 $stringSwitch (1, 1, 1)
// test.kt:28 $box (18, 18, 18, 18, 4)
// test.kt:7 $stringSwitch (8, 14, 14, 14, 14, 8, 21)
// test.kt:13 $stringSwitch (8, 9, 9, 9, 9, 8, 16)
// test.kt:21 $stringSwitch (8, 9, 9, 9, 9, 8, 16)
// test.kt:29 $box (18, 18, 18, 18, 4)
// test.kt:28 $box (17, 17, 17, 17, 4)
// test.kt:7 $stringSwitch (8, 13, 13, 13, 13, 8, 21)
// test.kt:13 $stringSwitch (8, 16)
// test.kt:21 $stringSwitch (8, 16)
// test.kt:29 $box (17, 17, 17, 17, 4)
// test.kt:8 $stringSwitch
// test.kt:14 $stringSwitch
// test.kt:22 $stringSwitch