preproc: test coverage for #2712
authorZachary Snow <zach@zachjs.com>
Tue, 30 Mar 2021 13:38:00 +0000 (09:38 -0400)
committerZachary Snow <zachary.j.snow@gmail.com>
Tue, 30 Mar 2021 16:23:18 +0000 (12:23 -0400)
tests/verilog/ifdef_nest.ys [new file with mode: 0644]
tests/verilog/ifdef_unterminated.ys [new file with mode: 0644]
tests/verilog/unmatched_endif_2.ys [new file with mode: 0644]

diff --git a/tests/verilog/ifdef_nest.ys b/tests/verilog/ifdef_nest.ys
new file mode 100644 (file)
index 0000000..2202109
--- /dev/null
@@ -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 (file)
index 0000000..ce511fa
--- /dev/null
@@ -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 (file)
index 0000000..2ee0841
--- /dev/null
@@ -0,0 +1,7 @@
+logger -expect error "Found `endif outside of macro conditional branch!" 1
+read_verilog <<EOF
+`ifndef a
+`else
+`endif
+`endif
+EOF