Update the errorful rudiments.
Chris Pressey
2 years ago
|
0 |
// should fail analysis with an UnmeaningfulReadError
|
|
1 |
// because adding 4 to the accumulator reads the carry
|
|
2 |
// but the carry has neither been provided as input
|
|
3 |
// nor set to anything in particular by this routine.
|
|
4 |
|
0 | 5 |
define add_four routine
|
1 | 6 |
inputs a
|
2 | 7 |
outputs a
|
|
0 |
// should fail analysis with a RangeExceededError
|
|
1 |
// because the index is detected to fall outside the
|
|
2 |
// allowable range of the table it is indexing.
|
|
3 |
|
0 | 4 |
byte table[8] message : "WHAT?"
|
1 | 5 |
|
2 | 6 |
define main routine
|
0 | |
vector vec
|
|
0 |
// should fail analysis with a ConstantConstraintError
|
|
1 |
// because it cannot copy the address of `foo` into `vec`
|
|
2 |
// because it has incompatible constraints.
|
|
3 |
|
|
4 |
vector routine
|
1 | 5 |
inputs y
|
2 | 6 |
outputs y
|
3 | 7 |
trashes z, n
|
|
8 |
vec
|
4 | 9 |
|
5 | |
routine foo
|
|
10 |
define foo routine
|
6 | 11 |
inputs x
|
7 | 12 |
outputs x
|
8 | 13 |
trashes z, n
|
|
10 | 15 |
inc x
|
11 | 16 |
}
|
12 | 17 |
|
13 | |
routine main
|
|
18 |
define main routine
|
14 | 19 |
inputs foo
|
15 | 20 |
outputs vec
|
16 | 21 |
trashes a, z, n
|