Skip to content

Test failure with LLVM 21

Hi, I'm building diffoscope on Arch again and found that the checks fail. Specifically, the test_item3_deflate_llvm_bitcode test:

=================================== FAILURES ===================================
_______________________ test_item3_deflate_llvm_bitcode ________________________

differences = [<Difference nm --print-armap {} -- nm --print-armap {} []>, <Difference alloc_system-d16b8f0e.0.o -- alloc_system-d16...canalyzer -dump {} []>, <Difference find {} -execdir llvm-dis -o - {} ; -- find {} -execdir llvm-dis -o - {} ; []>]>]>]
rlib_dis_expected_diff = '@@ -42,32 +42,32 @@\n entry-block:\n   %out.i.i = alloca ptr, align 8\n   %4 = icmp ult i64 %3, 17\n   br i1 %4, labe...e i64 @__rust_reallocate_inplace(ptr nocapture readnone %0, i64 %1, i64 %2, i64 %3) unnamed_addr #1 {\n entry-block:\n'

    @skip_unless_tools_exist("llvm-dis")
    @skip_unless_tool_is_at_least("llvm-config", llvm_version, "3.8")
    def test_item3_deflate_llvm_bitcode(differences, rlib_dis_expected_diff):
        assert differences[3].source1 == "alloc_system-d16b8f0e.0.bytecode.deflate"
        assert differences[3].source2 == "alloc_system-d16b8f0e.0.bytecode.deflate"
        expected_diff = rlib_dis_expected_diff
        actual_diff = differences[3].details[0].details[1].unified_diff
>       assert diff_ignore_line_numbers(actual_diff) == diff_ignore_line_numbers(
            expected_diff
        )
E       AssertionError: assert '@@ -XX,XX +X...ntry-block:\n' == '@@ -XX,XX +X...ntry-block:\n'
E         
E         Skipping 1832 identical leading characters in diff, use -v to show
E         - place(ptr nocapture readnone %0, i64 %1, i64 %2, i64 %3) unnamed_addr #1 {
E         ?           ----------
E         + place(ptr readnone captures(none) %0, i64 %1, i64 %2, i64 %3) unnamed_addr #1 {
E         ?                    +++++++++++++++
E            entry-block:

tests/comparators/test_rlib.py:131: AssertionError

Given the recent update to LLVM 21 and previous issues of this sort (#282, #345 (closed)), it's likely that a new golden file is necessary due to LLVM changes.

Let me know if you can reproduce the issue.

-- Vekhir

System

OS: Arch Linux
Kernel: Linux 6.17.5-arch1-1
diffoscope: 306-1
LLVM: 21.1.4

Appendix

diffoscope-306-1-x86_64-check.log

Edited by Vekhir
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information