Extend minicore with intrinsics and use it to replace #[rustc_intrinsic] in tests by hbina · Pull Request #140037 · rust-lang/rust (original) (raw)

I am getting this issue

hbina085@DESKTOP-PGERPVO ~/g/rustlang (hbina-update-use-minicore) [1]> reset && python x.py test /home/hbina085/git/rustlang/tests/assembly/rust-abi-arg-attr.rs
Building bootstrap
    Finished `dev` profile [unoptimized] target(s) in 0.05s
Building stage0 library artifacts (x86_64-unknown-linux-gnu)
    Finished `release` profile [optimized + debuginfo] target(s) in 0.05s
Building compiler artifacts (stage0 -> stage1, x86_64-unknown-linux-gnu)
    Finished `release` profile [optimized + debuginfo] target(s) in 0.25s
Creating a sysroot for stage1 compiler (use `rustup toolchain link 'name' build/host/stage1`)
Building stage0 tool lld-wrapper (x86_64-unknown-linux-gnu)
    Finished `release` profile [optimized + debuginfo] target(s) in 0.09s
Building stage1 library artifacts (x86_64-unknown-linux-gnu)
    Finished `release` profile [optimized + debuginfo] target(s) in 0.02s
Building stage0 tool compiletest (x86_64-unknown-linux-gnu)
    Finished `release` profile [optimized + debuginfo] target(s) in 0.16s
Testing stage1 compiletest suite=assembly mode=assembly (x86_64-unknown-linux-gnu)

running 539 tests
iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii  88/539
ii.iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii 176/539
iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii 264/539
iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii 352/539
iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii 440/539
iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii 528/539
iiiiiiii
[assembly] tests/assembly/rust-abi-arg-attr.rs#loongarch64 ... F

[assembly] tests/assembly/rust-abi-arg-attr.rs#riscv64-zbb ... F

[assembly] tests/assembly/rust-abi-arg-attr.rs#riscv64 ... F


failures:

---- [assembly] tests/assembly/rust-abi-arg-attr.rs#loongarch64 stdout ----

error in revision `loongarch64`: verification with 'FileCheck' failed
status: exit status: 1
command: "/home/hbina085/git/rustlang/build/x86_64-unknown-linux-gnu/ci-llvm/bin/FileCheck" "--input-file" "/home/hbina085/git/rustlang/build/x86_64-unknown-linux-gnu/test/assembly/rust-abi-arg-attr.loongarch64/rust-abi-arg-attr.s" "/home/hbina085/git/rustlang/tests/assembly/rust-abi-arg-attr.rs" "--check-prefix=CHECK" "--check-prefix" "loongarch64" "--allow-unused-prefixes" "--dump-input-context" "100"
stdout: none
--- stderr -------------------------------
/home/hbina085/git/rustlang/tests/assembly/rust-abi-arg-attr.rs:34:17: error: CHECK-NEXT: expected string not found in input
 // CHECK-NEXT: .cfi_startproc
                ^
/home/hbina085/git/rustlang/build/x86_64-unknown-linux-gnu/test/assembly/rust-abi-arg-attr.loongarch64/rust-abi-arg-attr.s:6:18: note: scanning from here
issue_114508_u32:
                 ^
/home/hbina085/git/rustlang/build/x86_64-unknown-linux-gnu/test/assembly/rust-abi-arg-attr.loongarch64/rust-abi-arg-attr.s:15:30: note: possible intended match here
 .section .text.issue_114508_i32,"ax",@progbits
                             ^
/home/hbina085/git/rustlang/tests/assembly/rust-abi-arg-attr.rs:54:17: error: CHECK-NEXT: expected string not found in input
 // CHECK-NEXT: .cfi_startproc
                ^
/home/hbina085/git/rustlang/build/x86_64-unknown-linux-gnu/test/assembly/rust-abi-arg-attr.loongarch64/rust-abi-arg-attr.s:19:18: note: scanning from here
issue_114508_i32:
                 ^
