From b69efc6f262b1cdd174218b641cd4d8030cf6b3f Mon Sep 17 00:00:00 2001 From: Shaikh Ubaid Date: Wed, 3 May 2023 15:27:45 +0530 Subject: [PATCH 1/2] WASM: Unescape string --- src/libasr/codegen/asr_to_wasm.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/libasr/codegen/asr_to_wasm.cpp b/src/libasr/codegen/asr_to_wasm.cpp index dd0ed21286..8d04bb9ded 100644 --- a/src/libasr/codegen/asr_to_wasm.cpp +++ b/src/libasr/codegen/asr_to_wasm.cpp @@ -2084,8 +2084,9 @@ class ASRToWASMVisitor : public ASR::BaseVisitor { } void visit_StringConstant(const ASR::StringConstant_t &x) { - emit_string(x.m_s); - m_wa.emit_i32_const(m_string_to_iov_loc_map[x.m_s]); + std::string s = unescape_string(m_al, x.m_s); + emit_string(s); + m_wa.emit_i32_const(m_string_to_iov_loc_map[s]); } void visit_ArrayConstant(const ASR::ArrayConstant_t &x) { From 42bd506c83c53491169fc43c52f0ae96d40570f3 Mon Sep 17 00:00:00 2001 From: Shaikh Ubaid Date: Wed, 3 May 2023 15:36:00 +0530 Subject: [PATCH 2/2] TEST: Enable supporting tests --- integration_tests/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/integration_tests/CMakeLists.txt b/integration_tests/CMakeLists.txt index 83063546a2..76abec0e51 100644 --- a/integration_tests/CMakeLists.txt +++ b/integration_tests/CMakeLists.txt @@ -295,7 +295,7 @@ RUN(NAME exit_02b FAIL LABELS cpython llvm c wasm wasm_x86 wasm_x64) RUN(NAME exit_02c FAIL LABELS cpython llvm c) # Test all four backends -RUN(NAME print_01 LABELS cpython llvm c wasm) # wasm not yet supports sep and end keywords +RUN(NAME print_01 LABELS cpython llvm c wasm wasm_x86 wasm_x64) RUN(NAME print_03 LABELS x86 c wasm wasm_x86 wasm_x64) # simple test case specifically for x86, wasm_x86 and wasm_x64 RUN(NAME print_04 LABELS cpython llvm c) RUN(NAME print_06 LABELS cpython llvm c)