Added some testcases for the correct use of the right pragma (of SHARED and PERMITALIASES)
This commit is contained in:
parent
81959bd76b
commit
05c87e6935
|
@ -467,7 +467,8 @@ checkParAssignUsage g = mapM_ checkParAssign . findAllProcess isParAssign g
|
|||
mockedupParItems = fmap ((,) bk) $ ParItems [SeqItems [Usage Nothing Nothing Nothing
|
||||
$ processVarW v Nothing] | v <- vs]
|
||||
|
||||
|
||||
-- TODO for this pass, make the usage checker examine the PERMITALIASES pragma
|
||||
-- instead of SHARED
|
||||
checkProcCallArgsUsage :: forall m t. (CSMR m, Die m, MonadIO m, Data t) =>
|
||||
FlowGraph' m (BK, UsageLabel) t -> A.Structured t -> m ()
|
||||
checkProcCallArgsUsage g = mapM_ checkArgs . findAllProcess isProcCall g
|
||||
|
|
|
@ -106,6 +106,7 @@ viotests v = liftM (TestLabel "CheckTest" . TestList) $ sequence
|
|||
[
|
||||
return testUnusedVar
|
||||
,automaticTest FrontendOccam v "testcases/automatic/abbrev-check-1.occ.test"
|
||||
,automaticTest FrontendOccam v "testcases/automatic/pragma-1.occ.test"
|
||||
]
|
||||
|
||||
|
||||
|
|
43
testcases/automatic/pragma-1.occ.test
Normal file
43
testcases/automatic/pragma-1.occ.test
Normal file
|
@ -0,0 +1,43 @@
|
|||
-- This file tests PRAGMAs for SHARED and PERMITALIASES
|
||||
|
||||
PROC p(INT x, INT y, CHAN INT c)
|
||||
SKIP
|
||||
:
|
||||
|
||||
PROC m()
|
||||
INT x:
|
||||
INT y:
|
||||
CHAN INT c:
|
||||
%%
|
||||
PAR
|
||||
c ! 3
|
||||
p(x,x,c)
|
||||
y := 3
|
||||
y := 4
|
||||
:
|
||||
|
||||
%PASS Correct pragmas
|
||||
#PRAGMA SHARED c, y
|
||||
#PRAGMA PERMITALIASES x
|
||||
%PASS Correct pragmas #2
|
||||
#PRAGMA SHARED c, y, x
|
||||
#PRAGMA PERMITALIASES x
|
||||
%PASS Correct pragmas #3
|
||||
#PRAGMA SHARED c, y, x
|
||||
#PRAGMA PERMITALIASES x, c, y
|
||||
%FAIL Incorrect pragmas #1
|
||||
|
||||
%FAIL Incorrect pragmas #2
|
||||
#PRAGMA SHARED c, y
|
||||
%FAIL Incorrect pragmas #3
|
||||
#PRAGMA SHARED c
|
||||
#PRAGMA PERMITALIASES x
|
||||
%FAIL Incorrect pragmas #4
|
||||
#PRAGMA SHARED c, y, x
|
||||
%FAIL Incorrect pragmas #5
|
||||
#PRAGMA SHARED c
|
||||
#PRAGMA PERMITALIASES x, y
|
||||
%FAIL Incorrect pragmas #6
|
||||
#PRAGMA SHARED y
|
||||
#PRAGMA PERMITALIASES x, c
|
||||
%
|
Loading…
Reference in New Issue
Block a user