diff options
| author | Simonas Kazlauskas <git@kazlauskas.me> | 2021-07-23 14:42:36 +0300 |
|---|---|---|
| committer | Simonas Kazlauskas <git@kazlauskas.me> | 2022-02-27 21:21:38 +0200 |
| commit | dfcfaa4ec1dd8a5bda33874dc180509b74bb625f (patch) | |
| tree | 4ed06fdf5a430f9eda3c0ce522ab12349b86f01c /src/test | |
| parent | 3b1fe7e7c95e14dd8a420edf2f8a160c70211e04 (diff) | |
| download | rust-dfcfaa4ec1dd8a5bda33874dc180509b74bb625f.tar.gz rust-dfcfaa4ec1dd8a5bda33874dc180509b74bb625f.zip | |
Do not pass through features without +/- prefix
LLVM really dislikes this and will assert, saying something along the lines of: ``` rustc: llvm/lib/MC/MCSubtargetInfo.cpp:60: void ApplyFeatureFlag( llvm::FeatureBitset&, llvm::StringRef, llvm::ArrayRef<llvm::SubtargetFeatureKV> ): Assertion `SubtargetFeatures::hasFlag(Feature) && "Feature flags should start with '+' or '-'"` failed. ```
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/ui/target-feature/missing-plusminus-2.rs | 6 | ||||
| -rw-r--r-- | src/test/ui/target-feature/missing-plusminus-2.stderr | 6 |
2 files changed, 12 insertions, 0 deletions
diff --git a/src/test/ui/target-feature/missing-plusminus-2.rs b/src/test/ui/target-feature/missing-plusminus-2.rs new file mode 100644 index 00000000000..13168728902 --- /dev/null +++ b/src/test/ui/target-feature/missing-plusminus-2.rs @@ -0,0 +1,6 @@ +// compile-flags: -Ctarget-feature=rdrand --crate-type=rlib --target=x86_64-unknown-linux-gnu +// build-pass +// needs-llvm-components: x86 + +#![feature(no_core)] +#![no_core] diff --git a/src/test/ui/target-feature/missing-plusminus-2.stderr b/src/test/ui/target-feature/missing-plusminus-2.stderr new file mode 100644 index 00000000000..5ed2652a06d --- /dev/null +++ b/src/test/ui/target-feature/missing-plusminus-2.stderr @@ -0,0 +1,6 @@ +warning: unknown feature specified for `-Ctarget-feature`: `rdrand` + | + = note: features must begin with a `+` to enable or `-` to disable it + +warning: 1 warning emitted + |
