2023-02-01 04:41:45 +01:00
// DESCRIPTION: Verilator: Verilog Test module
//
2026-01-27 02:24:34 +01:00
// This file ONLY is placed under the Creative Commons Public Domain.
// SPDX-FileCopyrightText: 2020 Wilson Snyder
2023-02-01 04:41:45 +01:00
// SPDX-License-Identifier: CC0-1.0
`define stop $stop
`define checkh(gotv,expv) do if ((gotv) !== (expv)) begin $write("%%Error: %s:%0d: got='h%x exp='h%x\n", `__FILE__,`__LINE__, (gotv), (expv)); `stop; end while(0)
2025-09-13 15:28:43 +02:00
module t ;
2023-02-01 04:41:45 +01:00
int a1 [ ] = ' { 12 , 13 } ;
int a2 [ ] = { 14 , 15 } ;
int a3 [ ] = ' { 16 } ;
int a4 [ ] = { 17 } ;
2024-04-18 18:53:23 +02:00
int a5 [ ] = { } ;
2023-02-01 04:41:45 +01:00
initial begin
`checkh ( a1 . size , 2 ) ;
`checkh ( a1 [ 0 ] , 12 ) ;
`checkh ( a1 [ 1 ] , 13 ) ;
`checkh ( a2 . size , 2 ) ;
`checkh ( a2 [ 0 ] , 14 ) ;
`checkh ( a2 [ 1 ] , 15 ) ;
`checkh ( a3 . size , 1 ) ;
`checkh ( a3 [ 0 ] , 16 ) ;
`checkh ( a4 . size , 1 ) ;
`checkh ( a4 [ 0 ] , 17 ) ;
2024-04-18 18:53:23 +02:00
`checkh ( a5 . size , 0 ) ;
2023-02-01 04:41:45 +01:00
$write ( " *-* All Finished *-* \n " ) ;
$finish ;
end
endmodule