Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ui constant tests for big-endian platforms #106047

Merged
merged 1 commit into from
Jan 9, 2023

Commits on Dec 27, 2022

  1. Fix ui constant tests for big-endian platforms

    A number of tests under ui/const-ptr and ui/consts are currently
    failing on big-endian platforms as the binary encoding of some
    constants is hard-coded in the stderr test files.  Fix this by
    providing a normalize-stderr-test rule that strips out the
    raw bytes hex dump, so the comparison can be done in an
    endianness-independent manner.  Note that in most cases, this
    means the tests are now also independent of word size, so the
    32bit and 64bit cases can be re-unified.
    
    To keep tests that verify the details of those raw bytes dumps,
    a new test case raw-bytes.rs performs the tests where the hex
    dumps were stripped out a second time, but only on little-
    endian platforms.
    
    In addition, src/test/ui/const-ptr/forbidden_slices.rs exposes
    an endian-specific difference in this diagnostic output:
       constructing invalid value at .<deref>[0]: encountered 0x11,
       but expected a boolean
    depending on which byte of D0 is not a boolean value (0 or 1).
    Fixed this by choosing a value of D0 that differs from 0 or 1
    in all bytes.
    
    Fixes part of rust-lang#105383.
    uweigand committed Dec 27, 2022
    Configuration menu
    Copy the full SHA
    73e7207 View commit details
    Browse the repository at this point in the history