aboutsummaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'src/test')
-rw-r--r--src/test/scala/firrtlTests/AsyncResetSpec.scala2
-rw-r--r--src/test/scala/firrtlTests/ConstantPropagationTests.scala10
2 files changed, 11 insertions, 1 deletions
diff --git a/src/test/scala/firrtlTests/AsyncResetSpec.scala b/src/test/scala/firrtlTests/AsyncResetSpec.scala
index 29c09787..65c68b27 100644
--- a/src/test/scala/firrtlTests/AsyncResetSpec.scala
+++ b/src/test/scala/firrtlTests/AsyncResetSpec.scala
@@ -278,7 +278,7 @@ class AsyncResetSpec extends FirrtlFlatSpec {
|z <= r""".stripMargin
)
fixedResult should containLine ("always @(posedge clock or posedge reset) begin")
- fixedResult should containLine ("r <= -2'sh2;")
+ fixedResult should containLine ("r <= 2'sh2;")
val intervalResult = compileBody(s"""
|input clock : Clock
diff --git a/src/test/scala/firrtlTests/ConstantPropagationTests.scala b/src/test/scala/firrtlTests/ConstantPropagationTests.scala
index 32303949..131f9466 100644
--- a/src/test/scala/firrtlTests/ConstantPropagationTests.scala
+++ b/src/test/scala/firrtlTests/ConstantPropagationTests.scala
@@ -1604,4 +1604,14 @@ class ConstantPropagationEquivalenceSpec extends FirrtlFlatSpec {
| out <= head_temp""".stripMargin
firrtlEquivalenceTest(input, transforms)
}
+
+ "addition of negative literals" should "be propagated" in {
+ val input =
+ s"""circuit AddTester :
+ | module AddTester :
+ | output ref : SInt<2>
+ | ref <= add(SInt<1>("h-1"), SInt<1>("h-1"))
+ |""".stripMargin
+ firrtlEquivalenceTest(input, transforms)
+ }
}