omega-bridge
Omega-first language interoperability: checked conversion backends and native language bindings
Brought by drakestapleton
omega-bridge / tests / native / x86 / floorcheck.c
| 1 | /* Test-only inclusion gives the oracle access to the actual TLS stack top. |
| 2 | * The framed six-byte payload returns R15 without modifying the owned stack. */ |
| 3 | #include "omega_native.h" |
| 4 | #include "omega_native.c" |
| 5 | #include <stdio.h> |
| 6 | |
| 7 | int main(void) |
| 8 | { |
| 9 | uint64_t result = 0; |
| 10 | uint8_t out[64]; |
| 11 | if (omega2_floor(&result, out) != OMEGA_OK) |
| 12 | return 2; |
| 13 | if (result != (uintptr_t)(ombr_stk - OMBR_STACK)) { |
| 14 | puts("FAIL stack floor follows carved out-buffer top"); |
| 15 | return 1; |
| 16 | } |
| 17 | puts("PASS R15 equals actual usable mapping floor with an out buffer"); |
| 18 | return 0; |
| 19 | } |