Auto merge of #146148 - Flakebi:global-addrspace-test, r=Mark-Simulacrum
Add amdgpu test for addrspacecasting global vars and the gpu-kernel calling convention
Add two tests that can now be added, as the amdgpu is merged.
- Global variables are casted to the default address space since rust-lang/rust#135026
- gpu-kernel calling convention, translatos to amdgpu_kernel rust-lang/rust#135047
Tracking issue: rust-lang/rust#135024
diff --git a/src/building/bootstrapping/writing-tools-in-bootstrap.md b/src/building/bootstrapping/writing-tools-in-bootstrap.md
index 41d0cf8..c3660e2 100644
--- a/src/building/bootstrapping/writing-tools-in-bootstrap.md
+++ b/src/building/bootstrapping/writing-tools-in-bootstrap.md
@@ -11,11 +11,8 @@
Use this for tools that rely on the locally built std. The output goes into the "stageN-tools" directory.
This mode is rarely used, mainly for `compiletest` which requires `libtest`.
-- **`Mode::ToolRustc`**
- Use this for tools that depend on both the locally built `rustc` and the target `std`. This is more complex than
- the other modes because the tool must be built with the same compiler used for `rustc` and placed in the "stageN-tools"
- directory. When you choose `Mode::ToolRustc`, `ToolBuild` implementation takes care of this automatically.
- If you need to use the builder’s compiler for something specific, you can get it from `ToolBuildResult`, which is
+- **`Mode::ToolRustcPrivate`**
+ Use this for tools that use the `rustc_private` mechanism, and thus depend on the locally built `rustc` and its rlib artifacts. This is more complex than the other modes because the tool must be built with the same compiler used for `rustc` and placed in the "stageN-tools" directory. When you choose `Mode::ToolRustcPrivate`, `ToolBuild` implementation takes care of this automatically. If you need to use the builder’s compiler for something specific, you can get it from `ToolBuildResult`, which is
returned by the tool's [`Step`].
Regardless of the tool type you must return `ToolBuildResult` from the tool’s [`Step`] implementation and use `ToolBuild` inside it.
diff --git a/src/tests/adding.md b/src/tests/adding.md
index e5c26be..46b8a1e 100644
--- a/src/tests/adding.md
+++ b/src/tests/adding.md
@@ -29,6 +29,8 @@
suites.
- Need to inspect the resulting binary in some way? Or if all the other test
suites are too limited for your purposes? Then use `run-make`.
+ - Use `run-make-cargo` if you need to exercise in-tree `cargo` in conjunction
+ with in-tree `rustc`.
- Check out the [compiletest] chapter for more specialized test suites.
After deciding on which kind of test to add, see [best
diff --git a/src/tests/best-practices.md b/src/tests/best-practices.md
index be00207..efc6260 100644
--- a/src/tests/best-practices.md
+++ b/src/tests/best-practices.md
@@ -83,10 +83,10 @@
- E.g. for an implementation of RFC 2093 specifically, we can group a
collection of tests under `tests/ui/rfc-2093-infer-outlives/`. For the
directory name, include what the RFC is about.
-- For the [`run-make`] test suite, each `rmake.rs` must be contained within an
- immediate subdirectory under `tests/run-make/`. Further nesting is not
- presently supported. Avoid including issue number in the directory name too,
- include that info in a comment inside `rmake.rs`.
+- For the [`run-make`]/`run-make-support` test suites, each `rmake.rs` must
+ be contained within an immediate subdirectory under `tests/run-make/` or
+ `tests/run-make-cargo/` respectively. Further nesting is not presently
+ supported. Avoid using _only_ an issue number for the test name as well.
## Test descriptions
diff --git a/src/tests/compiletest.md b/src/tests/compiletest.md
index 4980ed8..a4a7299 100644
--- a/src/tests/compiletest.md
+++ b/src/tests/compiletest.md
@@ -397,13 +397,19 @@
### `run-make` tests
-The tests in [`tests/run-make`] are general-purpose tests using Rust *recipes*,
-which are small programs (`rmake.rs`) allowing arbitrary Rust code such as
-`rustc` invocations, and is supported by a [`run_make_support`] library. Using
-Rust recipes provide the ultimate in flexibility.
+The tests in [`tests/run-make`] and [`tests/run-make-cargo`] are general-purpose
+tests using Rust *recipes*, which are small programs (`rmake.rs`) allowing
+arbitrary Rust code such as `rustc` invocations, and is supported by a
+[`run_make_support`] library. Using Rust recipes provide the ultimate in
+flexibility.
`run-make` tests should be used if no other test suites better suit your needs.
+The `run-make-cargo` test suite additionally builds an in-tree `cargo` to support
+use cases that require testing in-tree `cargo` in conjunction with in-tree `rustc`.
+The `run-make` test suite does not have access to in-tree `cargo` (so it can be the
+faster-to-iterate test suite).
+
#### Using Rust recipes
Each test should be in a separate directory with a `rmake.rs` Rust program,
@@ -476,6 +482,7 @@
```
[`tests/run-make`]: https://github.com/rust-lang/rust/tree/master/tests/run-make
+[`tests/run-make-cargo`]: https://github.com/rust-lang/rust/tree/master/tests/run-make-cargo
[`run_make_support`]: https://github.com/rust-lang/rust/tree/master/src/tools/run-make-support
### Coverage tests
diff --git a/src/tests/directives.md b/src/tests/directives.md
index fbbeb7e..4ff6b7c 100644
--- a/src/tests/directives.md
+++ b/src/tests/directives.md
@@ -52,14 +52,14 @@
See [Building auxiliary crates](compiletest.html#building-auxiliary-crates)
-| Directive | Explanation | Supported test suites | Possible values |
-|-----------------------|-------------------------------------------------------------------------------------------------------|-----------------------|-----------------------------------------------|
-| `aux-bin` | Build a aux binary, made available in `auxiliary/bin` relative to test directory | All except `run-make` | Path to auxiliary `.rs` file |
-| `aux-build` | Build a separate crate from the named source file | All except `run-make` | Path to auxiliary `.rs` file |
-| `aux-crate` | Like `aux-build` but makes available as extern prelude | All except `run-make` | `<extern_prelude_name>=<path/to/aux/file.rs>` |
-| `aux-codegen-backend` | Similar to `aux-build` but pass the compiled dylib to `-Zcodegen-backend` when building the main file | `ui-fulldeps` | Path to codegen backend file |
-| `proc-macro` | Similar to `aux-build`, but for aux forces host and don't use `-Cprefer-dynamic`[^pm]. | All except `run-make` | Path to auxiliary proc-macro `.rs` file |
-| `build-aux-docs` | Build docs for auxiliaries as well. Note that this only works with `aux-build`, not `aux-crate`. | All except `run-make` | N/A |
+| Directive | Explanation | Supported test suites | Possible values |
+|-----------------------|-------------------------------------------------------------------------------------------------------|----------------------------------------|-----------------------------------------------|
+| `aux-bin` | Build a aux binary, made available in `auxiliary/bin` relative to test directory | All except `run-make`/`run-make-cargo` | Path to auxiliary `.rs` file |
+| `aux-build` | Build a separate crate from the named source file | All except `run-make`/`run-make-cargo` | Path to auxiliary `.rs` file |
+| `aux-crate` | Like `aux-build` but makes available as extern prelude | All except `run-make`/`run-make-cargo` | `<extern_prelude_name>=<path/to/aux/file.rs>` |
+| `aux-codegen-backend` | Similar to `aux-build` but pass the compiled dylib to `-Zcodegen-backend` when building the main file | `ui-fulldeps` | Path to codegen backend file |
+| `proc-macro` | Similar to `aux-build`, but for aux forces host and don't use `-Cprefer-dynamic`[^pm]. | All except `run-make`/`run-make-cargo` | Path to auxiliary proc-macro `.rs` file |
+| `build-aux-docs` | Build docs for auxiliaries as well. Note that this only works with `aux-build`, not `aux-crate`. | All except `run-make`/`run-make-cargo` | N/A |
[^pm]: please see the [Auxiliary proc-macro section](compiletest.html#auxiliary-proc-macro) in the compiletest chapter for specifics.
@@ -243,18 +243,18 @@
### Affecting how tests are built
-| Directive | Explanation | Supported test suites | Possible values |
-|---------------------|----------------------------------------------------------------------------------------------|---------------------------|--------------------------------------------------------------------------------------------|
-| `compile-flags` | Flags passed to `rustc` when building the test or aux file | All except for `run-make` | Any valid `rustc` flags, e.g. `-Awarnings -Dfoo`. Cannot be `-Cincremental` or `--edition` |
-| `edition` | The edition used to build the test | All except for `run-make` | Any valid `--edition` value |
-| `rustc-env` | Env var to set when running `rustc` | All except for `run-make` | `<KEY>=<VALUE>` |
-| `unset-rustc-env` | Env var to unset when running `rustc` | All except for `run-make` | Any env var name |
-| `incremental` | Proper incremental support for tests outside of incremental test suite | `ui`, `crashes` | N/A |
-| `no-prefer-dynamic` | Don't use `-C prefer-dynamic`, don't build as a dylib via a `--crate-type=dylib` preset flag | `ui`, `crashes` | N/A |
+| Directive | Explanation | Supported test suites | Possible values |
+|---------------------|----------------------------------------------------------------------------------------------|--------------------------------------------|--------------------------------------------------------------------------------------------|
+| `compile-flags` | Flags passed to `rustc` when building the test or aux file | All except for `run-make`/`run-make-cargo` | Any valid `rustc` flags, e.g. `-Awarnings -Dfoo`. Cannot be `-Cincremental` or `--edition` |
+| `edition` | The edition used to build the test | All except for `run-make`/`run-make-cargo` | Any valid `--edition` value |
+| `rustc-env` | Env var to set when running `rustc` | All except for `run-make`/`run-make-cargo` | `<KEY>=<VALUE>` |
+| `unset-rustc-env` | Env var to unset when running `rustc` | All except for `run-make`/`run-make-cargo` | Any env var name |
+| `incremental` | Proper incremental support for tests outside of incremental test suite | `ui`, `crashes` | N/A |
+| `no-prefer-dynamic` | Don't use `-C prefer-dynamic`, don't build as a dylib via a `--crate-type=dylib` preset flag | `ui`, `crashes` | N/A |
<div class="warning">
-Tests (outside of `run-make`) that want to use incremental tests not in the
+Tests (outside of `run-make`/`run-make-cargo`) that want to use incremental tests not in the
incremental test-suite must not pass `-C incremental` via `compile-flags`, and
must instead use the `//@ incremental` directive.
@@ -264,9 +264,9 @@
### Rustdoc
-| Directive | Explanation | Supported test suites | Possible values |
-|-------------|--------------------------------------------------------------|------------------------------------------|---------------------------|
-| `doc-flags` | Flags passed to `rustdoc` when building the test or aux file | `rustdoc`, `rustdoc-js`, `rustdoc-json` | Any valid `rustdoc` flags |
+| Directive | Explanation | Supported test suites | Possible values |
+|-------------|--------------------------------------------------------------|-----------------------------------------|---------------------------|
+| `doc-flags` | Flags passed to `rustdoc` when building the test or aux file | `rustdoc`, `rustdoc-js`, `rustdoc-json` | Any valid `rustdoc` flags |
<!--
**FIXME(rustdoc)**: what does `check-test-line-numbers-match` do?
diff --git a/src/tests/misc.md b/src/tests/misc.md
index 39f8817..cc8f501 100644
--- a/src/tests/misc.md
+++ b/src/tests/misc.md
@@ -24,8 +24,8 @@
//@ rustc-env:RUSTC_BOOTSTRAP=-1
```
-For `run-make` tests, `//@ rustc-env` is not supported. You can do something
-like the following for individual `rustc` invocations.
+For `run-make`/`run-make-cargo` tests, `//@ rustc-env` is not supported. You can do
+something like the following for individual `rustc` invocations.
```rust,ignore
use run_make_support::rustc;