omega-bridge
Omega-first language interoperability: checked conversion backends and native language bindings
Brought by drakestapleton
omega-bridge / tests / cabi / ext.om
| 1 | note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 2 | note cabi-1 fixture external unit: tools/bridge-seeded c emits omega_fx_sum, the symbol fixture.om imports through fx_ext. |
| 3 | note fixture.om passes a uchar view span, a ulong edit span at element offset 0 and a ulong view span at element offset 3. |
| 4 | fn fx_sum b view uchar 512 n ulong w edit ulong 3 v view ulong 3 k ulong to ulong |
| 5 | s = k |
| 6 | for j ulong n |
| 7 | s = add s ulong get b j |
| 8 | end |
| 9 | for i ulong 3 |
| 10 | s = add s get v i |
| 11 | put w i 7 |
| 12 | end |
| 13 | ret s |
| 14 | end |