Merge pull request #362 from diffblue/declaration-tests
Verilog: add tests for combiations of declarations
This commit is contained in:
commit
4ac2e38c98
|
@ -0,0 +1,8 @@
|
|||
KNOWNBUG
|
||||
enum_name_collision.sv
|
||||
|
||||
^EXIT=2$
|
||||
^SIGNAL=0$
|
||||
--
|
||||
--
|
||||
The name collision should be errored.
|
|
@ -0,0 +1,8 @@
|
|||
module main;
|
||||
|
||||
typedef enum { some_identifier } some_type;
|
||||
|
||||
// name collision
|
||||
wire some_identifier;
|
||||
|
||||
endmodule
|
|
@ -0,0 +1,7 @@
|
|||
CORE
|
||||
inout_and_reg.v
|
||||
|
||||
^file .* line 4: symbol `some_var' is declared both as input and as register$
|
||||
^EXIT=2$
|
||||
^SIGNAL=0$
|
||||
--
|
|
@ -0,0 +1,5 @@
|
|||
module main;
|
||||
// some_var must not be both an input and a reg
|
||||
inout [31:0] some_var;
|
||||
reg [31:0] some_var;
|
||||
endmodule
|
|
@ -0,0 +1,8 @@
|
|||
KNOWNBUG
|
||||
input_and_ansi_input.v
|
||||
|
||||
^EXIT=2$
|
||||
^SIGNAL=0$
|
||||
--
|
||||
--
|
||||
The redeclaration must be errored.
|
|
@ -0,0 +1,4 @@
|
|||
module main(input [31:0] some_var);
|
||||
// some_var must not be redeclared
|
||||
input [31:0] some_var;
|
||||
endmodule
|
|
@ -0,0 +1,8 @@
|
|||
KNOWNBUG
|
||||
input_and_output.v
|
||||
|
||||
^EXIT=2$
|
||||
^SIGNAL=0$
|
||||
--
|
||||
--
|
||||
This should be errored, as some_var must not be both input and output.
|
|
@ -0,0 +1,5 @@
|
|||
module main(x);
|
||||
// cannot declare both as input and output
|
||||
input [31:0] x;
|
||||
output [31:0] x;
|
||||
endmodule
|
|
@ -0,0 +1,7 @@
|
|||
CORE
|
||||
input_and_reg.v
|
||||
|
||||
^file .* line 4: symbol `some_var' is declared both as input and as register$
|
||||
^EXIT=2$
|
||||
^SIGNAL=0$
|
||||
--
|
|
@ -0,0 +1,5 @@
|
|||
module main;
|
||||
// some_var must not be both an input and a reg
|
||||
input [31:0] some_var;
|
||||
reg [31:0] some_var;
|
||||
endmodule
|
|
@ -0,0 +1,7 @@
|
|||
CORE
|
||||
parameter_name_collision.v
|
||||
|
||||
^file .* line 4: definition of symbol `p' conflicts with earlier definition at line 3$
|
||||
^EXIT=2$
|
||||
^SIGNAL=0$
|
||||
--
|
|
@ -0,0 +1,6 @@
|
|||
module main;
|
||||
|
||||
parameter p = 123;
|
||||
parameter p = 123;
|
||||
|
||||
endmodule
|
|
@ -0,0 +1,7 @@
|
|||
CORE
|
||||
wire_and_output.v
|
||||
--module M1
|
||||
^no properties$
|
||||
^EXIT=10$
|
||||
^SIGNAL=0$
|
||||
--
|
|
@ -0,0 +1,10 @@
|
|||
module M1(some_port);
|
||||
output [31:0] some_port;
|
||||
wire [31:0] some_port;
|
||||
endmodule
|
||||
|
||||
module M2(some_port);
|
||||
// order flipped
|
||||
wire [31:0] some_port;
|
||||
output [31:0] some_port;
|
||||
endmodule
|
|
@ -0,0 +1,8 @@
|
|||
KNOWNBUG
|
||||
wire_and_reg.v
|
||||
|
||||
^EXIT=2$
|
||||
^SIGNAL=0$
|
||||
--
|
||||
--
|
||||
This should be errored, as some_var must not be both wire and reg.
|
|
@ -0,0 +1,5 @@
|
|||
module main;
|
||||
// some_var must not be both wire and reg
|
||||
wire [31:0] some_var;
|
||||
reg [31:0] some_var;
|
||||
endmodule
|
|
@ -0,0 +1,8 @@
|
|||
KNOWNBUG
|
||||
input_and_reg.v
|
||||
|
||||
^EXIT=2$
|
||||
^SIGNAL=0$
|
||||
--
|
||||
--
|
||||
The redeclaration must be errored.
|
|
@ -0,0 +1,5 @@
|
|||
module main;
|
||||
// some_var must not be redeclared
|
||||
wire [31:0] some_var;
|
||||
wire [31:0] some_var;
|
||||
endmodule
|
|
@ -0,0 +1,9 @@
|
|||
KNOWNBUG
|
||||
task_name_collision.v
|
||||
|
||||
^definition of symbol `some_task' conflicts with earlier definition at line$
|
||||
^EXIT=2$
|
||||
^SIGNAL=0$
|
||||
--
|
||||
--
|
||||
The line number is missing.
|
|
@ -0,0 +1,13 @@
|
|||
module main;
|
||||
|
||||
reg [31:0] data;
|
||||
|
||||
task some_task;
|
||||
data = 123;
|
||||
endtask
|
||||
|
||||
task some_task;
|
||||
data = 456;
|
||||
endtask
|
||||
|
||||
endmodule
|
|
@ -0,0 +1,8 @@
|
|||
KNOWNBUG
|
||||
typedef_name_collision1.sv
|
||||
|
||||
^EXIT=2$
|
||||
^SIGNAL=0$
|
||||
--
|
||||
--
|
||||
The name collision should be errored.
|
|
@ -0,0 +1,8 @@
|
|||
module main;
|
||||
|
||||
typedef bit some_identifier;
|
||||
|
||||
// name collision
|
||||
typedef bit some_identifier;
|
||||
|
||||
endmodule
|
|
@ -0,0 +1,7 @@
|
|||
CORE
|
||||
typedef_name_collision2.sv
|
||||
|
||||
^file .* line 6: definition of symbol `some_identifier' conflicts with earlier definition at line 3$
|
||||
^EXIT=2$
|
||||
^SIGNAL=0$
|
||||
--
|
|
@ -0,0 +1,8 @@
|
|||
module main;
|
||||
|
||||
wire some_identifier;
|
||||
|
||||
// name collision
|
||||
typedef bit some_identifier;
|
||||
|
||||
endmodule
|
Loading…
Reference in New Issue