From 9bd94be5d208921c32930e6d9e8e5f315c96c37a Mon Sep 17 00:00:00 2001 From: Todd Strader Date: Wed, 1 Apr 2020 11:49:45 -0400 Subject: [PATCH] case test --- test_regress/t/t_type_comparison.v | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/test_regress/t/t_type_comparison.v b/test_regress/t/t_type_comparison.v index 07daa232c..285d8a647 100644 --- a/test_regress/t/t_type_comparison.v +++ b/test_regress/t/t_type_comparison.v @@ -91,10 +91,10 @@ module t(); // TODO -- this (6.22.1 h) //import the_pkg::*; + bit should_be_true; + initial begin if (type(shortint) != type(shortint_v)) $stop(); - if (type(shortint) !== type(shortint_v)) $stop(); - if (type(int) === type(shortint_v)) $stop(); if (type(int) != type(int_v)) $stop(); if (type(longint) != type(longint_v)) $stop(); if (type(byte) != type(byte_v)) $stop(); @@ -120,6 +120,7 @@ module t(); if (type(MY_CHAR) != type(byte)) $stop(); // TODO -- the rest // TODO -- case equal/not equal, ===, !=== + // TODO -- generate case // TODO -- test associative arrays // TODO -- test dynamic arrays // TODO -- test unsized arrays @@ -127,6 +128,18 @@ module t(); // TODO -- test queues // TODO -- test structs, enums and unions // TODO -- test struct member vs type + + if (type(shortint) !== type(shortint_v)) $stop(); + if (type(int) === type(shortint_v)) $stop(); + + should_be_true = '0; + case (type(shortint_v)) + type(shortint): should_be_true = '1; + type(int): $stop(); + default: $stop(); + endcase + + if (!should_be_true) $stop(); end