1// DESCRIPTION: Verilator:
2//  Test an error where a shift amount was out of bounds and the compiler treats the
3//  value as undefined (Issue #803)
4//
5// This file ONLY is placed into the Public Domain, for any use,
6// without warranty, 2014 by Jeff Bush.
7// SPDX-License-Identifier: CC0-1.0
8
9module t (/*AUTOARG*/
10    // Inputs
11    clk
12    );
13    input clk;
14
15    struct packed {
16	logic flag;
17	logic [130:0] data;
18    } foo[1];
19
20    integer cyc = 0;
21
22    // Test loop
23    always @ (posedge clk) begin
24	cyc <= cyc + 1;
25	foo[0].data <= 0;
26	foo[0].flag <= !foo[0].flag;
27	if (cyc==10) begin
28	   if (foo[0].data != 0) begin
29	   	$display("bad data value %x", foo[0].data);
30		$stop;
31	   end
32	   $write("*-* All Finished *-*\n");
33	   $finish;
34	end
35    end
36endmodule
37