summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/test/scala/chiselTests/RebindingSpec.scala27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/test/scala/chiselTests/RebindingSpec.scala b/src/test/scala/chiselTests/RebindingSpec.scala
new file mode 100644
index 00000000..dddf26b6
--- /dev/null
+++ b/src/test/scala/chiselTests/RebindingSpec.scala
@@ -0,0 +1,27 @@
+// See LICENSE for license details.
+
+package chiselTests
+
+import chisel3._
+
+class RebindingSpec extends ChiselFlatSpec {
+ "Rebinding a literal" should "fail" in {
+ a [chisel3.core.Binding.BindingException] should be thrownBy {
+ elaborate { new Module {
+ val io = IO(new Bundle {
+ val a = 4.U
+ })
+ } }
+ }
+ }
+
+ "Rebinding a hardware type" should "fail" in {
+ a [chisel3.core.Binding.BindingException] should be thrownBy {
+ elaborate { new Module {
+ val io = IO(new Bundle {
+ val a = Reg(UInt(32.W))
+ })
+ } }
+ }
+ }
+}