/home/hbina085/git/rustlang/build/x86_64-unknown-linux-gnu/test/assembly/rust-abi-arg-attr.loongarch64/rust-abi-arg-attr.s:29:17: note: possible intended match here
 .section ".note.GNU-stack","",@progbits
                ^

Input file: /home/hbina085/git/rustlang/build/x86_64-unknown-linux-gnu/test/assembly/rust-abi-arg-attr.loongarch64/rust-abi-arg-attr.s
Check file: /home/hbina085/git/rustlang/tests/assembly/rust-abi-arg-attr.rs

-dump-input=help explains the following input dump.

Input was:
<<<<<<
           1:  .file "rust_abi_arg_attr.eff6563d25fa939-cgu.0" 
           2:  .section .text.issue_114508_u32,"ax",@progbits 
           3:  .globl issue_114508_u32 
           4:  .p2align 5 
           5:  .type issue_114508_u32,@function 
           6: issue_114508_u32: 
next:34'0                      X error: no match found
           7:  sltu <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>a</mi><mn>2</mn><mo separator="true">,</mo></mrow><annotation encoding="application/x-tex">a2, </annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8389em;vertical-align:-0.1944em;"></span><span class="mord mathnormal">a</span><span class="mord">2</span><span class="mpunct">,</span></span></span></span>a1, $a0 
next:34'0     ~~~~~~~~~~~~~~~~~~~~
           8:  masknez <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>a</mi><mn>1</mn><mo separator="true">,</mo></mrow><annotation encoding="application/x-tex">a1, </annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8389em;vertical-align:-0.1944em;"></span><span class="mord mathnormal">a</span><span class="mord">1</span><span class="mpunct">,</span></span></span></span>a1, $a2 
next:34'0     ~~~~~~~~~~~~~~~~~~~~~~~
           9:  maskeqz <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>a</mi><mn>0</mn><mo separator="true">,</mo></mrow><annotation encoding="application/x-tex">a0, </annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8389em;vertical-align:-0.1944em;"></span><span class="mord mathnormal">a</span><span class="mord">0</span><span class="mpunct">,</span></span></span></span>a0, $a2 
next:34'0     ~~~~~~~~~~~~~~~~~~~~~~~
          10:  or <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>a</mi><mn>0</mn><mo separator="true">,</mo></mrow><annotation encoding="application/x-tex">a0, </annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8389em;vertical-align:-0.1944em;"></span><span class="mord mathnormal">a</span><span class="mord">0</span><span class="mpunct">,</span></span></span></span>a0, $a1 
next:34'0     ~~~~~~~~~~~~~~~~~~
          11:  ret 
next:34'0     ~~~~~
          12: .Lfunc_end0: 
next:34'0     ~~~~~~~~~~~~~
          13:  .size issue_114508_u32, .Lfunc_end0-issue_114508_u32 
next:34'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          14:  
next:34'0     ~
          15:  .section .text.issue_114508_i32,"ax",@progbits 
next:34'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
next:34'1                                  ?                   possible intended match
          16:  .globl issue_114508_i32 
next:34'0     ~~~~~~~~~~~~~~~~~~~~~~~~~
          17:  .p2align 5 
next:34'0     ~~~~~~~~~~~~
          18:  .type issue_114508_i32,@function 
next:34'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          19: issue_114508_i32: 
next:34'0     ~~~~~~~~~~~~~~~~~
next:54'0                      X error: no match found
          20:  slt <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>a</mi><mn>2</mn><mo separator="true">,</mo></mrow><annotation encoding="application/x-tex">a2, </annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8389em;vertical-align:-0.1944em;"></span><span class="mord mathnormal">a</span><span class="mord">2</span><span class="mpunct">,</span></span></span></span>a1, $a0 
next:54'0     ~~~~~~~~~~~~~~~~~~~
          21:  masknez <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>a</mi><mn>1</mn><mo separator="true">,</mo></mrow><annotation encoding="application/x-tex">a1, </annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8389em;vertical-align:-0.1944em;"></span><span class="mord mathnormal">a</span><span class="mord">1</span><span class="mpunct">,</span></span></span></span>a1, $a2 
