summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/test/scala/chiselTests/CompatibilitySpec.scala22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/test/scala/chiselTests/CompatibilitySpec.scala b/src/test/scala/chiselTests/CompatibilitySpec.scala
index 2fa936ed..81c97ee9 100644
--- a/src/test/scala/chiselTests/CompatibilitySpec.scala
+++ b/src/test/scala/chiselTests/CompatibilitySpec.scala
@@ -481,4 +481,26 @@ class CompatibiltySpec extends ChiselFlatSpec with GeneratorDrivenPropertyChecks
elaborate(new Foo)
}
+ behavior of "Wire"
+
+ it should "support legacy methods" in {
+ class Foo extends Module {
+ val io = IO(new Bundle{})
+
+ info("apply[T <: Data](dummy: Int = 0, init: T): T works")
+ val first = Wire(init=UInt("hdeadbeef"))
+ first shouldBe a [UInt]
+
+ info("apply[T <: Data](t: T, init: T): T works")
+ val second = Wire(SInt(), SInt(-100))
+ second shouldBe a [SInt]
+
+ info("apply[T <: Data](t: T, init: DontCare.type): T works")
+ val third = Wire(UInt(), chisel3.DontCare)
+ third shouldBe a [UInt]
+ }
+
+ elaborate(new Foo)
+ }
+
}