summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/test/scala/chiselTests/AutoClonetypeSpec.scala22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/test/scala/chiselTests/AutoClonetypeSpec.scala b/src/test/scala/chiselTests/AutoClonetypeSpec.scala
index 88f6378b..d5607dc1 100644
--- a/src/test/scala/chiselTests/AutoClonetypeSpec.scala
+++ b/src/test/scala/chiselTests/AutoClonetypeSpec.scala
@@ -196,4 +196,26 @@ class AutoClonetypeSpec extends ChiselFlatSpec with Utils {
} }
}
}
+
+ "Wrapped IO construction without parent reference" should "not fail for autoclonetype" in {
+ class TestModule extends MultiIOModule {
+ def thunk[T](f: => T): T = f
+ val works = thunk(IO(new Bundle {
+ val x = Output(UInt(3.W))
+ }))
+ }
+ ChiselStage.elaborate { new TestModule }
+ }
+
+ "Wrapped IO construction with parent references" should "not fail for autoclonetype" in {
+ class TestModule(blah: Int) extends MultiIOModule {
+ // Note that this currently fails only if f: =>T on Scala 2.11.12
+ // This works successfully with 2.12.11
+ def thunk[T](f: => T): T = f
+ val broken = thunk(IO(new Bundle {
+ val x = Output(UInt(blah.W))
+ }))
+ }
+ ChiselStage.elaborate { new TestModule(3) }
+ }
}