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 / seed / host / tests / uvmctl.om
| 1 | note Host only: every allowed UVM request uses an invalid fd, never a GPU. |
| 2 | global data uchar 9280 |
| 3 | global status uchar 4 |
| 4 | text msg "PASS bounded native UVM requests\n" |
| 5 | fn ck yes bool to void |
| 6 | if not yes |
| 7 | exit int 80 |
| 8 | end |
| 9 | end |
| 10 | fn bad k int to long |
| 11 | if eq k 0 |
| 12 | ret uvmctl neg int 1 uint 33 data 0 9263 |
| 13 | end |
| 14 | if eq k 1 |
| 15 | ret uvmctl neg int 1 uint 33 data 0 9265 |
| 16 | end |
| 17 | if eq k 2 |
| 18 | ret uvmctl neg int 1 uint 33 data 17 9264 |
| 19 | end |
| 20 | ret uvmctl neg int 1 uint 75 data 18446744073709551615 8 |
| 21 | end |
| 22 | fn main to int |
| 23 | ck eq uvmctl neg int 1 uint 805306369 data 8 16 neg long 9 |
| 24 | ck eq uvmctl neg int 1 uint 75 data 8 8 neg long 9 |
| 25 | ck eq uvmctl neg int 1 uint 37 data 8 40 neg long 9 |
| 26 | ck eq uvmctl neg int 1 uint 38 data 8 20 neg long 9 |
| 27 | ck eq uvmctl neg int 1 uint 25 data 8 32 neg long 9 |
| 28 | ck eq uvmctl neg int 1 uint 26 data 8 20 neg long 9 |
| 29 | ck eq uvmctl neg int 1 uint 27 data 8 56 neg long 9 |
| 30 | ck eq uvmctl neg int 1 uint 28 data 8 28 neg long 9 |
| 31 | ck eq uvmctl neg int 1 uint 33 data 8 9264 neg long 9 |
| 32 | ck eq uvmctl neg int 1 uint 34 data 8 24 neg long 9 |
| 33 | ck eq add uvmctl neg int 1 uint 73 data 8 24 10 1 |
| 34 | for k int 4 |
| 35 | p = fork |
| 36 | ck ge p 0 |
| 37 | if eq p 0 |
| 38 | r = bad k |
| 39 | exit int 80 |
| 40 | end |
| 41 | ck eq waitpid int p status 0 4 0 p |
| 42 | ck eq get status 0 0 |
| 43 | ck eq get status 1 103 |
| 44 | end |
| 45 | ck eq write 1 msg 0 len msg long len msg |
| 46 | ret 0 |
| 47 | end |