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_sovf.om

15 lines · 354 bytes Raw Blame History
1note 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,
2note so omc traps 1 (exit 101) after the amount check passed. "o\n" comes first.
3text t "o\n"
4fn sho a int s uchar to int
5ret shl a s
6end
7fn main to int
8w = write 1 t 0 2
9x = sho 1 30
10if ne x 1073741824
11ret 1
12end
13y = sho 2 30
14ret and y 255
15end