rust/tests/run-make
bors 6f935a044d Auto merge of #141061 - dpaoliello:shimasfn, r=bjorn3
Change __rust_no_alloc_shim_is_unstable to be a function

This fixes a long sequence of issues:

1. A customer reported that building for Arm64EC was broken: #138541
2. This was caused by a bug in my original implementation of Arm64EC support, namely that only functions on Arm64EC need to be decorated with `#` but Rust was decorating statics as well.
3. Once I corrected Rust to only decorate functions, I started linking failures where the linker couldn't find statics exported by dylib dependencies. This was caused by the compiler not marking exported statics in the generated DEF file with `DATA`, thus they were being exported as functions not data.
4. Once I corrected the way that the DEF files were being emitted, the linker started failing saying that it couldn't find `__rust_no_alloc_shim_is_unstable`. This is because the MSVC linker requires the declarations of statics imported from other dylibs to be marked with `dllimport` (whereas it will happily link to functions imported from other dylibs whether they are marked `dllimport` or not).
5. I then made a change to ensure that `__rust_no_alloc_shim_is_unstable` was marked as `dllimport`, but the MSVC linker started emitting warnings that `__rust_no_alloc_shim_is_unstable` was marked as `dllimport` but was declared in an obj file. This is a harmless warning which is a performance hint: anything that's marked `dllimport` must be indirected via an `__imp` symbol so I added a linker arg in the target to suppress the warning.
6. A customer then reported a similar warning when using `lld-link` (<https://github.com/rust-lang/rust/pull/140176#issuecomment-2872448443>). I don't think it was an implementation difference between the two linkers but rather that, depending on the obj that the declaration versus uses of `__rust_no_alloc_shim_is_unstable` landed in we would get different warnings, so I suppressed that warning as well: #140954.
7. Another customer reported that they weren't using the Rust compiler to invoke the linker, thus these warnings were breaking their build: <https://github.com/rust-lang/rust/pull/140176#issuecomment-2881867433>. At that point, my original change was reverted (#141024) leaving Arm64EC broken yet again.

Taking a step back, a lot of these linker issues arise from the fact that `__rust_no_alloc_shim_is_unstable` is marked as `extern "Rust"` in the standard library and, therefore, assumed to be a foreign item from a different crate BUT the Rust compiler may choose to generate it either in the current crate, some other crate that will be statically linked in OR some other crate that will by dynamically imported.

Worse yet, it is impossible while building a given crate to know if `__rust_no_alloc_shim_is_unstable` will statically linked or dynamically imported: it might be that one of its dependent crates is the one with an allocator kind set and thus that crate (which is compiled later) will decide depending if it has any dylib dependencies or not to import `__rust_no_alloc_shim_is_unstable` or generate it. Thus, there is no way to know if the declaration of `__rust_no_alloc_shim_is_unstable` should be marked with `dllimport` or not.

There is a simple fix for all this: there is no reason `__rust_no_alloc_shim_is_unstable` must be a static. It needs to be some symbol that must be linked in; thus, it could easily be a function instead. As a function, there is no need to mark it as `dllimport` when dynamically imported which avoids the entire mess above.

There may be a perf hit for changing the `volatile load` to be a `tail call`, so I'm happy to change that part back (although I question what the codegen of a `volatile load` would look like, and if the backend is going to try to use load-acquire semantics).

Build with this change applied BEFORE #140176 was reverted to demonstrate that there are no linking issues with either MSVC or MinGW: <https://github.com/rust-lang/rust/actions/runs/15078657205>

Incidentally, I fixed `tests/run-make/no-alloc-shim` to work with MSVC as I needed it to be able to test locally (FYI for #128602)

r? `@bjorn3`
cc `@jieyouxu`
2025-06-18 09:24:40 +00:00
..
a-b-a-linker-guard Ignore a-b-a-linker-guard during cross-compilation 2025-03-01 22:11:14 +01:00
alloc-no-oom-handling Do not use relative paths to Rust source root in run-make tests 2024-06-06 19:16:53 +02:00
alloc-no-rc Do not use relative paths to Rust source root in run-make tests 2024-06-06 19:16:53 +02:00
alloc-no-sync Do not use relative paths to Rust source root in run-make tests 2024-06-06 19:16:53 +02:00
allocator-shim-circular-deps rewrite allocator-shim-circular-deps to ui test 2024-06-18 14:25:59 -04:00
allow-warnings-cmdline-stability ignore run-make tests that need std on no_std targets 2025-06-12 15:10:12 +02:00
amdgpu-kd tests: {Meta,Pointee}Sized in non-minicore tests 2025-06-16 23:04:33 +00:00
apple-deployment-target Always set the deployment target when building std 2025-01-31 04:07:06 +01:00
apple-sdk-version Print env var in --print=deployment-target 2024-11-22 20:46:05 +01:00
apple-slow-tls fix pthread-based tls on apple targets 2025-03-18 20:31:52 +02:00
archive-duplicate-names rewrite archive-duplicate-names to rmake 2024-07-18 09:28:50 -04:00
arguments-non-c-like-enum remove unused imports from rmake tests 2024-08-10 18:06:10 +00:00
artifact-incr-cache ignore run-make tests that need std on no_std targets 2025-06-12 15:10:12 +02:00
artifact-incr-cache-no-obj ignore run-make tests that need std on no_std targets 2025-06-12 15:10:12 +02:00
atomic-lock-free tests: {Meta,Pointee}Sized in non-minicore tests 2025-06-16 23:04:33 +00:00
avr-rjmp-offset tests: {Meta,Pointee}Sized in non-minicore tests 2025-06-16 23:04:33 +00:00
bare-outfile Fix bare-outfile test 2024-06-07 11:12:04 +02:00
bin-emit-no-symbols ignore run-make tests that need std on no_std targets 2025-06-12 15:10:12 +02:00
box-struct-no-segfault ignore run-make tests that need std on no_std targets 2025-06-12 15:10:12 +02:00
branch-protection-check-IBT tests: migrate branch-protection-check-IBT to rmake.rs 2024-12-28 11:58:32 +08:00
broken-pipe-no-ice tests: fix broken-pipe-no-ice to use bare_rustc/rustc 2025-05-09 19:54:43 +08:00
c-dynamic-dylib rewrite c-dynamic-dylib to rmake 2024-07-23 10:31:21 -04:00
c-dynamic-rlib rewrite c-dynamic-dylib to rmake 2024-07-23 10:31:21 -04:00
c-link-to-rust-dylib [AIX] Handle AIX dynamic library extensions within c-link-to-rust-dylib run-make test 2025-04-22 22:55:19 -04:00
c-link-to-rust-staticlib remove unused imports from rmake tests 2024-08-10 18:06:10 +00:00
c-link-to-rust-va-list-fn implement va_arg for x86_64 systemv and macOS 2025-05-29 22:06:02 +02:00
c-static-dylib rewrite pass-non-c-like-enum-to-c to rmake 2024-07-19 12:27:47 -04:00
c-static-rlib rewrite pass-non-c-like-enum-to-c to rmake 2024-07-19 12:27:47 -04:00
c-unwind-abi-catch-lib-panic Reformat using the new identifier sorting from rustfmt 2024-09-22 19:11:29 -04:00
c-unwind-abi-catch-panic Reformat using the new identifier sorting from rustfmt 2024-09-22 19:11:29 -04:00
cdylib tests: update for rfs rename 2024-07-17 13:34:18 +00:00
cdylib-dylib-linkage rewrite cdylib-dylib-linkage to rmake 2024-08-05 10:39:17 -04:00
cdylib-fewer-symbols rewrite symbols-include-type-name to rmake 2024-07-09 14:30:57 -04:00
checksum-freshness ignore run-make tests that need std on no_std targets 2025-06-12 15:10:12 +02:00
clear-error-blank-output tests: use renamed stdin_buf 2024-09-05 08:43:38 +00:00
codegen-options-parsing Migrate run-make/codegen-options-parsing to rmake.rs 2024-06-14 13:59:44 +02:00
comment-section tests: use renamed stdin_buf 2024-09-05 08:43:38 +00:00
compile-stdin tests: use renamed stdin_buf 2024-09-05 08:43:38 +00:00
compiler-builtins Update run-make tests to use cargo wrapper cmd 2024-09-24 19:04:51 +08:00
compiler-lookup-paths ignore run-make tests that need std on no_std targets 2025-06-12 15:10:12 +02:00
compiler-lookup-paths-2 ignore run-make tests that need std on no_std targets 2025-06-12 15:10:12 +02:00
compiler-rt-works-on-mingw rewrite incr-foreign-head-span to rmake 2024-07-25 11:08:07 -04:00
compressed-debuginfo remove unused imports from rmake tests 2024-08-10 18:06:10 +00:00
compressed-debuginfo-zstd Reformat using the new identifier sorting from rustfmt 2024-09-22 19:11:29 -04:00
const-prop-lint tests: update for rfs rename 2024-07-17 13:34:18 +00:00
const-trait-stable-toolchain ignore run-make tests that need std on no_std targets 2025-06-12 15:10:12 +02:00
const_fn_mir Make -Z unpretty=mir suggest -Z dump-mir as well 2025-02-26 13:07:12 +01:00
core-no-fp-fmt-parse Migrate core to Rust 2024 2025-03-11 09:46:34 -07:00
core-no-oom-handling Remove #![feature(let_chains)] from library and src/librustdoc 2025-05-16 16:14:24 +02:00
cpp-global-destructors Modify some run-make tests to use //@ needs-target-std 2025-06-10 23:31:05 +08:00
crate-circular-deps-link ignore run-make tests that need std on no_std targets 2025-06-12 15:10:12 +02:00
crate-data-smoke tests: produce target artifacts and/or require crate type / ignore cross-compile 2025-04-12 15:09:06 +08:00
crate-hash-rustc-version Reformat use declarations. 2024-07-29 08:26:52 +10:00
crate-loading Avoid extra path trimming in method not found error 2025-05-24 23:31:07 +02:00
crate-loading-crate-depends-on-itself Add more info on type/trait mismatches for different crate versions 2024-12-07 18:18:08 +00:00
crate-loading-multiple-candidates Test for relative paths in crate path diagnostics 2025-04-16 17:42:39 +00:00
crate-name-priority tests: produce target artifacts and/or require crate type / ignore cross-compile 2025-04-12 15:09:06 +08:00
cross-lang-lto ignore run-make tests that need std on no_std targets 2025-06-12 15:10:12 +02:00
cross-lang-lto-clang ci: add aarch64-gnu-debug job 2024-10-24 16:49:12 +01:00
cross-lang-lto-pgo-smoketest-clang Rename directive needs-profiler-support to needs-profiler-runtime 2024-10-09 20:58:27 +11:00
cross-lang-lto-riscv-abi tests: {Meta,Pointee}Sized in non-minicore tests 2025-06-16 23:04:33 +00:00
cross-lang-lto-upstream-rlibs ignore run-make tests that need std on no_std targets 2025-06-12 15:10:12 +02:00
CURRENT_RUSTC_VERSION ignore run-make tests that need std on no_std targets 2025-06-12 15:10:12 +02:00
debug-assertions rewrite emit-stack-sizes to rmake 2024-06-28 11:18:46 -04:00
debugger-visualizer-dep-info ignore run-make tests that need std on no_std targets 2025-06-12 15:10:12 +02:00
dep-graph Migrate run-make/dep-graph to rmake.rs 2024-06-15 17:34:43 +02:00
dep-info ignore run-make tests that need std on no_std targets 2025-06-12 15:10:12 +02:00
deref-impl-rustdoc-ice About rmake tests 2024-08-15 15:44:29 +02:00
diagnostics-traits-from-duplicate-crates ignore run-make tests that need std on no_std targets 2025-06-12 15:10:12 +02:00
dirty-incr-due-to-hard-link Prepend temp files with a string per invocation of rustc 2025-04-07 20:48:40 +00:00
doctests-keep-binaries ignore tests broken while cross compiling 2025-03-24 11:33:56 +01:00
doctests-keep-binaries-2024 Allow #![doc(test(attr(..)))] doctests to be again merged together 2025-05-22 20:12:50 +02:00
doctests-merge ignore run-make tests that need std on no_std targets 2025-06-12 15:10:12 +02:00
doctests-runtool ignore run-make tests that need std on no_std targets 2025-06-12 15:10:12 +02:00
dos-device-input Use path instead of Path in some run-make tests 2024-08-29 10:15:17 -04:00
dump-ice-to-disk Refine run-make test ignores due to unpredictable i686-pc-windows-gnu unwind mechanism 2025-06-17 10:49:28 +08:00
dump-mono-stats ignore run-make tests that need std on no_std targets 2025-06-12 15:10:12 +02:00
duplicate-output-flavors ignore run-make tests that need std on no_std targets 2025-06-12 15:10:12 +02:00
dylib-chain tests: update for rfs rename 2024-07-17 13:34:18 +00:00
dylib-soname Only add an automatic SONAME for Rust dylibs 2024-09-27 15:53:26 -07:00
embed-metadata ignore run-make tests that need std on no_std targets 2025-06-12 15:10:12 +02:00
embed-source-dwarf ignore run-make tests that need std on no_std targets 2025-06-12 15:10:12 +02:00
emit Auto merge of #125383 - Oneirical:bundle-them-up, r=jieyouxu 2024-06-03 18:35:54 +00:00
emit-named-files ignore run-make tests that need std on no_std targets 2025-06-12 15:10:12 +02:00
emit-path-unhashed ignore run-make tests that need std on no_std targets 2025-06-12 15:10:12 +02:00
emit-shared-files Use path instead of Path in some run-make tests 2024-08-29 10:15:17 -04:00
emit-stack-sizes ignore run-make tests that need std on no_std targets 2025-06-12 15:10:12 +02:00
emit-to-stdout ignore run-make tests that need std on no_std targets 2025-06-12 15:10:12 +02:00
env-dep-info ignore run-make tests that need std on no_std targets 2025-06-12 15:10:12 +02:00
error-found-staticlib-instead-crate ignore run-make tests that need std on no_std targets 2025-06-12 15:10:12 +02:00
error-writing-dependencies rewrite error-writing-dependencies to rmake 2024-06-19 16:43:22 -04:00
exit-code ignore run-make tests that need std on no_std targets 2025-06-12 15:10:12 +02:00
export ignore run-make tests that need std on no_std targets 2025-06-12 15:10:12 +02:00
export-executable-symbols Modify some run-make tests to use //@ needs-target-std 2025-06-10 23:31:05 +08:00
extern-diff-internal-name ignore run-make tests that need std on no_std targets 2025-06-12 15:10:12 +02:00
extern-flag-disambiguates remove unused imports from rmake tests 2024-08-10 18:06:10 +00:00
extern-flag-fun ignore run-make tests that need std on no_std targets 2025-06-12 15:10:12 +02:00
extern-flag-pathless tests: update for rfs rename 2024-07-17 13:34:18 +00:00
extern-flag-rename-transitive ignore run-make tests that need std on no_std targets 2025-06-12 15:10:12 +02:00
extern-fn-explicit-align Reformat using the new identifier sorting from rustfmt 2024-09-22 19:11:29 -04:00
extern-fn-generic rewrite extern-fn-with-union to rmake 2024-07-19 12:27:47 -04:00
extern-fn-mangle rewrite extern-fn-mangle to rmake 2024-07-17 15:33:17 -04:00
extern-fn-reachable tests: port extern-fn-reachable to rmake.rs 2025-01-15 01:05:16 +08:00
extern-fn-slice-no-ice rewrite and rename issue-25581 2024-07-17 15:33:06 -04:00
extern-fn-struct-passing-abi Use field init shorthand where possible 2024-12-17 14:33:10 -08:00
extern-fn-with-extern-types rewrite extern-fn-with-extern-types to rmake 2024-07-17 15:33:05 -04:00
extern-fn-with-packed-struct rewrite extern-fn-with-packed-struct to rmake 2024-07-17 15:33:07 -04:00
extern-fn-with-union rewrite extern-fn-with-union to rmake 2024-07-19 12:27:47 -04:00
extern-multiple-copies ignore run-make tests that need std on no_std targets 2025-06-12 15:10:12 +02:00
extern-multiple-copies2 ignore run-make tests that need std on no_std targets 2025-06-12 15:10:12 +02:00
extern-overrides-distribution rewrite extern-overrides-distribution to rmake 2024-06-18 16:30:26 -04:00
external-crate-panic-handle-no-lint Remove all usages of tmp_dir from tests 2024-06-07 11:12:24 +02:00
extra-filename-with-temp-outputs tests: produce target artifacts and/or require crate type / ignore cross-compile 2025-04-12 15:09:06 +08:00
fmt-write-bloat remove support for the #[start] attribute 2025-01-21 06:59:15 -07:00
forced-unwind-terminate-pof Rollup merge of #126644 - Oneirical:testla-coil, r=jieyouxu 2024-06-20 18:20:12 +02:00
foreign-double-unwind rewrite foreign-exceptions to rmake 2024-08-02 10:06:20 -04:00
foreign-exceptions Reformat using the new identifier sorting from rustfmt 2024-09-22 19:11:29 -04:00
foreign-rust-exceptions rewrite export-executable-symbols to rmake 2024-07-26 10:17:39 -04:00
glibc-staticlib-args Improve run-make-support library args API 2024-06-30 12:40:24 +02:00
glibc-symbols-x86_64-unknown-linux-gnu Reword comment slightly 2025-01-22 17:22:39 +01:00
ice-dep-cannot-find-dep remove unused imports from rmake tests 2024-08-10 18:06:10 +00:00
ice-static-mir ignore run-make tests that need std on no_std targets 2025-06-12 15:10:12 +02:00
import-macro-verbatim fix a few typos in rmake tests' comments 2024-12-23 09:40:38 +00:00
inaccessible-temp-dir tests: update for rfs rename 2024-07-17 13:34:18 +00:00
include-all-symbols-linking ignore run-make tests that need std on no_std targets 2025-06-12 15:10:12 +02:00
include-bytes-deps ignore run-make tests that need std on no_std targets 2025-06-12 15:10:12 +02:00
incr-add-rust-src-component tests: migrate incr-add-rust-src-component to rmake.rs 2024-12-23 20:23:57 +08:00
incr-foreign-head-span Modify some run-make tests to use //@ needs-target-std 2025-06-10 23:31:05 +08:00
incr-prev-body-beyond-eof Modify some run-make tests to use //@ needs-target-std 2025-06-10 23:31:05 +08:00
incr-test-moved-file Modify some run-make tests to use //@ needs-target-std 2025-06-10 23:31:05 +08:00
incremental-debugger-visualizer ignore run-make tests that need std on no_std targets 2025-06-12 15:10:12 +02:00
incremental-session-fail tests: update for rfs rename 2024-07-17 13:34:18 +00:00
inline-always-many-cgu ignore run-make tests that need std on no_std targets 2025-06-12 15:10:12 +02:00
interdependent-c-libraries rewrite incr-foreign-head-span to rmake 2024-07-25 11:08:07 -04:00
intrinsic-unreachable Reformat use declarations. 2024-07-29 08:26:52 +10:00
invalid-library Reformat use declarations. 2024-07-29 08:26:52 +10:00
invalid-so ignore run-make tests that need std on no_std targets 2025-06-12 15:10:12 +02:00
invalid-staticlib ignore run-make tests that need std on no_std targets 2025-06-12 15:10:12 +02:00
invalid-symlink-search-path ignore run-make tests that need std on no_std targets 2025-06-12 15:10:12 +02:00
invalid-tmpdir-env-var ignore run-make tests that need std on no_std targets 2025-06-12 15:10:12 +02:00
issue-84395-lto-embed-bitcode tests/run-make: port issue-84395-lto-embed-bitcode to rmake.rs 2024-10-22 19:43:22 +08:00
issue-107495-archive-permissions ignore run-make tests that need std on no_std targets 2025-06-12 15:10:12 +02:00
issue-125484-used-dependencies ignore run-make tests that need std on no_std targets 2025-06-12 15:10:12 +02:00
jobserver-error tests: port jobserver-error.rs to rmake.rs 2025-01-22 12:26:50 +08:00
json-error-no-offset ignore run-make tests that need std on no_std targets 2025-06-12 15:10:12 +02:00
lib-trait-for-trait-no-ice ignore run-make tests that need std on no_std targets 2025-06-12 15:10:12 +02:00
libs-through-symlinks tests: add a missing needs-symlink 2025-02-07 01:41:54 +08:00
libstd-no-protected remove unused imports from rmake tests 2024-12-23 09:40:25 +00:00
libtest-json Try to write the panic message with a single write_all call 2025-01-01 15:58:29 +01:00
libtest-junit Try to write the panic message with a single write_all call 2025-01-01 15:58:29 +01:00
libtest-padding rewrite libtest-padding to rmake 2024-06-26 11:44:23 -04:00
libtest-thread-limit remove unused imports from rmake tests 2024-12-23 09:40:25 +00:00
link-arg ignore run-make tests that need std on no_std targets 2025-06-12 15:10:12 +02:00
link-args-order ignore run-make tests that need std on no_std targets 2025-06-12 15:10:12 +02:00
link-cfg rewrite link-cfg to rmake 2024-07-29 14:33:54 -04:00
link-dedup ignore run-make tests that need std on no_std targets 2025-06-12 15:10:12 +02:00
link-eh-frame-terminator rewrite and rename issue-69368 to rmake 2024-07-30 14:44:14 -04:00
link-framework Migrate run-make/link-framework to rmake.rs 2024-07-22 23:21:59 +02:00
link-native-static-lib-to-dylib Rename tests/run-make/issue-15460 into tests/run-make/link-native-static-lib-to-dylib 2024-07-23 11:47:11 +02:00
link-path-order rewrite link-path-order to rmake 2024-07-18 16:27:34 -04:00
linkage-attr-framework port tests/ui/linkage-attr/framework to run-make 2024-10-27 21:23:28 -04:00
linkage-attr-on-static rewrite linkage-attr-on-static to rmake 2024-07-19 12:27:47 -04:00
linker-warning ignore run-make tests that need std on no_std targets 2025-06-12 15:10:12 +02:00
llvm-ident tests: use renamed stdin_buf 2024-09-05 08:43:38 +00:00
llvm-location-discriminator-limit-dummy-span [win][arm64] Remove 'Arm64 Hazard' undocumented MSVC option and instead disable problematic test 2025-05-15 11:33:28 -07:00
llvm-outputs ignore run-make tests that need std on no_std targets 2025-06-12 15:10:12 +02:00
long-linker-command-lines rewrite long-linker-command-lines-cmd-exe to rmake 2024-08-06 11:03:18 -04:00
long-linker-command-lines-cmd-exe rewrite long-linker-command-lines-cmd-exe to rmake 2024-08-06 11:03:18 -04:00
longjmp-across-rust Fix longjmp-across-rust test 2024-10-10 15:02:47 +01:00
ls-metadata Reformat use declarations. 2024-07-29 08:26:52 +10:00
lto-avoid-object-duplication ignore run-make tests that need std on no_std targets 2025-06-12 15:10:12 +02:00
lto-dylib-dep rewrite lto-dylib-dep to rmake 2024-06-26 13:32:30 -04:00
lto-empty rewrite lto-empty to rmake 2024-06-25 14:27:43 -04:00
lto-linkage-used-attr rewrite pgo-gen-no-imp-symbols to rmake 2024-07-22 13:25:39 -04:00
lto-no-link-whole-rlib rewrite lto-no-link-whole-rlib to rmake 2024-07-19 12:27:47 -04:00
lto-readonly-lib remove unused imports from rmake tests 2024-08-10 18:06:10 +00:00
lto-smoke Rewrite simple-rlib to rmake 2024-05-28 11:41:53 -04:00
lto-smoke-c rewrite link-path-order to rmake 2024-07-18 16:27:34 -04:00
macos-fat-archive rewrite macos-fat-archive to rmake 2024-07-18 09:28:30 -04:00
manual-crate-name ignore run-make tests that need std on no_std targets 2025-06-12 15:10:12 +02:00
manual-link rewrite manual-link to rmake 2024-07-18 09:28:30 -04:00
many-crates-but-no-match ignore run-make tests that need std on no_std targets 2025-06-12 15:10:12 +02:00
metadata-dep-info ignore run-make tests that need std on no_std targets 2025-06-12 15:10:12 +02:00
metadata-flag-frobs-symbols rewrite forced-unwind-terminate-pof to rmake 2024-06-19 14:39:09 -04:00
metadata-only-crate-no-ice ignore run-make tests that need std on no_std targets 2025-06-12 15:10:12 +02:00
min-global-align tests: {Meta,Pointee}Sized in non-minicore tests 2025-06-16 23:04:33 +00:00
mingw-export-call-convention rewrite mingw-export-call-convention to rmake 2024-06-25 12:46:58 -04:00
mismatching-target-triples rewrite mismatching-target-triples to rmake 2024-06-21 15:46:34 -04:00
missing-crate-dependency ignore run-make tests that need std on no_std targets 2025-06-12 15:10:12 +02:00
missing-unstable-trait-bound remove unused imports from rmake tests 2024-12-23 09:40:25 +00:00
mixing-deps Run rustfmt on tests/run-make/. 2024-05-31 21:30:08 +10:00
mixing-formats Implement fs wrapper for run_make_support 2024-06-11 09:53:31 -04:00
mixing-libs tests: update for rfs rename 2024-07-17 13:34:18 +00:00
moved-src-dir-fingerprint-ice Modify some run-make tests to use //@ needs-target-std 2025-06-10 23:31:05 +08:00
msvc-lld-thinlto-imp-symbols add non-regression test for issue 81408 2024-09-22 11:40:00 +02:00
msvc-wholearchive Test wholearchive on rust staticlib 2024-08-19 18:26:55 +00:00
mte-ffi ci: move tests from x86_64-gnu-llvm-19 job to aarch64 2025-05-26 22:27:20 +02:00
multiple-emits ignore run-make tests that need std on no_std targets 2025-06-12 15:10:12 +02:00
musl-default-linking Target definition for wasm32-wali-linux-musl to support the Wasm Linux 2025-03-10 21:26:45 -04:00
naked-symbol-visibility stabilize naked_functions 2025-04-20 11:18:38 +02:00
native-lib-alt-naming ignore run-make tests that need std on no_std targets 2025-06-12 15:10:12 +02:00
native-lib-load-order rewrite and rename issue-28595 to rmake 2024-07-19 12:27:46 -04:00
native-link-modifier-bundle rewrite native-link-modifier-bundle to rmake 2024-08-15 10:17:38 -04:00
native-link-modifier-verbatim-linker ignore run-make tests that need std on no_std targets 2025-06-12 15:10:12 +02:00
native-link-modifier-verbatim-rustc ignore run-make tests that need std on no_std targets 2025-06-12 15:10:12 +02:00
native-link-modifier-whole-archive rewrite no-builtins-attribute to rmake 2024-07-26 12:07:33 -04:00
no-alloc-shim Change __rust_no_alloc_shim_is_unstable to be a function 2025-06-16 10:54:07 -07:00
no-builtins-attribute ignore run-make tests that need std on no_std targets 2025-06-12 15:10:12 +02:00
no-builtins-lto ignore run-make tests that need std on no_std targets 2025-06-12 15:10:12 +02:00
no-cdylib-as-rdylib port no-cdylib-as-rdylib test 2024-05-14 17:02:20 -04:00
no-duplicate-libs Enable msvc for no-duplicate-libs 2024-08-04 02:57:18 +00:00
no-input-file Avoid a couple of unnecessary EarlyDiagCtxt uses 2024-06-22 17:06:47 +00:00
no-intermediate-extras Reformat use declarations. 2024-07-29 08:26:52 +10:00
non-pie-thread-local Remove all usages of tmp_dir from tests 2024-06-07 11:12:24 +02:00
non-unicode-env ignore run-make tests that need std on no_std targets 2025-06-12 15:10:12 +02:00
non-unicode-in-incremental-dir ignore run-make tests that need std on no_std targets 2025-06-12 15:10:12 +02:00
notify-all-emit-artifacts ignore run-make tests that need std on no_std targets 2025-06-12 15:10:12 +02:00
obey-crate-type-flag Reformat use declarations. 2024-07-29 08:26:52 +10:00
optimization-remarks-dir ignore run-make tests that need std on no_std targets 2025-06-12 15:10:12 +02:00
optimization-remarks-dir-pgo Rename directive needs-profiler-support to needs-profiler-runtime 2024-10-09 20:58:27 +11:00
output-filename-conflicts-with-directory tests: update for rfs rename 2024-07-17 13:34:18 +00:00
output-filename-overwrites-input tests: update for rfs rename 2024-07-17 13:34:18 +00:00
output-type-permutations tests: produce target artifacts and/or require crate type / ignore cross-compile 2025-04-12 15:09:06 +08:00
output-with-hyphens Add new test_while_readonly helper function to run-make-support 2024-06-17 14:37:49 -04:00
override-aliased-flags Migrate run-make/override-aliased-flags to rmake.rs 2024-06-29 11:55:30 +02:00
overwrite-input ignore run-make tests that need std on no_std targets 2025-06-12 15:10:12 +02:00
panic-abort-eh_frame rewrite panic-abort-eh_frame to rmake 2024-07-25 11:17:34 -04:00
panic-impl-transitive Remove all usages of tmp_dir from tests 2024-06-07 11:12:24 +02:00
parallel-rustc-no-overwrite ignore run-make tests that need std on no_std targets 2025-06-12 15:10:12 +02:00
pass-linker-flags ignore run-make tests that need std on no_std targets 2025-06-12 15:10:12 +02:00
pass-linker-flags-flavor rewrite pass-linker-flags-from-dep to rmake 2024-07-05 12:47:19 -04:00
pass-linker-flags-from-dep ignore run-make tests that need std on no_std targets 2025-06-12 15:10:12 +02:00
pass-non-c-like-enum-to-c rewrite pass-non-c-like-enum-to-c to rmake 2024-07-19 12:27:47 -04:00
pdb-alt-path rewrite mingw-export-call-convention to rmake 2024-06-25 12:46:58 -04:00
pdb-buildinfo-cl-cmd Add test for S_OBJNAME and update test for LF_BUILDINFO cl and cmd for 2024-09-10 17:23:05 +02:00
pdb-sobjname Add test for S_OBJNAME and update test for LF_BUILDINFO cl and cmd for 2024-09-10 17:23:05 +02:00
pgo-branch-weights Rename directive needs-profiler-support to needs-profiler-runtime 2024-10-09 20:58:27 +11:00
pgo-embed-bc-lto The embedded bitcode should always be prepared for LTO/ThinLTO 2025-02-23 21:23:36 +08:00
pgo-gen Rename directive needs-profiler-support to needs-profiler-runtime 2024-10-09 20:58:27 +11:00
pgo-gen-lto Rename directive needs-profiler-support to needs-profiler-runtime 2024-10-09 20:58:27 +11:00
pgo-gen-no-imp-symbols ignore run-make tests that need std on no_std targets 2025-06-12 15:10:12 +02:00
pgo-indirect-call-promotion Rename directive needs-profiler-support to needs-profiler-runtime 2024-10-09 20:58:27 +11:00
pgo-use Rename directive needs-profiler-support to needs-profiler-runtime 2024-10-09 20:58:27 +11:00
pointer-auth-link-with-c [arm64] Pointer auth test should link with C static library statically 2025-05-07 10:52:18 -07:00
pointer-auth-link-with-c-lto-clang tests: Test pac-ret flag merging on clang with LTO 2024-11-15 14:13:38 +00:00
prefer-dylib tests: update for rfs rename 2024-07-17 13:34:18 +00:00
prefer-rlib tests: update for rfs rename 2024-07-17 13:34:18 +00:00
pretty-print-to-file rewrite pretty-print-to-file to rmake 2024-06-26 11:44:11 -04:00
pretty-print-with-dep-file ignore run-make tests that need std on no_std targets 2025-06-12 15:10:12 +02:00
print-cfg tests/run-make: add missing needs-llvm-components 2024-08-26 18:20:32 +08:00
print-check-cfg remove unused imports from rmake tests 2024-08-10 18:06:10 +00:00
print-crate-root-lint-levels Add unstable --print=crate-root-lint-levels 2025-04-01 18:29:39 +02:00
print-native-static-libs remove unused imports from rmake tests 2024-08-10 18:06:10 +00:00
print-request-help-stable-unstable Hide unstable print kinds within emit_unknown_print_request_help in stable channel 2025-04-17 22:02:31 +08:00
print-target-cpus-native Add a run-make test for same-arch --print=target-cpus 2024-11-02 23:39:29 +11:00
print-target-list tests/run-make: add missing needs-llvm-components 2024-08-26 18:20:32 +08:00
print-to-output tests/run-make: add missing needs-llvm-components 2024-08-26 18:20:32 +08:00
proc-macro-init-order Run rustfmt on tests/run-make/. 2024-05-31 21:30:08 +10:00
proc-macro-three-crates ignore run-make tests that need std on no_std targets 2025-06-12 15:10:12 +02:00
prune-link-args build_native_static_lib with llvm_ar for run_make_support 2024-07-16 15:34:04 -04:00
raw-dylib-alt-calling-convention rewrite redundant-libs to rmake 2024-08-05 10:11:53 -04:00
raw-dylib-c rewrite redundant-libs to rmake 2024-08-05 10:11:53 -04:00
raw-dylib-cross-compilation tests: {Meta,Pointee}Sized in non-minicore tests 2025-06-16 23:04:33 +00:00
raw-dylib-custom-dlltool rewrite raw-dylib-custom-dlltool to rmake 2024-07-12 16:41:28 -04:00
raw-dylib-elf Support raw-dylib link kind on ELF 2025-02-26 19:09:51 +01:00
raw-dylib-elf-verbatim Support raw-dylib link kind on ELF 2025-02-26 19:09:51 +01:00
raw-dylib-elf-verbatim-absolute Support raw-dylib link kind on ELF 2025-02-26 19:09:51 +01:00
raw-dylib-import-name-type rewrite raw-dylib-stdcall-ordinal to rmake 2024-07-29 10:58:28 -04:00
raw-dylib-inline-cross-dylib rewrite raw-dylib-custom-dlltool to rmake 2024-07-12 16:41:28 -04:00
raw-dylib-link-ordinal rewrite raw-dylib-stdcall-ordinal to rmake 2024-07-29 10:58:28 -04:00
raw-dylib-stdcall-ordinal rewrite raw-dylib-stdcall-ordinal to rmake 2024-07-29 10:58:28 -04:00
raw-fn-pointer-opt-undefined-behavior rewrite and rename issue-20626 to rmake 2024-06-25 15:02:19 -04:00
reachable-extern-fn-available-lto Remove unnecessary functions and the last mention of TMPDIR from run-make-support 2024-06-08 13:10:55 +02:00
redundant-libs remove unused imports from rmake tests 2024-08-10 18:06:10 +00:00
relocation-model rewrite crate-name-priority to rmake 2024-06-20 16:09:39 -04:00
relro-levels Reformat use declarations. 2024-07-29 08:26:52 +10:00
remap-path-prefix ignore run-make tests that need std on no_std targets 2025-06-12 15:10:12 +02:00
remap-path-prefix-dwarf ignore run-make tests that need std on no_std targets 2025-06-12 15:10:12 +02:00
remove-dir-all-race clean up remove-dir-all-race rmake test 2024-12-23 09:40:38 +00:00
repr128-dwarf ignore run-make tests that need std on no_std targets 2025-06-12 15:10:12 +02:00
reproducible-build tests: produce target artifacts and/or require crate type / ignore cross-compile 2025-04-12 15:09:06 +08:00
reproducible-build-2 ignore run-make tests that need std on no_std targets 2025-06-12 15:10:12 +02:00
reset-codegen-1 Use path instead of Path in some run-make tests 2024-08-29 10:15:17 -04:00
resolve-rename ignore run-make tests that need std on no_std targets 2025-06-12 15:10:12 +02:00
return-non-c-like-enum Improve run-make-support library args API 2024-06-30 12:40:24 +02:00
return-non-c-like-enum-from-c rewrite return-non-c-like-enum-from-c to rmake 2024-07-19 12:27:26 -04:00
rlib-chain tests: update for rfs rename 2024-07-17 13:34:18 +00:00
rlib-format-packed-bundled-libs rewrite native-link-modifier-bundle to rmake 2024-08-15 10:17:38 -04:00
rlib-format-packed-bundled-libs-2 ignore run-make tests that need std on no_std targets 2025-06-12 15:10:12 +02:00
rlib-format-packed-bundled-libs-3 remove unused imports from rmake tests 2024-08-10 18:06:10 +00:00
rmeta-preferred rewrite rmeta-preferred to rmake 2024-07-04 10:05:56 -04:00
run-in-tmpdir-self-test remove unused imports from rmake tests 2024-08-10 18:06:10 +00:00
rust-lld Move link-self-contained-consistency test to a more reasonable location 2025-04-03 15:41:38 +02:00
rust-lld-by-default-beta-stable Add a helper function for checking if LLD was used to run-make-support 2025-04-03 15:40:23 +02:00
rust-lld-by-default-nightly Add a helper function for checking if LLD was used to run-make-support 2025-04-03 15:40:23 +02:00
rust-lld-custom-target Add a helper function for checking if LLD was used to run-make-support 2025-04-03 15:40:23 +02:00
rust-lld-link-script-provide Add a test case for #131164 2024-10-23 19:01:38 +08:00
rustc-crates-on-stable Move hashes from rustc_data_structure to rustc_hashes so they can be shared with rust-analyzer 2025-02-16 16:18:30 -05:00
rustc-help Unify the format of rustc cli flags 2025-04-24 12:54:40 +08:00
rustc-macro-dep-files ignore run-make tests that need std on no_std targets 2025-06-12 15:10:12 +02:00
rustdoc-cfgspec-parsing Rewrite and rename issue-26006 to rmake 2024-07-18 11:14:07 -04:00
rustdoc-default-output Rollup merge of #139863 - fmease:simp-doctest-build-arg-passing, r=GuillaumeGomez 2025-05-09 21:50:06 +02:00
rustdoc-dep-info Add run-make test for rustdoc --emit=dep-info option 2025-02-26 20:36:23 +01:00
rustdoc-determinism Use path instead of Path in some run-make tests 2024-08-29 10:15:17 -04:00
rustdoc-error-lines Correctly handle line comments in attributes and generate extern crates 2025-03-27 11:18:43 +01:00
rustdoc-io-error About rmake tests 2024-08-15 15:44:29 +02:00
rustdoc-map-file remove unused imports from rmake tests 2024-12-23 09:40:25 +00:00
rustdoc-output-path Use path instead of Path in some run-make tests 2024-08-29 10:15:17 -04:00
rustdoc-output-stdout remove unused imports from rmake tests 2024-12-23 09:40:25 +00:00
rustdoc-scrape-examples-invalid-expr ignore run-make tests that need std on no_std targets 2025-06-12 15:10:12 +02:00
rustdoc-scrape-examples-macros Fix test directives that were accidentally ignored 2025-02-27 13:22:16 +00:00
rustdoc-scrape-examples-multiple ignore run-make tests that need std on no_std targets 2025-06-12 15:10:12 +02:00
rustdoc-scrape-examples-ordering ignore run-make tests that need std on no_std targets 2025-06-12 15:10:12 +02:00
rustdoc-scrape-examples-remap ignore run-make tests that need std on no_std targets 2025-06-12 15:10:12 +02:00
rustdoc-scrape-examples-test ignore run-make tests that need std on no_std targets 2025-06-12 15:10:12 +02:00
rustdoc-scrape-examples-whitespace ignore run-make tests that need std on no_std targets 2025-06-12 15:10:12 +02:00
rustdoc-shared-flags Reformat using the new identifier sorting from rustfmt 2024-09-22 19:11:29 -04:00
rustdoc-target-spec-json-path About rmake tests 2024-08-15 15:44:29 +02:00
rustdoc-tempdir-removal Make rustdoc-tempdir-removal run-make tests work on other platforms than linux 2025-05-08 15:24:05 +02:00
rustdoc-test-args Reformat use declarations. 2024-07-29 08:26:52 +10:00
rustdoc-themes Fix test directives that were accidentally ignored 2025-02-27 13:22:16 +00:00
rustdoc-verify-output-files Reformat use declarations. 2024-07-29 08:26:52 +10:00
rustdoc-with-out-dir-option Fix test directives that were accidentally ignored 2025-02-27 13:22:16 +00:00
rustdoc-with-output-option Fix test directives that were accidentally ignored 2025-02-27 13:22:16 +00:00
rustdoc-with-short-out-dir-option ignore run-make tests that need std on no_std targets 2025-06-12 15:10:12 +02:00
sanitizer-cdylib-link rewrite sanitizer-cdylib-link to rmake 2024-07-23 10:26:35 -04:00
sanitizer-dylib-link Revert "Fix linking statics on Arm64EC #140176" 2025-05-15 16:54:27 +08:00
sanitizer-staticlib-link rewrite sanitizer-staticlib-link to rmake 2024-07-26 11:45:19 -04:00
separate-link tests: use renamed stdin_buf 2024-09-05 08:43:38 +00:00
separate-link-fail rewrite separate-link-fail to rmake.rs 2024-06-17 15:59:39 -04:00
share-generics-dylib ignore run-make tests that need std on no_std targets 2025-06-12 15:10:12 +02:00
share-generics-export-again rewrite issue64319 and rename 2024-05-17 11:49:20 -04:00
short-ice ignore run-make tests that need std on no_std targets 2025-06-12 15:10:12 +02:00
silly-file-names tests: update for rfs rename 2024-07-17 13:34:18 +00:00
simd-ffi tests: {Meta,Pointee}Sized in non-minicore tests 2025-06-16 23:04:33 +00:00
split-debuginfo tests: port split-debuginfo to rmake.rs 2025-02-01 16:14:58 +08:00
stable-symbol-names ignore run-make tests that need std on no_std targets 2025-06-12 15:10:12 +02:00
static-dylib-by-default rewrite sanitizer-staticlib-link to rmake 2024-07-26 11:45:19 -04:00
static-extern-type rewrite static-extern-type to rmake 2024-07-17 15:33:07 -04:00
static-pie tests: use renamed stdin_buf 2024-09-05 08:43:38 +00:00
static-unwinding Run rustfmt on tests/run-make/. 2024-05-31 21:30:08 +10:00
staticlib-blank-lib ignore run-make tests that need std on no_std targets 2025-06-12 15:10:12 +02:00
staticlib-broken-bitcode ignore run-make tests that need std on no_std targets 2025-06-12 15:10:12 +02:00
staticlib-dylib-linkage run-make: enable msvc for staticlib-dylib-linkage 2024-08-08 12:17:15 +00:00
staticlib-thin-archive ignore run-make tests that need std on no_std targets 2025-06-12 15:10:12 +02:00
std-core-cycle rewrite and rename issue-18943 to rmake 2024-07-08 09:59:08 -04:00
stdin-rustc ignore run-make tests that need std on no_std targets 2025-06-12 15:10:12 +02:00
stdin-rustdoc tests: use renamed stdin_buf 2024-09-05 08:43:38 +00:00
strip tests: produce target artifacts and/or require crate type / ignore cross-compile 2025-04-12 15:09:06 +08:00
suspicious-library Reformat use declarations. 2024-07-29 08:26:52 +10:00
symbol-mangling-hashed tests: port symbol-mangling-hashed to rmake.rs 2025-01-31 04:30:51 +00:00
symbol-visibility ignore run-make tests that need std on no_std targets 2025-06-12 15:10:12 +02:00
symbols-all-mangled Change __rust_no_alloc_shim_is_unstable to be a function 2025-06-16 10:54:07 -07:00
symbols-include-type-name ignore run-make tests that need std on no_std targets 2025-06-12 15:10:12 +02:00
symlinked-extern tests/run-make: update for symlink helper changes 2024-09-16 21:31:41 +08:00
symlinked-libraries tests/run-make: update for symlink helper changes 2024-09-16 21:31:41 +08:00
symlinked-rlib tests/run-make: update for symlink helper changes 2024-09-16 21:31:41 +08:00
sysroot-crates-are-unstable tests: use renamed stdin_buf 2024-09-05 08:43:38 +00:00
target-cpu-native ignore tests broken while cross compiling 2025-03-24 11:33:56 +01:00
target-specs tests: {Meta,Pointee}Sized in non-minicore tests 2025-06-16 23:04:33 +00:00
target-without-atomic-cas tests/run-make: add missing needs-llvm-components 2024-08-26 18:20:32 +08:00
test-benches rewrite compiler-lookup-paths-2 to rmake 2024-07-19 16:48:21 -04:00
test-harness rewrite test-harness to rmake 2024-07-02 11:37:59 -04:00
textrel-on-minimal-lib Improve run-make-support library args API 2024-06-30 12:40:24 +02:00
thumb-none-cortex-m Update run-make tests to use cargo wrapper cmd 2024-09-24 19:04:51 +08:00
thumb-none-qemu Remove unused code 2024-11-30 16:29:49 +08:00
track-path-dep-info ignore run-make tests that need std on no_std targets 2025-06-12 15:10:12 +02:00
track-pgo-dep-info Rename directive needs-profiler-support to needs-profiler-runtime 2024-10-09 20:58:27 +11:00
translation tests: port translation to rmake.rs 2025-01-29 08:11:01 +00:00
type-mismatch-same-crate-name ignore run-make tests that need std on no_std targets 2025-06-12 15:10:12 +02:00
unknown-mod-stdin ignore run-make tests that need std on no_std targets 2025-06-12 15:10:12 +02:00
unstable-feature-usage-metrics Don't match on platform-specific directory not found message 2025-06-17 10:53:11 +08:00
unstable-feature-usage-metrics-incremental Don't match on platform-specific directory not found message 2025-06-17 10:53:11 +08:00
unstable-flag-required rewrite unstable-flag-required to rmake 2024-07-17 16:11:11 -04:00
use-suggestions-rust-2018 ignore run-make tests that need std on no_std targets 2025-06-12 15:10:12 +02:00
used ignore run-make tests that need std on no_std targets 2025-06-12 15:10:12 +02:00
used-cdylib-macos rewrite used-cdylib-macos to rmake 2024-06-28 16:28:57 -04:00
version-check test: convert version_check ui test to run-make 2025-05-27 11:12:15 +02:00
version-verbose-commit-hash Compile run-make recipes using the stage0 compiler 2025-03-01 22:11:02 +01:00
volatile-intrinsics Reformat use declarations. 2024-07-29 08:26:52 +10:00
wasm-custom-section Reformat use declarations. 2024-07-29 08:26:52 +10:00
wasm-custom-sections-opt Reformat use declarations. 2024-07-29 08:26:52 +10:00
wasm-exceptions-nostd Rollup merge of #126880 - Rejyr:migrate-rmake-vw, r=Kobzol 2024-07-01 20:29:57 +02:00
wasm-export-all-symbols Rustfmt 2025-02-08 22:12:13 +00:00
wasm-import-module Reformat use declarations. 2024-07-29 08:26:52 +10:00
wasm-override-linker run cross-lang-lto-pgo-smoketest in CI by renaming it 2024-08-02 11:54:20 -04:00
wasm-panic-small Fix two new failing tests 2024-07-19 10:27:14 -07:00
wasm-spurious-import Reformat use declarations. 2024-07-29 08:26:52 +10:00
wasm-stringify-ints-small Fix two new failing tests 2024-07-19 10:27:14 -07:00
wasm-symbols-different-module Reformat use declarations. 2024-07-29 08:26:52 +10:00
wasm-symbols-not-exported Reformat use declarations. 2024-07-29 08:26:52 +10:00
wasm-symbols-not-imported Reformat use declarations. 2024-07-29 08:26:52 +10:00
weird-output-filenames Reformat use declarations. 2024-07-29 08:26:52 +10:00
windows-binary-no-external-deps Reformat use declarations. 2024-07-29 08:26:52 +10:00
windows-safeseh update run-make/windows-safeseh compiletest header 2024-06-28 20:32:31 +03:00
windows-spawn Remove all usages of tmp_dir from tests 2024-06-07 11:12:24 +02:00
windows-ws2_32 Reformat use declarations. 2024-07-29 08:26:52 +10:00
x86_64-fortanix-unknown-sgx-lvi tests: use renamed stdin_buf 2024-09-05 08:43:38 +00:00
zero-extend-abi-param-passing Enable msvc for zero-extend-abi-param-passing 2024-08-04 02:57:17 +00:00
README.md run-make: update test suite README 2025-03-02 05:56:56 +08:00

The run-make test suite

The run-make test suite contains tests which are the most flexible out of all the rust-lang/rust test suites. run-make tests can basically contain arbitrary code, and are supported by the run_make_support library.

Infrastructure

A run-make test is a test recipe source file rmake.rs accompanied by its parent directory (e.g. tests/run-make/foo/rmake.rs is the foo run-make test).

The implementation for collecting and building the rmake.rs recipes are in src/tools/compiletest/src/runtest.rs, in run_rmake_test.

The setup for the rmake.rs can be summarized as a 3-stage process:

  1. First, we build the run_make_support library in bootstrap as a tool lib.

  2. Then, we compile the rmake.rs "recipe" linking the support library and its dependencies in, and provide a bunch of env vars. We setup a directory structure within build/<target>/test/run-make/

    <test-name>/
        rmake.exe              # recipe binary
        rmake_out/             # sources from test sources copied over
    

    and copy non-rmake.rs input support files over to rmake_out/. The support library is made available as an extern prelude.

  3. Finally, we run the recipe binary and set rmake_out/ as the working directory.