mirror of
				https://github.com/YosysHQ/yosys
				synced 2025-11-04 05:19:11 +00:00 
			
		
		
		
	Add test for typenames using constants shadowed later on
This possible edge case came up while reviewing #3555. It is currently handled correctly, but there is no clear test coverage.
This commit is contained in:
		
							parent
							
								
									5ea2c290a5
								
							
						
					
					
						commit
						26a6c60478
					
				
					 2 changed files with 16 additions and 0 deletions
				
			
		
							
								
								
									
										12
									
								
								tests/verilog/typedef_const_shadow.sv
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										12
									
								
								tests/verilog/typedef_const_shadow.sv
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,12 @@
 | 
			
		|||
module top;
 | 
			
		||||
    localparam W = 5;
 | 
			
		||||
    typedef logic [W-1:0] T;
 | 
			
		||||
    T x; // width 5
 | 
			
		||||
    if (1) begin : blk
 | 
			
		||||
        localparam W = 10;
 | 
			
		||||
        typedef T U;
 | 
			
		||||
        typedef logic [W-1:0] V;
 | 
			
		||||
        U y; // width 5
 | 
			
		||||
        V z; // width 10
 | 
			
		||||
    end
 | 
			
		||||
endmodule
 | 
			
		||||
							
								
								
									
										4
									
								
								tests/verilog/typedef_const_shadow.ys
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										4
									
								
								tests/verilog/typedef_const_shadow.ys
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,4 @@
 | 
			
		|||
read_verilog -sv typedef_const_shadow.sv
 | 
			
		||||
select -assert-count 1 w:x s:5 %i
 | 
			
		||||
select -assert-count 1 w:blk.y s:5 %i
 | 
			
		||||
select -assert-count 1 w:blk.z s:10 %i
 | 
			
		||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue