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 / tests / arboris / capq.om
| 1 | note SPDX-License-Identifier: AGPL-3.0-only |
| 2 | fn main to int |
| 3 | key = new ulong 8 0 |
| 4 | cpu = new ulong 12 0 |
| 5 | gpu = new ulong 12 0 |
| 6 | put key 0 1234 |
| 7 | put key 4 1000000 |
| 8 | put key 5 4000000 |
| 9 | put key 6 8 |
| 10 | put key 7 1 |
| 11 | for i ulong 8 |
| 12 | put cpu i get key i |
| 13 | put gpu i get key i |
| 14 | end |
| 15 | put gpu 8 1 |
| 16 | put cpu 9 7 |
| 17 | put cpu 10 100 |
| 18 | put cpu 11 9 |
| 19 | if ne arboris_capq key cpu gpu 0 |
| 20 | ret 1 |
| 21 | end |
| 22 | put gpu 9 7 |
| 23 | put gpu 10 50 |
| 24 | put gpu 11 10 |
| 25 | if ne arboris_capq key cpu gpu 0 |
| 26 | ret 2 |
| 27 | end |
| 28 | put gpu 11 9 |
| 29 | if ne arboris_capq key cpu gpu 1 |
| 30 | ret 3 |
| 31 | end |
| 32 | put gpu 6 1 |
| 33 | if ne arboris_capq key cpu gpu 0 |
| 34 | ret 4 |
| 35 | end |
| 36 | ret 0 |
| 37 | end |