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 / ng / front / cases / sh_mix_sovf.om
| 1 | note sh_mix_sovf: an int value shifted left by a uchar amount: 1 by 30 is 2^30; 2 by 30 is 2^31, outside int, |
| 2 | note so omc traps 1 (exit 101) after the amount check passed. "o\n" comes first. |
| 3 | text t "o\n" |
| 4 | fn sho a int s uchar to int |
| 5 | ret shl a s |
| 6 | end |
| 7 | fn main to int |
| 8 | w = write 1 t 0 2 |
| 9 | x = sho 1 30 |
| 10 | if ne x 1073741824 |
| 11 | ret 1 |
| 12 | end |
| 13 | y = sho 2 30 |
| 14 | ret and y 255 |
| 15 | end |