tock-mirror/testcases/fold-sizes.occ
Adam Sampson 8b3eba594d Add SubscriptCheck field to SubscriptFromFor etc.
This makes it possible to mark a slice as not needing runtime
checking, which is immediately useful for _sizes arrays.

This fixes cgtest03, which was previously failing to compile because
the _sizes array for one of the constants in it contained a runtime
check and thus wasn't itself constant. I've added a testcase file for
the relevant bit of code.
2008-05-26 17:36:26 +00:00

11 lines
208 B
Plaintext

-- Test that _sizes arrays for constants are themselves constant.
-- (This testcase taken from cgtest03.)
PROC p ()
[10]BYTE dest:
INT y:
SEQ
y := 5
s IS [dest FROM 2 FOR y]:
s := "hello"
: