Skip to content

UI tests linkage-detect-local-generated-name-collision.rs and linkage-detect-extern-generated-name-collision.rs trigger LLVM asserts when compiled with CGUs = 1 #83838

@the8472

Description

@the8472

This was discovered in #81942 (comment) which lowers the default CGU count to 1. The tests were modified to explicitly request 16CGUs to make them pass, but the underlying issue remains.

This should be reproducible by setting assertions = true in config.toml and running ./x.py test --stage 1 src/test/ui on commit 01c682043d3632dab421c263b8a2263b08b01bab (base commit aef1140) or by adding // compile-flags: -Ccodegen-units=1 to the tests.

---- [ui] ui/linkage-attr/linkage-detect-local-generated-name-collision.rs stdout ----

error: Error: expected failure status (Some(1)) but received status None.
status: signal: 6 (core dumped)
command: "/home/the8472/workspace/rust/build/x86_64-unknown-linux-gnu/stage1/bin/rustc" "/home/the8472/workspace/rust/src/test/ui/linkage-attr/linkage-detect-local-generated-name-collision.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zemit-future-incompat-report" "-C" "prefer-dynamic" "--out-dir" "/home/the8472/workspace/rust/build/x86_64-unknown-linux-gnu/test/ui/linkage-attr/linkage-detect-local-generated-name-collision" "-A" "unused" "-Crpath" "-O" "-Cdebuginfo=0" "-Zunstable-options" "-Lnative=/home/the8472/workspace/rust/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-Clink-args=-fuse-ld=lld" "-Clink-arg=-Wl,--threads=1" "-Ccodegen-units=2" "-L" "/home/the8472/workspace/rust/build/x86_64-unknown-linux-gnu/test/ui/linkage-attr/linkage-detect-local-generated-name-collision/auxiliary"
stdout:
------------------------------------------

------------------------------------------
stderr:
------------------------------------------
rustc: /home/the8472/workspace/rust/src/llvm-project/llvm/include/llvm/Support/Casting.h:269: typename llvm::cast_retty<X, Y*>::ret_type llvm::cast(Y*) [with X = llvm::GlobalValue; Y = llvm::Value; typename llvm::cast_retty<X, Y*>::ret_type = llvm::GlobalValue*]: Assertion `isa<X>(Val) && "cast<Ty>() argument of incompatible type!"' failed.

------------------------------------------


---- [ui] ui/linkage-attr/linkage-detect-extern-generated-name-collision.rs stdout ----

error: Error: expected failure status (Some(1)) but received status None.
status: signal: 6 (core dumped)
command: "/home/the8472/workspace/rust/build/x86_64-unknown-linux-gnu/stage1/bin/rustc" "/home/the8472/workspace/rust/src/test/ui/linkage-attr/linkage-detect-extern-generated-name-collision.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zemit-future-incompat-report" "-C" "prefer-dynamic" "--out-dir" "/home/the8472/workspace/rust/build/x86_64-unknown-linux-gnu/test/ui/linkage-attr/linkage-detect-extern-generated-name-collision" "-A" "unused" "-Crpath" "-O" "-Cdebuginfo=0" "-Zunstable-options" "-Lnative=/home/the8472/workspace/rust/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-Clink-args=-fuse-ld=lld" "-Clink-arg=-Wl,--threads=1" "-Ccodegen-units=2" "-L" "/home/the8472/workspace/rust/build/x86_64-unknown-linux-gnu/test/ui/linkage-attr/linkage-detect-extern-generated-name-collision/auxiliary"
stdout:
------------------------------------------

------------------------------------------
stderr:
------------------------------------------
rustc: /home/the8472/workspace/rust/src/llvm-project/llvm/include/llvm/Support/Casting.h:269: typename llvm::cast_retty<X, Y*>::ret_type llvm::cast(Y*) [with X = llvm::GlobalValue; Y = llvm::Value; typename llvm::cast_retty<X, Y*>::ret_type = llvm::GlobalValue*]: Assertion `isa<X>(Val) && "cast<Ty>() argument of incompatible type!"' failed.

------------------------------------------



failures:
    [ui] ui/linkage-attr/linkage-detect-extern-generated-name-collision.rs
    [ui] ui/linkage-attr/linkage-detect-local-generated-name-collision.rs

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.A-linkageArea: linking into static, shared libraries and binariesC-bugCategory: This is a bug.I-crashIssue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions