Skip to content

test_item3_deflate_llvm_bitcode fails with llvm-16.0.5-1.fc38.x86_64

#282 is similar, but for older llvm versions.

_______________________ test_item3_deflate_llvm_bitcode ________________________

differences = [<Difference nm -s {} -- nm -s {} []>, <Difference alloc_system-d16b8f0e.0.o -- alloc_system-d16b8f0e.0.o [<Difference...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 i8*, align 8\n   %4 = icmp ult i64 %3, 17\n   br i1 %4, labe...e i64 @__rust_reallocate_inplace(i8* 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 +XX,XX @@\n entry-block:\n   %out.i.i = alloca ptr, align 8\n   %4 = icmp ult i64 %3, 17\n   br i1 %4, label %then-block-195-.i, label %_ZN12alloc_system3imp8allocate17h8ba7625cc4a820e8E.exit.i\n \n then-block-195-.i:                                ; preds = %entry-block\n   %5 = tail call ptr @realloc(ptr %0, i64 %2) #2\n-  br label %_ZN12alloc_system3imp10reallocate17h4a0811c9ec086854E.exit\n+  br label %_ZN12alloc_system3imp10reallocate1l44a0811c9ec086854E.exit\n \n _ZN12alloc_system3imp8allocate17h8ba7625cc4a820e8E.exit.i: ; preds = %entry-block\n   %6 = bitcast ptr %out.i.i to ptr\n   call void @llvm.lifetime.start.p0(i64 8, ptr %6) #2\n   store ptr null, ptr %out.i.i, align 8\n   %7 = call i32 @posix_memalign(ptr nonnull %out.i.i, i64 %3, i64 %2) #2\n   %8 = icmp eq i32 %7, 0\n   %9 = load ptr, ptr %out.i.i, align 8\n   %sret_slot.0.i.i = select i1 %8, ptr %9, ptr null\n   call void @llvm.lifetime.end.p0(i64 8, ptr %6) #2\n   %10 = icmp ule i64 %2, %1\n   %11 = select i1 %10, i64 %2, i64 %1\n   call void @llvm.memmove.p0.p0.i64(ptr align 1 %sret_slot.0.i.i, ptr align 1 %0, i64 %11, i1 false) #2\n   call void @free(ptr %0) #2\n-  br label %_ZN12alloc_system3imp10reallocate17h4a0811c9ec086854E.exit\n+  br label %_ZN12alloc_system3imp10reallocate1l44a0811c9ec086854E.exit\n \n-_ZN12alloc_system3imp10reallocate17h4a0811c9ec086854E.exit: ; preds = %_ZN12alloc_system3imp8allocate17h8ba7625cc4a820e8E.exit.i, %then-block-195-.i\n+_ZN12alloc_system3imp10reallocate1l44a0811c9ec086854E.exit: ; preds = %_ZN12alloc_system3imp8allocate17h8ba7625cc4a820e8E.exit.i, %then-block-195-.i\n   %sret_slot.0.i = phi ptr [ %5, %then-block-195-.i ], [ %sret_slot.0.i.i, %_ZN12alloc_system3imp8allocate17h8ba7625cc4a820e8E.exit.i ]\n   ret ptr %sret_slot.0.i\n }\n \n ; Function Attrs: nounwind memory(none) uwtable\n define i64 @__rust_reallocate_inplace(ptr nocapture readnone %0, i64 %1, i64 %2, i64 %3) unnamed_addr #1 {\n entry-block:\n' == '@@ -XX,XX +XX,XX @@\n entry-block:\n   %out.i.i = alloca i8*, align 8\n   %4 = icmp ult i64 %3, 17\n   br i1 %4, label %then-block-195-.i, label %_ZN12alloc_system3imp8allocate17h8ba7625cc4a820e8E.exit.i\n \n then-block-195-.i:                                ; preds = %entry-block\n   %5 = tail call i8* @realloc(i8* %0, i64 %2) #2\n-  br label %_ZN12alloc_system3imp10reallocate17h4a0811c9ec086854E.exit\n+  br label %_ZN12alloc_system3imp10reallocate1l44a0811c9ec086854E.exit\n \n _ZN12alloc_system3imp8allocate17h8ba7625cc4a820e8E.exit.i: ; preds = %entry-block\n   %6 = bitcast i8** %out.i.i to i8*\n   call void @llvm.lifetime.start.p0i8(i64 8, i8* %6) #2\n   store i8* null, i8** %out.i.i, align 8\n   %7 = call i32 @posix_memalign(i8** nonnull %out.i.i, i64 %3, i64 %2) #2\n   %8 = icmp eq i32 %7, 0\n   %9 = load i8*, i8** %out.i.i, align 8\n   %sret_slot.0.i.i = select i1 %8, i8* %9, i8* null\n   call void @llvm.lifetime.end.p0i8(i64 8, i8* %6) #2\n   %10 = icmp ule i64 %2, %1\n   %11 = select i1 %10, i64 %2, i64 %1\n   call void @llvm.memmove.p0i8.p0i8.i64(i8* align 1 %sret_slot.0.i.i, i8* align 1 %0, i64 %11, i1 false) #2\n   call void @free(i8* %0) #2\n-  br label %_ZN12alloc_system3imp10reallocate17h4a0811c9ec086854E.exit\n+  br label %_ZN12alloc_system3imp10reallocate1l44a0811c9ec086854E.exit\n \n-_ZN12alloc_system3imp10reallocate17h4a0811c9ec086854E.exit: ; preds = %_ZN12alloc_system3imp8allocate17h8ba7625cc4a820e8E.exit.i, %then-block-195-.i\n+_ZN12alloc_system3imp10reallocate1l44a0811c9ec086854E.exit: ; preds = %_ZN12alloc_system3imp8allocate17h8ba7625cc4a820e8E.exit.i, %then-block-195-.i\n   %sret_slot.0.i = phi i8* [ %5, %then-block-195-.i ], [ %sret_slot.0.i.i, %_ZN12alloc_system3imp8allocate17h8ba7625cc4a820e8E.exit.i ]\n   ret i8* %sret_slot.0.i\n }\n \n ; Function Attrs: nounwind readnone uwtable\n define i64 @__rust_reallocate_inplace(i8* nocapture readnone %0, i64 %1, i64 %2, i64 %3) unnamed_addr #1 {\n entry-block:\n'
E           @@ -XX,XX +XX,XX @@
E            entry-block:
E         -    %out.i.i = alloca i8*, align 8
E         ?                      ^^^
E         +    %out.i.i = alloca ptr, align 8
E         ?                      ^^^
E              %4 = icmp ult i64 %3, 17
E              br i1 %4, label %then-block-195-.i, label %_ZN12alloc_system3imp8allocate17h8ba7625cc4a820e8E.exit.i
E            
E            then-block-195-.i:                                ; preds = %entry-block
E         -    %5 = tail call i8* @realloc(i8* %0, i64 %2) #2
E         ?                   ^^^          ^^^
E         +    %5 = tail call ptr @realloc(ptr %0, i64 %2) #2
E         ?                   ^^^          ^^^
E           -  br label %_ZN12alloc_system3imp10reallocate17h4a0811c9ec086854E.exit
E           +  br label %_ZN12alloc_system3imp10reallocate1l44a0811c9ec086854E.exit
E            
E            _ZN12alloc_system3imp8allocate17h8ba7625cc4a820e8E.exit.i: ; preds = %entry-block
E         -    %6 = bitcast i8** %out.i.i to i8*
E         ?                 ^^^^             ^^^
E         +    %6 = bitcast ptr %out.i.i to ptr
E         ?                 ^^^             ^^^
E         -    call void @llvm.lifetime.start.p0i8(i64 8, i8* %6) #2
E         ?                                     --        ^^^
E         +    call void @llvm.lifetime.start.p0(i64 8, ptr %6) #2
E         ?                                             ^^^
E         -    store i8* null, i8** %out.i.i, align 8
E         ?          ^^^       ^^^^
E         +    store ptr null, ptr %out.i.i, align 8
E         ?          ^^^       ^^^
E         -    %7 = call i32 @posix_memalign(i8** nonnull %out.i.i, i64 %3, i64 %2) #2
E         ?                                  ^^^^
E         +    %7 = call i32 @posix_memalign(ptr nonnull %out.i.i, i64 %3, i64 %2) #2
E         ?                                  ^^^
E              %8 = icmp eq i32 %7, 0
E         -    %9 = load i8*, i8** %out.i.i, align 8
E         ?              ^^^  ^^^^
E         +    %9 = load ptr, ptr %out.i.i, align 8
E         ?              ^^^  ^^^
E         -    %sret_slot.0.i.i = select i1 %8, i8* %9, i8* null
E         ?                                     ^^^     ^^^
E         +    %sret_slot.0.i.i = select i1 %8, ptr %9, ptr null
E         ?                                     ^^^     ^^^
E         -    call void @llvm.lifetime.end.p0i8(i64 8, i8* %6) #2
E         ?                                   --        ^^^
E         +    call void @llvm.lifetime.end.p0(i64 8, ptr %6) #2
E         ?                                           ^^^
E              %10 = icmp ule i64 %2, %1
E              %11 = select i1 %10, i64 %2, i64 %1
E         -    call void @llvm.memmove.p0i8.p0i8.i64(i8* align 1 %sret_slot.0.i.i, i8* align 1 %0, i64 %11, i1 false) #2
E         ?                              --   --     ^^^                           ^^^
E         +    call void @llvm.memmove.p0.p0.i64(ptr align 1 %sret_slot.0.i.i, ptr align 1 %0, i64 %11, i1 false) #2
E         ?                                      ^^^                           ^^^
E         -    call void @free(i8* %0) #2
E         ?                    ^^^
E         +    call void @free(ptr %0) #2
E         ?                    ^^^
E           -  br label %_ZN12alloc_system3imp10reallocate17h4a0811c9ec086854E.exit
E           +  br label %_ZN12alloc_system3imp10reallocate1l44a0811c9ec086854E.exit
E            
E           -_ZN12alloc_system3imp10reallocate17h4a0811c9ec086854E.exit: ; preds = %_ZN12alloc_system3imp8allocate17h8ba7625cc4a820e8E.exit.i, %then-block-195-.i
E           +_ZN12alloc_system3imp10reallocate1l44a0811c9ec086854E.exit: ; preds = %_ZN12alloc_system3imp8allocate17h8ba7625cc4a820e8E.exit.i, %then-block-195-.i
E         -    %sret_slot.0.i = phi i8* [ %5, %then-block-195-.i ], [ %sret_slot.0.i.i, %_ZN12alloc_system3imp8allocate17h8ba7625cc4a820e8E.exit.i ]
E         ?                         ^^^
E         +    %sret_slot.0.i = phi ptr [ %5, %then-block-195-.i ], [ %sret_slot.0.i.i, %_ZN12alloc_system3imp8allocate17h8ba7625cc4a820e8E.exit.i ]
E         ?                         ^^^
E         -    ret i8* %sret_slot.0.i
E         ?        ^^^
E         +    ret ptr %sret_slot.0.i
E         ?        ^^^
E            }
E            
E         -  ; Function Attrs: nounwind readnone uwtable
E         ?                              ^^^
E         +  ; Function Attrs: nounwind memory(none) uwtable
E         ?                             ++++ ^^    +
E         -  define i64 @__rust_reallocate_inplace(i8* nocapture readnone %0, i64 %1, i64 %2, i64 %3) unnamed_addr #1 {
E         ?                                        ^^^
E         +  define i64 @__rust_reallocate_inplace(ptr nocapture readnone %0, i64 %1, i64 %2, i64 %3) unnamed_addr #1 {
E         ?                                        ^^^
E            entry-block:

tests/comparators/test_rlib.py:128: AssertionError
$ llvm-config --version
16.0.5

This is with release 245.

Edited by Zbigniew Jędrzejewski-Szmek
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information