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 / gpu / nvidia / checks / plat_policy.om
| 1 | note SPDX-License-Identifier: Apache-2.0 |
| 2 | note gpu/nvidia/checks/plat_policy.om: the Omega port of CUDApp tests/platform_linux_policy.c. Composed after |
| 3 | note gpu/nvidia/om/platform-linux/plat_policy.om and gpu/nvidia/checks/lib.om; run with |
| 4 | note gpu/nvidia/checks/plat_policy.tsv, whose rows the C oracle plat_c wrote for every case of the old test. |
| 5 | note Case: NAME, m[0..15], WANT, q[0..15]. plat_policy m q, with q starting at zero, must return WANT and leave |
| 6 | note exactly q[0..15] in q (the old test's byte compare of the result and the whole reply). |
| 7 | text t_name "PLAT_POLICY" |
| 8 | fn cname to void |
| 9 | for i ulong len t_name bound 64 |
| 10 | ckoc ulong get t_name i |
| 11 | end |
| 12 | end |
| 13 | fn crow to bool |
| 14 | if ne ckcnt 34 |
| 15 | ckbad |
| 16 | end |
| 17 | m = new ulong 16 0 |
| 18 | q = new ulong 16 0 |
| 19 | for i ulong 16 |
| 20 | put m i cknum add i 1 |
| 21 | end |
| 22 | if ne plat_policy m q cknum 17 |
| 23 | ret false |
| 24 | end |
| 25 | for i ulong 16 |
| 26 | if ne get q i cknum add i 18 |
| 27 | ret false |
| 28 | end |
| 29 | end |
| 30 | ret true |
| 31 | end |