interplane.Get Omega
Read in your language

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

branch main Branches Tags History

omega-mv / seed / ng / front / cases / sh_mix_width.om

15 lines · 369 bytes Raw Blame History
1note sh_mix_width: a uint value shifted by a ulong amount: 31 (the width - 1) is fine, 32 (the width) traps 7
2note (exit 107). "w\n" comes first; exit 1 would mean the shift by 31 gave a wrong value.
3text t "w\n"
4fn shu a uint s ulong to uint
5ret shl a s
6end
7fn main to int
8w = write 1 t 0 2
9x = shu 1 31
10if ne x 2147483648
11ret 1
12end
13y = shu 1 32
14ret int and y 255
15end