next:54'0     ~~~~~~~~~~~~~~~~~~~~~~~
          22:  maskeqz <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>a</mi><mn>0</mn><mo separator="true">,</mo></mrow><annotation encoding="application/x-tex">a0, </annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8389em;vertical-align:-0.1944em;"></span><span class="mord mathnormal">a</span><span class="mord">0</span><span class="mpunct">,</span></span></span></span>a0, $a2 
next:54'0     ~~~~~~~~~~~~~~~~~~~~~~~
          23:  or <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>a</mi><mn>0</mn><mo separator="true">,</mo></mrow><annotation encoding="application/x-tex">a0, </annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8389em;vertical-align:-0.1944em;"></span><span class="mord mathnormal">a</span><span class="mord">0</span><span class="mpunct">,</span></span></span></span>a0, $a1 
next:54'0     ~~~~~~~~~~~~~~~~~~
          24:  ret 
next:54'0     ~~~~~
          25: .Lfunc_end1: 
next:54'0     ~~~~~~~~~~~~~
          26:  .size issue_114508_i32, .Lfunc_end1-issue_114508_i32 
next:54'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          27:  
next:54'0     ~
          28:  .ident "rustc version 1.88.0-dev" 
next:54'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          29:  .section ".note.GNU-stack","",@progbits 
next:54'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
next:54'1                     ?                         possible intended match
>>>>>>
------------------------------------------


---- [assembly] tests/assembly/rust-abi-arg-attr.rs#riscv64-zbb stdout ----

error in revision `riscv64-zbb`: verification with 'FileCheck' failed
status: exit status: 1
command: "/home/hbina085/git/rustlang/build/x86_64-unknown-linux-gnu/ci-llvm/bin/FileCheck" "--input-file" "/home/hbina085/git/rustlang/build/x86_64-unknown-linux-gnu/test/assembly/rust-abi-arg-attr.riscv64-zbb/rust-abi-arg-attr.s" "/home/hbina085/git/rustlang/tests/assembly/rust-abi-arg-attr.rs" "--check-prefix=CHECK" "--check-prefix" "riscv64-zbb" "--allow-unused-prefixes" "--dump-input-context" "100"
stdout: none
--- stderr -------------------------------
/home/hbina085/git/rustlang/tests/assembly/rust-abi-arg-attr.rs:34:17: error: CHECK-NEXT: expected string not found in input
 // CHECK-NEXT: .cfi_startproc
                ^
/home/hbina085/git/rustlang/build/x86_64-unknown-linux-gnu/test/assembly/rust-abi-arg-attr.riscv64-zbb/rust-abi-arg-attr.s:8:18: note: scanning from here
issue_114508_u32:
                 ^
/home/hbina085/git/rustlang/build/x86_64-unknown-linux-gnu/test/assembly/rust-abi-arg-attr.riscv64-zbb/rust-abi-arg-attr.s:14:30: note: possible intended match here
 .section .text.issue_114508_i32,"ax",@progbits
                             ^
/home/hbina085/git/rustlang/tests/assembly/rust-abi-arg-attr.rs:54:17: error: CHECK-NEXT: expected string not found in input
 // CHECK-NEXT: .cfi_startproc
                ^
/home/hbina085/git/rustlang/build/x86_64-unknown-linux-gnu/test/assembly/rust-abi-arg-attr.riscv64-zbb/rust-abi-arg-attr.s🔞18: note: scanning from here
issue_114508_i32:
                 ^
/home/hbina085/git/rustlang/build/x86_64-unknown-linux-gnu/test/assembly/rust-abi-arg-attr.riscv64-zbb/rust-abi-arg-attr.s:25:17: note: possible intended match here
 .section ".note.GNU-stack","",@progbits
                ^

Input file: /home/hbina085/git/rustlang/build/x86_64-unknown-linux-gnu/test/assembly/rust-abi-arg-attr.riscv64-zbb/rust-abi-arg-attr.s
Check file: /home/hbina085/git/rustlang/tests/assembly/rust-abi-arg-attr.rs

