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 / core / cortex / tests / json / t_time.om
| 1 | note tests/json/t_time.om - differential harness for num_rfc (chrono to_rfc3339) and num_uuidf (uuid v4 |
| 2 | note text from 16 bytes). Input: u32 n, n x i64 LE nanoseconds, n x 16 bytes. Needs t_io.om. |
| 3 | fn main to int |
| 4 | num_init |
| 5 | if not t_need 4 |
| 6 | ret 2 |
| 7 | end |
| 8 | n = t_u32 |
| 9 | for i ulong n |
| 10 | if not t_need 8 |
| 11 | ret 3 |
| 12 | end |
| 13 | v = ulong 0 |
| 14 | p = get tibp 0 |
| 15 | for k ulong 8 |
| 16 | v = or v shl ulong get tib add p k mul k 8 |
| 17 | end |
| 18 | put tibp 0 add p 8 |
| 19 | put jobl 0 0 |
| 20 | num_rfc bitcast long v true |
| 21 | t_emitjob |
| 22 | end |
| 23 | for i ulong n |
| 24 | if not t_need 16 |
| 25 | ret 4 |
| 26 | end |
| 27 | p = get tibp 0 |
| 28 | for k ulong 16 |
| 29 | put jur k get tib add p k |
| 30 | end |
| 31 | put tibp 0 add p 16 |
| 32 | put jobl 0 0 |
| 33 | num_uuidf true |
| 34 | t_emitjob |
| 35 | end |
| 36 | t_flush |
| 37 | ret 0 |
| 38 | end |