aboutsummaryrefslogtreecommitdiffstats
path: root/tests/various
diff options
context:
space:
mode:
authorN. Engelhardt <nak@yosyshq.com>2022-02-18 17:13:09 +0100
committerN. Engelhardt <nak@yosyshq.com>2022-02-18 17:13:09 +0100
commit8fd1b062491f9ba1f0aed570086e7697731502d4 (patch)
tree79837b6f19a083cac3578473769420e2c8c4b1e0 /tests/various
parent15860000487e2d6748843888b78289f95f3ea46b (diff)
downloadyosys-8fd1b062491f9ba1f0aed570086e7697731502d4.tar.gz
yosys-8fd1b062491f9ba1f0aed570086e7697731502d4.tar.bz2
yosys-8fd1b062491f9ba1f0aed570086e7697731502d4.zip
fix handling of escaped chars in json backend and frontend
Diffstat (limited to 'tests/various')
-rw-r--r--tests/various/.gitignore1
-rw-r--r--tests/various/json_escape_chars.ys14
2 files changed, 15 insertions, 0 deletions
diff --git a/tests/various/.gitignore b/tests/various/.gitignore
index 2bb6c7179..c6373468a 100644
--- a/tests/various/.gitignore
+++ b/tests/various/.gitignore
@@ -5,3 +5,4 @@
/run-test.mk
/plugin.so
/plugin.so.dSYM
+/temp
diff --git a/tests/various/json_escape_chars.ys b/tests/various/json_escape_chars.ys
new file mode 100644
index 000000000..f118357c0
--- /dev/null
+++ b/tests/various/json_escape_chars.ys
@@ -0,0 +1,14 @@
+! mkdir -p temp
+read_verilog <<EOT
+(* src = "\042 \057 \134 \010 \014 \012 \015 \011 \025 \033" *)
+module foo;
+endmodule
+EOT
+write_json temp/test_escapes.json
+design -reset
+read_json temp/test_escapes.json
+write_json temp/test_escapes.json
+design -reset
+read_json temp/test_escapes.json
+write_rtlil temp/test_escapes.json.il
+! grep -F 'attribute \src "\" / \\ \010 \014 \n \015 \t \025 \033"' temp/test_escapes.json.il