-dump-input=help explains the following input dump.

Input was:
<<<<<<
           1:  .attribute 4, 16 
           2:  .attribute 5, "rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0_zmmul1p0_zaamo1p0_zalrsc1p0_zbb1p0" 
           3:  .file "rust_abi_arg_attr.eff6563d25fa939-cgu.0" 
           4:  .section .text.issue_114508_u32,"ax",@progbits 
           5:  .globl issue_114508_u32 
           6:  .p2align 1 
           7:  .type issue_114508_u32,@function 
           8: issue_114508_u32: 
next:34'0                      X error: no match found
           9:  maxu a0, a0, a1 
next:34'0     ~~~~~~~~~~~~~~~~~
          10:  ret 
next:34'0     ~~~~~
          11: .Lfunc_end0: 
next:34'0     ~~~~~~~~~~~~~
          12:  .size issue_114508_u32, .Lfunc_end0-issue_114508_u32 
next:34'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          13:  
next:34'0     ~
          14:  .section .text.issue_114508_i32,"ax",@progbits 
next:34'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
next:34'1                                  ?                   possible intended match
          15:  .globl issue_114508_i32 
next:34'0     ~~~~~~~~~~~~~~~~~~~~~~~~~
          16:  .p2align 1 
next:34'0     ~~~~~~~~~~~~
          17:  .type issue_114508_i32,@function 
next:34'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          18: issue_114508_i32: 
next:34'0     ~~~~~~~~~~~~~~~~~
next:54'0                      X error: no match found
          19:  max a0, a0, a1 
next:54'0     ~~~~~~~~~~~~~~~~
          20:  ret 
next:54'0     ~~~~~
          21: .Lfunc_end1: 
next:54'0     ~~~~~~~~~~~~~
          22:  .size issue_114508_i32, .Lfunc_end1-issue_114508_i32 
next:54'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          23:  
next:54'0     ~
          24:  .ident "rustc version 1.88.0-dev" 
next:54'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          25:  .section ".note.GNU-stack","",@progbits 
next:54'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
next:54'1                     ?                         possible intended match
>>>>>>
------------------------------------------


---- [assembly] tests/assembly/rust-abi-arg-attr.rs#riscv64 stdout ----

error in revision `riscv64`: verification with 'FileCheck' failed
status: exit status: 1
command: "/home/hbina085/git/rustlang/build/x86_64-unknown-linux-gnu/ci-llvm/bin/FileCheck" "--input-file" "/home/hbina085/git/rustlang/build/x86_64-unknown-linux-gnu/test/assembly/rust-abi-arg-attr.riscv64/rust-abi-arg-attr.s" "/home/hbina085/git/rustlang/tests/assembly/rust-abi-arg-attr.rs" "--check-prefix=CHECK" "--check-prefix" "riscv64" "--allow-unused-prefixes" "--dump-input-context" "100"
stdout: none
--- stderr -------------------------------
/home/hbina085/git/rustlang/tests/assembly/rust-abi-arg-attr.rs:34:17: error: CHECK-NEXT: expected string not found in input
 // CHECK-NEXT: .cfi_startproc
                ^
/home/hbina085/git/rustlang/build/x86_64-unknown-linux-gnu/test/assembly/rust-abi-arg-attr.riscv64/rust-abi-arg-attr.s:8:18: note: scanning from here
issue_114508_u32:
                 ^
/home/hbina085/git/rustlang/build/x86_64-unknown-linux-gnu/test/assembly/rust-abi-arg-attr.riscv64/rust-abi-arg-attr.s:16:30: note: possible intended match here
 .section .text.issue_114508_i32,"ax",@progbits
                             ^
/home/hbina085/git/rustlang/tests/assembly/rust-abi-arg-attr.rs:54:17: error: CHECK-NEXT: expected string not found in input
 // CHECK-NEXT: .cfi_startproc
                ^
