diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2024-10-10 22:00:49 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-10-10 22:00:49 +0200 |
| commit | 75ccd9f63b231212963f62f3d35c83c9cdc26f3e (patch) | |
| tree | ae70b300b11c90b703b1d3f242ef1ac56b436b50 /compiler/rustc_codegen_llvm/src | |
| parent | 28bc5a2f7fec125faa7a366f4dfbf2d349fbb8fe (diff) | |
| parent | b12dc2091012d1e8074ccea0ffe6ac16de1ba802 (diff) | |
| download | rust-75ccd9f63b231212963f62f3d35c83c9cdc26f3e.tar.gz rust-75ccd9f63b231212963f62f3d35c83c9cdc26f3e.zip | |
Rollup merge of #131470 - EnzymeAD:enzyme-testinfra2, r=jieyouxu
add test infra to explicitely test rustc with autodiff/enzyme disabled
I assume this is not what you want for now, but I'll update the PR once I understand how the ignore- directives work.
To summarize the situation, we want a feature gate test where we don't enable the autodiff feature using `#![feature(autodiff)]`. There are two situations.
1) We have a rustc which was build without autodiff support (current default): It gives one error about the feature being needed and one error about this rustc version being build without autodiff support.
2) We have a rustc which was build with autodiff support (i.e. for now a custom build): It gives one error about the feature being needed.
We have a `//`````@needs-enzyme`````` directive which we can use in revisions for the second case.
However, we have no way to specify that needs-enzyme implies that the second error should not be seen.
This ads a way of passing the following test:
```
//@ revisions: has_support no_support
//`````@[has_support]````` needs-enzyme
//`````@[no_support]````` needs-enzyme-disabled
#![crate_type = "lib"]
#[autodiff(dfoo, Reverse)]
//[has_support]~^ ERROR use of unstable library feature 'autodiff' [E0658]
//[no_support]~^^ ERROR use of unstable library feature 'autodiff' [E0658]
//[no_support]~| ERROR this rustc version does not support autodiff
fn foo() {}
```
Cherry picking this PR to my frontend pr makes the test above pass in both configurations (enzyme=true/false in config.toml).
I'm open to other changes that make this testcase pass.
r? `````@jieyouxu`````
Tracking:
- https://github.com/rust-lang/rust/issues/124509
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
0 files changed, 0 insertions, 0 deletions
