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

tests/codegen/target-feature-inline-closure.rs is flaky #117060

Open
ehuss opened this issue Oct 22, 2023 · 1 comment
Open

tests/codegen/target-feature-inline-closure.rs is flaky #117060

ehuss opened this issue Oct 22, 2023 · 1 comment
Labels
A-spurious Area: Spurious failures in builds (spuriously == for no apparent reason) A-testsuite Area: The testsuite used to check the correctness of rustc T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@ehuss
Copy link
Contributor

ehuss commented Oct 22, 2023

The tests/codegen/target-feature-inline-closure.rs test has been failing randomly in CI.

The problem is that it is searching for the string fadd, which can appear in hex strings.

#116591 attempted to fix it, but that only helped with comparing the rustc version hash. It still fails if the characters fadd appear in a symbol hash. For example:

---- [codegen] tests/codegen/target-feature-inline-closure.rs stdout ----

error: verification with 'FileCheck' failed
status: exit status: 1
command: "/checkout/obj/build/x86_64-unknown-linux-gnu/ci-llvm/bin/FileCheck" "--input-file" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/codegen/target-feature-inline-closure/target-feature-inline-closure.ll" "/checkout/tests/codegen/target-feature-inline-closure.rs" "--allow-unused-prefixes" "--check-prefixes" "CHECK,NONMSVC" "--dump-input-context" "100"
stdout: none
--- stderr -------------------------------
Build completed unsuccessfully in 0:33:57
/checkout/tests/codegen/target-feature-inline-closure.rs:27:16: error: CHECK-NOT: excluded string found in input
 // CHECK-NOT: fadd
               ^
/checkout/obj/build/x86_64-unknown-linux-gnu/test/codegen/target-feature-inline-closure/target-feature-inline-closure.ll:35:74: note: found here
 call fastcc void @_ZN4core9core_arch3x863avx13_mm256_add_ps17hc86357fdcefaddcdE(ptr noalias nocapture noundef nonnull align 32 dereferenceable(32) %_0, ptr noalias nocapture noundef nonnull align 32 dereferenceable(32) %1, ptr noalias nocapture noundef nonnull align 32 dereferenceable(32) %0)
                                                                         ^~~~

Input file: /checkout/obj/build/x86_64-unknown-linux-gnu/test/codegen/target-feature-inline-closure/target-feature-inline-closure.ll
Check file: /checkout/tests/codegen/target-feature-inline-closure.rs

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

Input was:
<<<<<<
        1: ; ModuleID = 'target_feature_inline_closure.5b935a73a363356c-cgu.0' 
        2: source_filename = "target_feature_inline_closure.5b935a73a363356c-cgu.0" 
        3: target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" 
        4: target triple = "x86_64-unknown-linux-gnu" 
        5:  
        6: ; core::core_arch::x86::avx::_mm256_add_ps 
        7: ; Function Attrs: inlinehint mustprogress nofree norecurse nosync nounwind nonlazybind willreturn memory(argmem: readwrite) uwtable 
        8: define internal fastcc void @_ZN4core9core_arch3x863avx13_mm256_add_ps17hc86357fdcefaddcdE(ptr noalias nocapture noundef writeonly align 32 dereferenceable(32) %_0, ptr noalias nocapture noundef readonly align 32 dereferenceable(32) %a, ptr noalias nocapture noundef readonly align 32 dereferenceable(32) %b) unnamed_addr #0 { 
        9: start: 
       10:  %0 = load <8 x float>, ptr %a, align 32 
       11:  %1 = load <8 x float>, ptr %b, align 32 
       12:  %2 = fadd <8 x float> %0, %1 
       13:  store <8 x float> %2, ptr %_0, align 32 
       14:  ret void 
       15: } 
       16:  
       17: ; Function Attrs: mustprogress nofree norecurse nosync nounwind nonlazybind willreturn memory(argmem: readwrite) uwtable 
       18: define void @with_avx(ptr noalias nocapture noundef writeonly sret(<8 x float>) align 32 dereferenceable(32) %_0, ptr noalias nocapture noundef readonly align 32 dereferenceable(32) %x) unnamed_addr #1 { 
       19: start: 
       20:  %0 = load <8 x float>, ptr %x, align 32 
       21:  %1 = fadd <8 x float> %0, %0 
       22:  store <8 x float> %1, ptr %_0, align 32 
       23:  ret void 
       24: } 
       25:  
       26: ; Function Attrs: mustprogress nofree norecurse nosync nounwind nonlazybind willreturn memory(argmem: readwrite) uwtable 
       27: define void @without_avx(ptr noalias nocapture noundef writeonly sret(<8 x float>) align 32 dereferenceable(32) %_0, ptr noalias nocapture noundef readonly align 32 dereferenceable(32) %x) unnamed_addr #2 { 
       28: start: 
       29:  %0 = alloca <8 x float>, align 32 
       30:  %1 = alloca <8 x float>, align 32 
       31:  %2 = load <8 x float>, ptr %x, align 32 
       32:  store <8 x float> %2, ptr %1, align 32 
       33:  store <8 x float> %2, ptr %0, align 32 
       34: ; call core::core_arch::x86::avx::_mm256_add_ps 
       35:  call fastcc void @_ZN4core9core_arch3x863avx13_mm256_add_ps17hc86357fdcefaddcdE(ptr noalias nocapture noundef nonnull align 32 dereferenceable(32) %_0, ptr noalias nocapture noundef nonnull align 32 dereferenceable(32) %1, ptr noalias nocapture noundef nonnull align 32 dereferenceable(32) %0) 
not:27                                                                              !~~~                                                                                                                                                                                                                           error: no match expected
       36:  ret void 
       37: } 
       38:  
       39: attributes #0 = { inlinehint mustprogress nofree norecurse nosync nounwind nonlazybind willreturn memory(argmem: readwrite) uwtable "probe-stack"="inline-asm" "target-cpu"="x86-64" "target-features"="+avx" } 
       40: attributes #1 = { mustprogress nofree norecurse nosync nounwind nonlazybind willreturn memory(argmem: readwrite) uwtable "probe-stack"="inline-asm" "target-cpu"="x86-64" "target-features"="+avx" } 
       41: attributes #2 = { mustprogress nofree norecurse nosync nounwind nonlazybind willreturn memory(argmem: readwrite) uwtable "probe-stack"="inline-asm" "target-cpu"="x86-64" } 
       42:  
       43: !llvm.module.flags = !{!0, !1} 
       44: !llvm.ident = !{!2} 
       45:  
       46: !0 = !{i32 8, !"PIC Level", i32 2} 
       47: !1 = !{i32 2, !"RtLibUseGOT", i32 1} 
       48: !2 = !{!"rustc version 1.75.0 (e61a83a28 2023-10-18)"} 
>>>>>>
------------------------------------------
@ehuss ehuss added T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. A-spurious Area: Spurious failures in builds (spuriously == for no apparent reason) labels Oct 22, 2023
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Oct 22, 2023
@saethlin saethlin added A-testsuite Area: The testsuite used to check the correctness of rustc and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Oct 22, 2023
@Zalathar
Copy link
Contributor

If hashes are the recurring problem, it may be possible to write something like:

// CHECK: {{ fadd }}
...
// CHECK-NOT: {{ fadd }}

Or perhaps:

// CHECK: {{\b}}fadd{{\b}}
...
// CHECK-NOT: {{\b}}fadd{{\b}}

@lqd lqd mentioned this issue Nov 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-spurious Area: Spurious failures in builds (spuriously == for no apparent reason) A-testsuite Area: The testsuite used to check the correctness of rustc T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

4 participants