281 lines
3.9 KiB
Plaintext
281 lines
3.9 KiB
Plaintext
-- This file tests the inferring of output direction specifiers for PROCs
|
|
|
|
PROC foo(CHAN INT c)
|
|
%%
|
|
:
|
|
|
|
PROC main()
|
|
CHAN INT c:
|
|
%%M
|
|
:
|
|
|
|
%PASS Skip body
|
|
SKIP
|
|
%M
|
|
foo(c)
|
|
|
|
%FAIL Skip body, with input direction
|
|
SKIP
|
|
%M
|
|
foo(c?)
|
|
|
|
%FAIL Skip body, with output direction
|
|
SKIP
|
|
%M
|
|
foo(c!)
|
|
|
|
%PASS Output body, with no direction
|
|
c ! 3
|
|
%M
|
|
foo(c)
|
|
|
|
%FAIL Output body, with input direction
|
|
c ! 3
|
|
%M
|
|
foo(c?)
|
|
|
|
%PASS Output body, with output direction
|
|
c ! 3
|
|
%M
|
|
foo(c!)
|
|
|
|
%PASS Input body, with no direction
|
|
INT x:
|
|
c ? x
|
|
%M
|
|
foo(c)
|
|
|
|
%PASS Input body, with input direction
|
|
INT x:
|
|
c ? x
|
|
%M
|
|
foo(c?)
|
|
|
|
%FAIL Input body, with output direction
|
|
INT x:
|
|
c ? x
|
|
%M
|
|
foo(c!)
|
|
|
|
%PASS Input and output body, with no direction
|
|
SEQ
|
|
c ! 3
|
|
INT x:
|
|
c ? x
|
|
%M
|
|
foo(c)
|
|
|
|
%FAIL Input and output body, with input direction
|
|
SEQ
|
|
c ! 3
|
|
INT x:
|
|
c ? x
|
|
%M
|
|
foo(c?)
|
|
|
|
%FAIL Input and output body, with output direction
|
|
SEQ
|
|
c ! 3
|
|
INT x:
|
|
c ? x
|
|
%M
|
|
foo(c!)
|
|
|
|
%PASS Output body abbrev, with no direction
|
|
CHAN INT d IS c:
|
|
d ! 3
|
|
%M
|
|
foo(c)
|
|
|
|
%FAIL Output body abbrev, with input direction
|
|
CHAN INT d IS c:
|
|
d ! 3
|
|
%M
|
|
foo(c?)
|
|
|
|
%PASS Output body abbrev, with output direction
|
|
CHAN INT d IS c:
|
|
d ! 3
|
|
%M
|
|
foo(c!)
|
|
|
|
%PASS Output body abbrev dir, with no direction
|
|
CHAN INT d! IS c:
|
|
d ! 3
|
|
%M
|
|
foo(c)
|
|
|
|
%FAIL Output body abbrev dir, with input direction
|
|
CHAN INT d! IS c:
|
|
d ! 3
|
|
%M
|
|
foo(c?)
|
|
|
|
%PASS Output body abbrev dir, with output direction
|
|
CHAN INT d! IS c:
|
|
d ! 3
|
|
%M
|
|
foo(c!)
|
|
|
|
|
|
%PASS Output body abbrev array, with no direction
|
|
[]CHAN INT d IS [c]:
|
|
d[0] ! 3
|
|
%M
|
|
foo(c)
|
|
|
|
%FAIL Output body abbrev array, with input direction
|
|
[]CHAN INT d IS [c]:
|
|
d[0] ! 3
|
|
%M
|
|
foo(c?)
|
|
|
|
%PASS Output body abbrev array, with output direction
|
|
[]CHAN INT d IS [c]:
|
|
d[0] ! 3
|
|
%M
|
|
foo(c!)
|
|
|
|
%PASS Output body abbrev array B, with no direction
|
|
[]CHAN INT d! IS [c]:
|
|
d[0] ! 3
|
|
%M
|
|
foo(c)
|
|
|
|
%FAIL Output body abbrev array B, with input direction
|
|
[]CHAN INT d! IS [c]:
|
|
d[0] ! 3
|
|
%M
|
|
foo(c?)
|
|
|
|
%PASS Output body abbrev array B, with output direction
|
|
[]CHAN INT d! IS [c]:
|
|
d[0] ! 3
|
|
%M
|
|
foo(c!)
|
|
|
|
%PASS Output body abbrev array C, with no direction
|
|
[]CHAN INT d! IS [c!]:
|
|
d[0] ! 3
|
|
%M
|
|
foo(c)
|
|
|
|
%FAIL Output body abbrev array C, with input direction
|
|
[]CHAN INT d! IS [c!]:
|
|
d[0] ! 3
|
|
%M
|
|
foo(c?)
|
|
|
|
%PASS Output body abbrev array C, with output direction
|
|
[]CHAN INT d! IS [c!]:
|
|
d[0] ! 3
|
|
%M
|
|
foo(c!)
|
|
|
|
%PASS Both body abbrev, with no direction
|
|
CHAN INT d IS c:
|
|
SEQ
|
|
d ! 3
|
|
INT x:
|
|
d ? x
|
|
%M
|
|
foo(c)
|
|
|
|
%FAIL Both body abbrev, with input direction
|
|
CHAN INT d IS c:
|
|
SEQ
|
|
d ! 3
|
|
INT x:
|
|
d ? x
|
|
%M
|
|
foo(c?)
|
|
|
|
%FAIL Both body abbrev, with output direction
|
|
CHAN INT d IS c:
|
|
SEQ
|
|
d ! 3
|
|
INT x:
|
|
d ? x
|
|
%M
|
|
foo(c!)
|
|
|
|
%PASS Both body sep abbrev, with no direction
|
|
CHAN INT d IS c!:
|
|
SEQ
|
|
d ! 3
|
|
CHAN INT e IS c?:
|
|
INT x:
|
|
e ? x
|
|
%M
|
|
foo(c)
|
|
|
|
%FAIL Both body sep abbrev, with input direction
|
|
CHAN INT d IS c!:
|
|
SEQ
|
|
d ! 3
|
|
CHAN INT e IS c?:
|
|
INT x:
|
|
e ? x
|
|
%M
|
|
foo(c?)
|
|
|
|
%FAIL Both body sep abbrev, with output direction
|
|
CHAN INT d IS c!:
|
|
SEQ
|
|
d ! 3
|
|
CHAN INT e IS c?:
|
|
INT x:
|
|
e ? x
|
|
%M
|
|
foo(c!)
|
|
|
|
%PASS Inner PROC that writes, no name capture, no original direction
|
|
PROC inner(CHAN INT d)
|
|
d ! 3
|
|
:
|
|
inner(c)
|
|
%M
|
|
foo(c)
|
|
|
|
%PASS Inner PROC that writes, no name capture, original output direction
|
|
PROC inner(CHAN INT d)
|
|
d ! 3
|
|
:
|
|
inner(c)
|
|
%M
|
|
foo(c!)
|
|
|
|
%FAIL Inner PROC that writes, no name capture, original input direction
|
|
PROC inner(CHAN INT d)
|
|
d ! 3
|
|
:
|
|
inner(c)
|
|
%M
|
|
foo(c?)
|
|
|
|
%PASS Inner PROC that writes using name capture, no original direction
|
|
PROC inner()
|
|
c ! 3
|
|
:
|
|
inner()
|
|
%M
|
|
foo(c)
|
|
|
|
%PASS Inner PROC that writes using name capture, original output direction
|
|
PROC inner()
|
|
c ! 3
|
|
:
|
|
inner()
|
|
%M
|
|
foo(c!)
|
|
|
|
%FAIL Inner PROC that writes using name capture, original input direction
|
|
PROC inner()
|
|
c ! 3
|
|
:
|
|
inner()
|
|
%M
|
|
foo(c?)
|
|
|
|
%
|