A couple more testcases

This commit is contained in:
Adam Sampson 2007-04-19 16:43:42 +00:00
parent e610e85a8a
commit 124cf8f433
2 changed files with 50 additions and 0 deletions

View File

@ -0,0 +1,24 @@
PROC P ()
INT X:
SEQ
X := 42
-- These should be pulled out of the proc...
VAL INT a IS 42:
VAL INT b IS a + 1:
VAL INT c IS a + b:
VAL []INT d IS [1, 2, 3, 4]:
VAL INT e IS d[2]:
VAL INT32 f RETYPES a:
VAL INT g IS BYTESIN (a):
-- ... and these shouldn't.
INT A:
VAL INT B IS A:
VAL INT C IS X:
VAL []INT D IS [1, 2, X, 4]:
VAL INT E IS D[2]: -- technically the others should be OK, but I think that's excessive analysis!
INT32 F RETYPES A:
VAL INT G IS BYTESIN (E):
SKIP
:

View File

@ -0,0 +1,26 @@
PROC A ([]INT a1)
SKIP
:
PROC B (VAL [][]INT a2)
SKIP
:
PROC P ()
INT zero:
[10]INT one:
[10][10]INT two:
[10][10][10]INT three:
SEQ
zero := 42
one[1] := zero
zero := one[1]
two[1][2] := zero
zero := two[1][2]
three[1][2][3] := zero
zero := three[1][2][3]
A (one)
A (two[1])
A (three[1][2])
B (two)
B (three[1])
: