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 / core / cortex / tests / json / t_uni.om

76 lines · 1179 bytes Raw Blame History
1note tests/json/t_uni.om - differential harness for uni_rust.om (+ js_dbg_str): input records come in
2note (haystack, needle) pairs; output per pair: [lower][trim "start len"][Debug][contains 0/1], each
3note u32-framed inside one record. Needs t_io.om.
4global thay uchar 1048576
5fn t_beg to ulong
6p = get jobl 0
7for k ulong 4
8js_byte 0
9end
10ret p
11end
12fn t_end p ulong to void
13n = sub sub get jobl 0 p 4
14put job p uchar and n 255
15put job add p 1 uchar and shr n 8 255
16put job add p 2 uchar and shr n 16 255
17put job add p 3 uchar and shr n 24 255
18end
19fn main to int
20num_init
21for it ulong 100000000
22if not t_rec
23t_flush
24ret 0
25end
26n = get jinl 0
27for i ulong n
28x = get jin i
29put thay i x
30end
31if not t_rec
32trap 9
33end
34m = get jinl 0
35for i ulong m
36x = get jin i
37put jrq i x
38end
39put jrql 0 m
40ru_prep
41for i ulong n
42x = get thay i
43put jrs i x
44put jsp i x
45end
46put jrsl 0 n
47c = ru_contains
48put jobl 0 0
49p = t_beg
50for i ulong get jrll 0
51js_byte get jrl i
52end
53t_end p
54p = t_beg
55ru_trim 0 n
56js_u64 get jtro 0
57js_byte 32
58js_u64 get jtrl 0
59t_end p
60p = t_beg
61put jnv 0 0
62put jnl 0 uint n
63put jnk 0 6
64js_dbg_str 0
65t_end p
66p = t_beg
67if c
68js_byte 49
69else
70js_byte 48
71end
72t_end p
73t_emitjob
74end
75ret 1
76end