Skip to content

i386 testsuite fixes: correct get_pointer, restrict 64-bit-op tests - #274

Open
bbiiggppiigg wants to merge 1 commit into
masterfrom
bbiiggppiigg/i386-testsuite
Open

i386 testsuite fixes: correct get_pointer, restrict 64-bit-op tests#274
bbiiggppiigg wants to merge 1 commit into
masterfrom
bbiiggppiigg/i386-testsuite

Conversation

@bbiiggppiigg

@bbiiggppiigg bbiiggppiigg commented Jul 24, 2026

Copy link
Copy Markdown
Member

The test1 suite runs a 64-bit mutator against 32-bit mutatees (there is no 32-bit mutator; BUILD_RTLIB_32). Two independent problems prevented it from producing a correct i386 baseline.

  • get_pointer() in test1.h built its sentinel value high-byte-first ((val << 8) | byte). The 64-bit mutator and the 32-bit mutatee evaluate this at different widths, so a pointer-sized constant crossing the boundary is truncated to 32 bits and the two sides' low 32 bits disagree (mutator 0xa4a5a6a7 vs mutatee 0xa0a1a2a3). test1_2 -- and any test comparing a get_pointer() value across mutator and mutatee -- then failed on i386. Build the value low-byte-first so its low bytes are width-independent.

  • test1_5 and test1_6 exercise 64-bit integer operations (long long compares, multiply/divide with results exceeding 2^32) inside instrumentation snippets. The i386 snippet register model is 32-bit and cannot represent those operands, so the tests cannot pass under the 32-bit ABI regardless of Dyninst correctness. Mark them restricted_amd64_abi so they run only under the 64-bit ABI, and update the generated test_info_new.gen.C to match (dropping their abi:32 entries).

…p tests

The test1 suite runs a 64-bit mutator against 32-bit mutatees (there is no
32-bit mutator; BUILD_RTLIB_32). Two independent problems prevented it from
producing a correct i386 baseline.

  - get_pointer() in test1.h built its sentinel value high-byte-first
    ((val << 8) | byte). The 64-bit mutator and the 32-bit mutatee evaluate
    this at different widths, so a pointer-sized constant crossing the boundary
    is truncated to 32 bits and the two sides' low 32 bits disagree (mutator
    0xa4a5a6a7 vs mutatee 0xa0a1a2a3). test1_2 -- and any test comparing a
    get_pointer() value across mutator and mutatee -- then failed on i386.
    Build the value low-byte-first so its low bytes are width-independent.

  - test1_5 and test1_6 exercise 64-bit integer operations (long long
    compares, multiply/divide with results exceeding 2^32) inside
    instrumentation snippets. The i386 snippet register model is 32-bit and
    cannot represent those operands, so the tests cannot pass under the 32-bit
    ABI regardless of Dyninst correctness. Mark them restricted_amd64_abi so
    they run only under the 64-bit ABI, and update the generated
    test_info_new.gen.C to match (dropping their abi:32 entries).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@bbiiggppiigg bbiiggppiigg changed the title i386 (32-bit) testsuite fixes: correct get_pointer, restrict 64-bit-o… i386 testsuite fixes: correct get_pointer, restrict 64-bit-op tests Jul 24, 2026
@bbiiggppiigg
bbiiggppiigg marked this pull request as draft July 24, 2026 04:16
@bbiiggppiigg
bbiiggppiigg marked this pull request as ready for review July 24, 2026 21:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant