aboutsummaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorKevin Laeufer2021-02-17 14:42:45 -0800
committerGitHub2021-02-17 22:42:45 +0000
commitedb91f7bc613026f824519786c3ce25740bb21c3 (patch)
tree89efd1667fb31289ba1f04808b8398780026b2b1 /src/test
parent5a89fca6090948d0a99c217a09c692e58a20d1df (diff)
ExpandWhens: ensure that statement names are maintained (#2082)
Diffstat (limited to 'src/test')
-rw-r--r--src/test/scala/firrtlTests/ExpandWhensSpec.scala18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/test/scala/firrtlTests/ExpandWhensSpec.scala b/src/test/scala/firrtlTests/ExpandWhensSpec.scala
index c186b516..3c685734 100644
--- a/src/test/scala/firrtlTests/ExpandWhensSpec.scala
+++ b/src/test/scala/firrtlTests/ExpandWhensSpec.scala
@@ -142,10 +142,24 @@ class ExpandWhensSpec extends FirrtlFlatSpec {
| input in : UInt<32>
| input p : UInt<1>
| when p :
- | assert(clock, eq(in, UInt<1>("h1")), UInt<1>("h1"), "assert0")
+ | assert(clock, eq(in, UInt<1>("h1")), UInt<1>("h1"), "assert0") : test_assert
| else :
| skip""".stripMargin
- val check = "assert(clock, eq(in, UInt<1>(\"h1\")), and(and(UInt<1>(\"h1\"), p), UInt<1>(\"h1\")), \"assert0\")"
+ val check = "assert(clock, eq(in, UInt<1>(\"h1\")), and(and(UInt<1>(\"h1\"), p), UInt<1>(\"h1\")), \"assert0\") : test_assert"
+ executeTest(input, check, true)
+ }
+ it should "handle stops" in {
+ val input =
+ """circuit Test :
+ | module Test :
+ | input clock : Clock
+ | input in : UInt<32>
+ | input p : UInt<1>
+ | when p :
+ | stop(clock, UInt(1), 1) : test_stop
+ | else :
+ | skip""".stripMargin
+ val check = """stop(clock, and(and(UInt<1>("h1"), p), UInt<1>("h1")), 1) : test_stop"""
executeTest(input, check, true)
}
}