From 9c4f977416fa516500fd21da74ee98af7f20d3ca Mon Sep 17 00:00:00 2001 From: Neil Brown Date: Sat, 6 Oct 2007 23:50:20 +0000 Subject: [PATCH] Added tests for channels carrying counted arrays of arrays for the C and C++ backends --- backends/GenerateCTest.hs | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/backends/GenerateCTest.hs b/backends/GenerateCTest.hs index 1800aa7..e0cda26 100644 --- a/backends/GenerateCTest.hs +++ b/backends/GenerateCTest.hs @@ -715,8 +715,11 @@ testOutput = TestList --A counted array: ,testOutputItem 206 "ChanOutInt(#,x);ChanOut(#,xs,x*^);" "#<writer(),$);@->writer()<<$;", "tockSendInt(@,$);@<<$;") - (A.OutCounted emptyMeta (exprVariable "x") (exprVariable "xs")) (A.Counted A.Int (A.Array [A.Dimension 8] A.Int)) + --A counted array of arrays: + ,testOutputItem 207 "ChanOutInt(#,x);ChanOut(#,xs,x*^);" "#< String -> String -> A.OutputItem -> A.Type -> Test @@ -749,8 +755,10 @@ testOutput = TestList state dir = do defineName (simpleName "c") $ simpleDefDecl "c" (A.Chan dir (A.ChanAttributes False False) ct) case t of A.Counted t t' -> do defineName (simpleName "x") $ simpleDefDecl "x" t - defineName (simpleName "xs") $ simpleDefDecl "xs" (A.Array [A.Dimension 6] t') + defineName (simpleName "xs") $ simpleDefDecl "xs" (mkArray t') _ -> defineName (simpleName "x") $ simpleDefDecl "x" t + mkArray (A.Array ds t) = A.Array (A.Dimension 6:ds) t + mkArray t = A.Array [A.Dimension 6] t chan = simpleName "c" chanOut = simpleName "cOut"