summaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'src/test')
-rw-r--r--src/test/scala/chiselTests/SwitchSpec.scala18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/test/scala/chiselTests/SwitchSpec.scala b/src/test/scala/chiselTests/SwitchSpec.scala
index 78e5d59e..12bbb9e7 100644
--- a/src/test/scala/chiselTests/SwitchSpec.scala
+++ b/src/test/scala/chiselTests/SwitchSpec.scala
@@ -32,4 +32,22 @@ class SwitchSpec extends ChiselFlatSpec with Utils {
})
}
}
+ it should "provide useful source locators" in {
+ val chirrtl = ChiselStage.emitChirrtl(new Module {
+ val io = IO(new Bundle {
+ val in = Input(UInt(2.W))
+ val out = Output(UInt(2.W))
+ })
+
+ io.out := 0.U
+ switch (io.in) {
+ is (0.U) { io.out := 3.U }
+ is (1.U) { io.out := 0.U }
+ is (2.U) { io.out := 1.U }
+ is (3.U) { io.out := 3.U }
+ }
+ })
+
+ chirrtl should not include "Conditional.scala"
+ }
}