Skip to content

Commit f78666d

Browse files
Add test case for #2904
1 parent fb1ab45 commit f78666d

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

tests/Main.hs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -666,6 +666,7 @@ runClashTest = defaultMain
666666
, runTest "T2831" def{hdlLoad=[],hdlSim=[],hdlTargets=[VHDL]}
667667
, runTest "T2839" def{hdlLoad=[],hdlSim=[],hdlTargets=[VHDL]}
668668
, runTest "T2845" def{hdlSim=[],hdlTargets=[Verilog]}
669+
, runTest "T2904" def
669670
] <>
670671
if compiledWith == Cabal then
671672
-- This tests fails without environment files present, which are only

tests/shouldwork/Issues/T2904.hs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{-# LANGUAGE CPP #-}
2+
3+
module T2904 where
4+
5+
import Clash.Prelude
6+
import Clash.Explicit.Testbench
7+
8+
topEntity :: Vec 3 (Index 3)
9+
topEntity = case indicesI @3 of
10+
(Cons x xs) -> Cons maxBound xs
11+
{-# CLASH_OPAQUE topEntity #-}
12+
13+
testBench :: Signal System Bool
14+
testBench = done
15+
where
16+
done = outputVerifier' clk rst ((maxBound :> 1 :> 2 :> Nil) :> Nil) (pure topEntity)
17+
clk = tbSystemClockGen (not <$> done)
18+
rst = systemResetGen
19+
{-# CLASH_OPAQUE testBench #-}

0 commit comments

Comments
 (0)