/home/hbina085/git/rustlang/build/x86_64-unknown-linux-gnu/test/assembly/rust-abi-arg-attr.riscv64/rust-abi-arg-attr.s:20:18: note: scanning from here
issue_114508_i32:
                 ^
/home/hbina085/git/rustlang/build/x86_64-unknown-linux-gnu/test/assembly/rust-abi-arg-attr.riscv64/rust-abi-arg-attr.s:29:17: note: possible intended match here
 .section ".note.GNU-stack","",@progbits
                ^

Input file: /home/hbina085/git/rustlang/build/x86_64-unknown-linux-gnu/test/assembly/rust-abi-arg-attr.riscv64/rust-abi-arg-attr.s
Check file: /home/hbina085/git/rustlang/tests/assembly/rust-abi-arg-attr.rs

-dump-input=help explains the following input dump.

Input was:
<<<<<<
           1:  .attribute 4, 16 
           2:  .attribute 5, "rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0_zmmul1p0_zaamo1p0_zalrsc1p0" 
           3:  .file "rust_abi_arg_attr.eff6563d25fa939-cgu.0" 
           4:  .section .text.issue_114508_u32,"ax",@progbits 
           5:  .globl issue_114508_u32 
           6:  .p2align 1 
           7:  .type issue_114508_u32,@function 
           8: issue_114508_u32: 
next:34'0                      X error: no match found
           9:  bltu a1, a0, .LBB0_2 
next:34'0     ~~~~~~~~~~~~~~~~~~~~~~
          10:  mv a0, a1 
next:34'0     ~~~~~~~~~~~
          11: .LBB0_2: 
next:34'0     ~~~~~~~~~
          12:  ret 
next:34'0     ~~~~~
          13: .Lfunc_end0: 
next:34'0     ~~~~~~~~~~~~~
          14:  .size issue_114508_u32, .Lfunc_end0-issue_114508_u32 
next:34'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          15:  
next:34'0     ~
          16:  .section .text.issue_114508_i32,"ax",@progbits 
next:34'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
next:34'1                                  ?                   possible intended match
          17:  .globl issue_114508_i32 
next:34'0     ~~~~~~~~~~~~~~~~~~~~~~~~~
          18:  .p2align 1 
next:34'0     ~~~~~~~~~~~~
          19:  .type issue_114508_i32,@function 
next:34'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          20: issue_114508_i32: 
next:34'0     ~~~~~~~~~~~~~~~~~
next:54'0                      X error: no match found
          21:  blt a1, a0, .LBB1_2 
next:54'0     ~~~~~~~~~~~~~~~~~~~~~
          22:  mv a0, a1 
next:54'0     ~~~~~~~~~~~
          23: .LBB1_2: 
next:54'0     ~~~~~~~~~
          24:  ret 
next:54'0     ~~~~~
          25: .Lfunc_end1: 
next:54'0     ~~~~~~~~~~~~~
          26:  .size issue_114508_i32, .Lfunc_end1-issue_114508_i32 
next:54'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          27:  
next:54'0     ~
          28:  .ident "rustc version 1.88.0-dev" 
next:54'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          29:  .section ".note.GNU-stack","",@progbits 
next:54'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
next:54'1                     ?                         possible intended match
>>>>>>
------------------------------------------


failures:
    [assembly] tests/assembly/rust-abi-arg-attr.rs#loongarch64
    [assembly] tests/assembly/rust-abi-arg-attr.rs#riscv64-zbb
    [assembly] tests/assembly/rust-abi-arg-attr.rs#riscv64

test result: FAILED. 1 passed; 3 failed; 535 ignored; 0 measured; 0 filtered out; finished in 102.37ms

Some tests failed in compiletest suite=assembly mode=assembly host=x86_64-unknown-linux-gnu target=x86_64-unknown-linux-gnu
help: ignored 497 up-to-date tests; use `--force-rerun` to prevent this

From what I can gather, the problem is that the compiler optimizes out the function?
It seems that Rust compiles crates as a separate thing so when the final test binary is built, the metadata is gone so the test here doesn't work anymore.