aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZachary Snow <zach@zachjs.com>2021-03-30 09:38:00 -0400
committerZachary Snow <zachary.j.snow@gmail.com>2021-03-30 12:23:18 -0400
commit0ccc7229c02449618209a20d66b9fa07e3ea79f2 (patch)
tree6ac36dc69aa19888ccd3046f13641887722dc997
parentb7ea71e6e39dfda903e1060e1b254ce0002fcf0d (diff)
downloadyosys-0ccc7229c02449618209a20d66b9fa07e3ea79f2.tar.gz
yosys-0ccc7229c02449618209a20d66b9fa07e3ea79f2.tar.bz2
yosys-0ccc7229c02449618209a20d66b9fa07e3ea79f2.zip
preproc: test coverage for #2712
-rw-r--r--tests/verilog/ifdef_nest.ys7
-rw-r--r--tests/verilog/ifdef_unterminated.ys4
-rw-r--r--tests/verilog/unmatched_endif_2.ys7
3 files changed, 18 insertions, 0 deletions
diff --git a/tests/verilog/ifdef_nest.ys b/tests/verilog/ifdef_nest.ys
new file mode 100644
index 000000000..2202109aa
--- /dev/null
+++ b/tests/verilog/ifdef_nest.ys
@@ -0,0 +1,7 @@
+read_verilog <<EOF
+`ifndef a
+`ifdef b
+`endif
+`else
+`endif
+EOF
diff --git a/tests/verilog/ifdef_unterminated.ys b/tests/verilog/ifdef_unterminated.ys
new file mode 100644
index 000000000..ce511fa8f
--- /dev/null
+++ b/tests/verilog/ifdef_unterminated.ys
@@ -0,0 +1,4 @@
+logger -expect error "Unterminated preprocessor conditional!" 1
+read_verilog <<EOF
+`ifndef a
+EOF
diff --git a/tests/verilog/unmatched_endif_2.ys b/tests/verilog/unmatched_endif_2.ys
new file mode 100644
index 000000000..2ee084170
--- /dev/null
+++ b/tests/verilog/unmatched_endif_2.ys
@@ -0,0 +1,7 @@
+logger -expect error "Found `endif outside of macro conditional branch!" 1
+read_verilog <<EOF
+`ifndef a
+`else
+`endif
+`endif
+EOF