omega-mv
Omega: a language for verified programs, semantic identity and machine realization. Seed-born work and existing implementations have distinct provenance.
Brought by drakestapleton
omega-mv / seed / spirv / traps.unit.om
| 1 | note Nested calls must preserve the callee's first trap, not execute the caller's later trap. |
| 2 | fn failval x uint to uint |
| 3 | if eq x 0 |
| 4 | trap 5 |
| 5 | end |
| 6 | ret x |
| 7 | end |
| 8 | fn nestedfail x uint to uint |
| 9 | y = failval x |
| 10 | if eq y 0 |
| 11 | trap 9 |
| 12 | end |
| 13 | ret y |
| 14 | end |
| 15 | fn failvoid x uint to void |
| 16 | if eq x 0 |
| 17 | trap 6 |
| 18 | end |
| 19 | ret |
| 20 | end |
| 21 | fn nestedvoid x uint to uint |
| 22 | failvoid x |
| 23 | if eq x 0 |
| 24 | trap 9 |
| 25 | end |
| 26 | ret x |
| 27 | end |