diff options
| author | OreoFR <29048345+OreoFR@users.noreply.github.com> | 2026-11-29 09:41:15 +0100 |
|---|---|---|
| committer | OreoFR <29048345+OreoFR@users.noreply.github.com> | 2026-11-29 09:41:15 +0100 |
| commit | e7c33662107196e6ba3dd143993dba4e5b44bf4c (patch) | |
| tree | 7586e357119506317a9ea6f36bf9ab2d8955cbd5 /runtime/test/clzero_patch_test.cpp | |
| parent | e11c0017cae0d1938e4710e34b9666e603308657 (diff) | |
| parent | 54b2a81e95c470c953ddee6177fd6255cbaf041d (diff) | |
Merge origin/main into #1906 (carry prep)
docs/design.md: wave64 emulation row keeps main's barrier text and the PR's s_bitset sentence.
Co-authored-by: Jordan <44410206+JordanWebDev@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'runtime/test/clzero_patch_test.cpp')
| -rw-r--r-- | runtime/test/clzero_patch_test.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/runtime/test/clzero_patch_test.cpp b/runtime/test/clzero_patch_test.cpp index dc34de8f8..ab5fbcf4c 100644 --- a/runtime/test/clzero_patch_test.cpp +++ b/runtime/test/clzero_patch_test.cpp | |||
| @@ -81,6 +81,21 @@ int main() { | |||
| 81 | check(cz::find(kShapeAWithRcx, sizeof kShapeAWithRcx).empty(), "a loop that compares against rcx is left alone"); | 81 | check(cz::find(kShapeAWithRcx, sizeof kShapeAWithRcx).empty(), "a loop that compares against rcx is left alone"); |
| 82 | const uint8_t lone[] = {0x0F, 0x01, 0xFC, 0xC3}; | 82 | const uint8_t lone[] = {0x0F, 0x01, 0xFC, 0xC3}; |
| 83 | check(cz::find(lone, sizeof lone).empty(), "a CLZERO outside both loop shapes is left alone"); | 83 | check(cz::find(lone, sizeof lone).empty(), "a CLZERO outside both loop shapes is left alone"); |
| 84 | check(cz::find(nullptr, 64).empty(), "null code buffer returns no sites"); | ||
| 85 | check(cz::stub_page(0x1000, 0x2000, 0) == nullptr, "stub_page rejects size 0"); | ||
| 86 | check(cz::stub_page(0x2000, 0x1000, 0x10000) == nullptr, "stub_page rejects inverted [lo, hi)"); | ||
| 87 | int32_t rel = 0; | ||
| 88 | check(cz::rel32_offset(0x100000000ull, 0x100000000ull + INT32_MAX, rel) && rel == INT32_MAX, | ||
| 89 | "rel32_offset accepts INT32_MAX"); | ||
| 90 | check(!cz::rel32_offset(0x100000000ull, 0x100000000ull + uint64_t(INT32_MAX) + 1, rel), | ||
| 91 | "rel32_offset rejects INT32_MAX + 1"); | ||
| 92 | check(cz::rel32_offset(0x180000000ull, 0x100000000ull, rel) && rel == INT32_MIN, | ||
| 93 | "rel32_offset accepts INT32_MIN"); | ||
| 94 | check(!cz::rel32_offset(0x180000001ull, 0x100000000ull, rel), | ||
| 95 | "rel32_offset rejects INT32_MIN - 1"); | ||
| 96 | const cz::Site site_a{6, 12, 0}; | ||
| 97 | check(cz::stub(kShapeA + 6, site_a, 0x100000000ull, 0x500000000ull).empty(), | ||
| 98 | "stub refuses resume address beyond +/-2 GiB"); | ||
| 84 | } | 99 | } |
| 85 | 100 | ||
| 86 | auto* code = static_cast<uint8_t*>(VirtualAlloc(nullptr, 0x1000, MEM_RESERVE | MEM_COMMIT, PAGE_EXECUTE_READWRITE)); | 101 | auto* code = static_cast<uint8_t*>(VirtualAlloc(nullptr, 0x1000, MEM_RESERVE | MEM_COMMIT, PAGE_EXECUTE_READWRITE)); |