aboutsummaryrefslogtreecommitdiffstats
path: root/tests/simple
diff options
context:
space:
mode:
Diffstat (limited to 'tests/simple')
-rw-r--r--tests/simple/ifdef_1.v88
-rw-r--r--tests/simple/ifdef_2.v21
2 files changed, 109 insertions, 0 deletions
diff --git a/tests/simple/ifdef_1.v b/tests/simple/ifdef_1.v
new file mode 100644
index 000000000..fa962355c
--- /dev/null
+++ b/tests/simple/ifdef_1.v
@@ -0,0 +1,88 @@
+module top(o1, o2, o3, o4);
+
+`define FAIL input wire not_a_port;
+
+`ifdef COND_1
+ `FAIL
+`elsif COND_2
+ `FAIL
+`elsif COND_3
+ `FAIL
+`elsif COND_4
+ `FAIL
+`else
+
+ `define COND_4
+ output wire o4;
+
+ `ifdef COND_1
+ `FAIL
+ `elsif COND_2
+ `FAIL
+ `elsif COND_3
+ `FAIL
+ `elsif COND_4
+
+ `define COND_3
+ output wire o3;
+
+ `ifdef COND_1
+ `FAIL
+ `elsif COND_2
+ `FAIL
+ `elsif COND_3
+
+ `define COND_2
+ output wire o2;
+
+ `ifdef COND_1
+ `FAIL
+ `elsif COND_2
+
+ `define COND_1
+ output wire o1;
+
+ `ifdef COND_1
+
+ `ifdef COND_1
+ `elsif COND_2
+ `FAIL
+ `elsif COND_3
+ `FAIL
+ `elsif COND_4
+ `FAIL
+ `else
+ `FAIL
+ `endif
+
+ `elsif COND_2
+ `FAIL
+ `elsif COND_3
+ `FAIL
+ `elsif COND_4
+ `FAIL
+ `else
+ `FAIL
+ `endif
+
+ `elsif COND_3
+ `FAIL
+ `elsif COND_4
+ `FAIL
+ `else
+ `FAIL
+ `endif
+
+ `elsif COND_4
+ `FAIL
+ `else
+ `FAIL
+ `endif
+
+ `else
+ `FAIL
+ `endif
+
+`endif
+
+endmodule
diff --git a/tests/simple/ifdef_2.v b/tests/simple/ifdef_2.v
new file mode 100644
index 000000000..6dd89efed
--- /dev/null
+++ b/tests/simple/ifdef_2.v
@@ -0,0 +1,21 @@
+module top(o1, o2, o3);
+
+output wire o1;
+
+`define COND_1
+`define COND_2
+`define COND_3
+
+`ifdef COND_1
+ output wire o2;
+`elsif COND_2
+ input wire dne1;
+`elsif COND_3
+ input wire dne2;
+`else
+ input wire dne3;
+`endif
+
+output wire o3;
+
+endmodule