diff options
| author | Ben Kimock <kimockb@gmail.com> | 2025-07-17 18:41:52 -0400 |
|---|---|---|
| committer | Ben Kimock <kimockb@gmail.com> | 2025-07-21 19:54:37 -0400 |
| commit | c4eb07761643d2fa26d6f609eb23c8d22e14d8eb (patch) | |
| tree | b1e562d8d3a6158abb3a9a7234ef860c74e949fa /tests | |
| parent | 9cd918bcbbc26deb005eb4e1bd9a445380195e56 (diff) | |
| download | rust-c4eb07761643d2fa26d6f609eb23c8d22e14d8eb.tar.gz rust-c4eb07761643d2fa26d6f609eb23c8d22e14d8eb.zip | |
Ensure we codegen and don't internalize the entrypoint
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/ui/entry-point/auxiliary/main_functions.rs | 3 | ||||
| -rw-r--r-- | tests/ui/entry-point/imported_main_local_codegen.rs | 11 |
2 files changed, 14 insertions, 0 deletions
diff --git a/tests/ui/entry-point/auxiliary/main_functions.rs b/tests/ui/entry-point/auxiliary/main_functions.rs index cc7992a42c1..ab4a09b6331 100644 --- a/tests/ui/entry-point/auxiliary/main_functions.rs +++ b/tests/ui/entry-point/auxiliary/main_functions.rs @@ -1 +1,4 @@ pub fn boilerplate() {} + +#[inline] +pub fn local_codegen() {} diff --git a/tests/ui/entry-point/imported_main_local_codegen.rs b/tests/ui/entry-point/imported_main_local_codegen.rs new file mode 100644 index 00000000000..1e46c109373 --- /dev/null +++ b/tests/ui/entry-point/imported_main_local_codegen.rs @@ -0,0 +1,11 @@ +//@ run-pass +//@ aux-build:main_functions.rs +//@ compile-flags: -Ccodegen-units=1024 + +// This is a regression test for https://github.com/rust-lang/rust/issues/144052. +// Entrypoint functions call each other in ways that CGU partitioning doesn't know about. So there +// is a special check to not internalize any of them. But internalizing them can be okay if there +// are few enough CGUs, so we use a lot of CGUs in this test to hit the bad case. + +extern crate main_functions; +pub use main_functions::local_codegen as main; |
