Skip to content

mir-opt diff tests for 64/32 bit targets doesn't render as diff in github #75746

Closed
@oli-obk

Description

@oli-obk

mir-opt tests have a diff mode where the changes of a specific optimization are shown as a .diff file which is rendered as a diff by most tools. For 32/64 bit tests we ended up adding a postfix to the file name (which comes after the .diff), and that breaks the tool support. We should change all these tests file-names so they end with .diff again.

We should change both

expected_file = format!("{}{}", test_name, bit_width);
and
expected_file = format!("{}{}", test_name, bit_width);
to insert the bitsize before the .diff or .mir respectively.

After you've run --bless for both 32 bit and 64 bit, you also need to change

glob(&format!("{}/{}.*.mir{}", test_dir.display(), test_crate, bit_width)).unwrap()
and
glob(&format!("{}/{}.*.diff{}", test_dir.display(), test_crate, bit_width)).unwrap()

Do not do the last step before having run --bless, otherwise you'll have to figure out what files to rename and do it manually. This way you get --bless to do it for you.

cc @rust-lang/wg-mir-opt

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-mir-optArea: MIR optimizationsE-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions