Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/omega-mv/blob/main/tests/arboris_arena_test.om # 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 Sign in to star 1 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `omega-mv / tests / arboris_arena_test.om` 164 lines ยท 3124 bytes Raw Blame History 1 note SPDX-License-Identifier: AGPL-3.0-only 2 note AArch64 Linux replay with the compiler pinned in om/units.sh: 3 note (sed 's/^export fn /fn /' om/arboris_arena.om; cat tests/arboris_arena_test.om) | seed/out/omc > arena-test 4 note chmod +x arena-test && ./arena-test (exit 0 passes). 5 fn seed_header m edit ulong 16 to void 6 put m 0 0x4152425200000001 7 put m 1 3 8 put m 2 5 9 put m 3 7 10 put m 4 8 11 put m 5 3 12 put m 10 8193 13 end 14 15 fn plan_test to int 16 m = new ulong 16 0 17 offsets = new ulong 6 77 18 seed_header m 19 if ne arboris_plan_arena m 53248 4096 offsets 0 20 ret 1 21 end 22 if or ne get m 12 53248 ne get m 13 384 23 ret 2 24 end 25 if or ne get m 9 128 ne get m 11 128 26 ret 3 27 end 28 if or ne get offsets 0 0 ne get offsets 1 8192 29 ret 4 30 end 31 if or ne get offsets 2 16384 ne get offsets 3 32768 32 ret 5 33 end 34 if or ne get offsets 4 40960 ne get offsets 5 49152 35 ret 6 36 end 37 for i ulong 6 38 put offsets i 77 39 end 40 put m 9 71 41 put m 11 72 42 put m 12 73 43 put m 13 74 44 if eq arboris_plan_arena m 53247 4096 offsets 0 45 ret 7 46 end 47 if or ne get m 9 71 ne get m 11 72 48 ret 8 49 end 50 if or ne get m 12 73 ne get m 13 74 51 ret 9 52 end 53 for i ulong 6 54 if ne get offsets i 77 55 ret 10 56 end 57 end 58 put m 10 0xffffffffffffffff 59 if eq arboris_plan_arena m 0xffffffffffffffff 4096 offsets 0 60 ret 11 61 end 62 put m 10 64 63 put m 4 0x8000000000000000 64 if eq arboris_plan_arena m 0xffffffffffffffff 4096 offsets 0 65 ret 12 66 end 67 put m 4 8 68 put m 2 0x100000000 69 if eq arboris_plan_arena m 0xffffffffffffffff 4096 offsets 0 70 ret 13 71 end 72 put m 2 5 73 if eq arboris_plan_arena m 53248 6144 offsets 0 74 ret 14 75 end 76 put m 6 2 77 if eq arboris_plan_arena m 53248 4096 offsets 0 78 ret 15 79 end 80 put m 6 0 81 put m 2 769 82 put m 5 769 83 if ne arboris_plan_arena m `1048576` 4096 offsets 0 84 ret 15 85 end 86 if ne get m 13 98304 87 ret 16 88 end 89 put m 2 3073 90 put m 5 3073 91 if eq arboris_plan_arena m `1048576` 4096 offsets 0 92 ret 17 93 end 94 put m 4 512 95 put m 2 96 96 put m 5 96 97 if ne arboris_plan_arena m `1048576` 4096 offsets 0 98 ret 18 99 end 100 put m 2 97 101 put m 5 97 102 if eq arboris_plan_arena m `1048576` 4096 offsets 0 103 ret 19 104 end 105 ret 0 106 end 107 108 fn csr_test to int 109 m = new ulong 16 0 110 seed_header m 111 data = new uint 22 0 112 short_data = new uint 21 0 113 put data 1 2 114 put data 2 2 115 put data 3 5 116 put data 6 1 117 put data 7 2 118 put data 8 6 119 put data 9 7 120 put data 16 2 121 if ne arboris_check_csr m data 0 122 ret 21 123 end 124 if ne arboris_check_csr m short_data 2 125 ret 22 126 end 127 put data 16 3 128 if ne arboris_check_csr m data 5 129 ret 23 130 end 131 put data 16 0 132 put data 9 6 133 if ne arboris_check_csr m data 4 134 ret 24 135 end 136 put data 9 7 137 put data 2 1 138 if ne arboris_check_csr m data 3 139 ret 25 140 end 141 put data 2 2 142 put m 5 2 143 if ne arboris_check_csr m data 3 144 ret 26 145 end 146 put m 3 0 147 put m 5 3 148 empty_syn = new uint 15 0 149 put empty_syn 1 2 150 put empty_syn 2 2 151 put empty_syn 3 5 152 if ne arboris_check_csr m empty_syn 0 153 ret 27 154 end 155 ret 0 156 end 157 158 fn main to int 159 rc = plan_test 160 if ne rc 0 161 ret rc 162 end 163 ret csr_test 164 end