diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:19:13 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:19:13 +0000 |
commit | 218caa410aa38c29984be31a5229b9fa717560ee (patch) | |
tree | c54bd55eeb6e4c508940a30e94c0032fbd45d677 /src/test/ui/target-feature/feature-hierarchy.rs | |
parent | Releasing progress-linux version 1.67.1+dfsg1-1~progress7.99u1. (diff) | |
download | rustc-218caa410aa38c29984be31a5229b9fa717560ee.tar.xz rustc-218caa410aa38c29984be31a5229b9fa717560ee.zip |
Merging upstream version 1.68.2+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/test/ui/target-feature/feature-hierarchy.rs')
-rw-r--r-- | src/test/ui/target-feature/feature-hierarchy.rs | 58 |
1 files changed, 0 insertions, 58 deletions
diff --git a/src/test/ui/target-feature/feature-hierarchy.rs b/src/test/ui/target-feature/feature-hierarchy.rs deleted file mode 100644 index 5fbd5e8a2..000000000 --- a/src/test/ui/target-feature/feature-hierarchy.rs +++ /dev/null @@ -1,58 +0,0 @@ -// revisions: aarch64-neon aarch64-sve2 -// [aarch64-neon] compile-flags: -Ctarget-feature=+neon --target=aarch64-unknown-linux-gnu -// [aarch64-neon] needs-llvm-components: aarch64 -// [aarch64-sve2] compile-flags: -Ctarget-feature=-neon,+sve2 --target=aarch64-unknown-linux-gnu -// [aarch64-sve2] needs-llvm-components: aarch64 -// build-pass -#![no_core] -#![crate_type = "rlib"] -#![feature(intrinsics, rustc_attrs, no_core, lang_items, staged_api)] -#![stable(feature = "test", since = "1.0.0")] - -// Tests vetting "feature hierarchies" in the cases where we impose them. - -// Supporting minimal rust core code -#[lang = "sized"] -trait Sized {} -#[lang = "copy"] -trait Copy {} -impl Copy for bool {} - -extern "rust-intrinsic" { - #[rustc_const_stable(feature = "test", since = "1.0.0")] - fn unreachable() -> !; -} - -#[rustc_builtin_macro] -macro_rules! cfg { - ($($cfg:tt)*) => {}; -} - -// Test code -const fn do_or_die(cond: bool) { - if cond { - } else { - unsafe { unreachable() } - } -} - -macro_rules! assert { - ($x:expr $(,)?) => { - const _: () = do_or_die($x); - }; -} - - -#[cfg(aarch64_neon)] -fn check_neon_not_sve2() { - // This checks that a normal aarch64 target doesn't suddenly jump up the feature hierarchy. - assert!(cfg!(target_feature = "neon")); - assert!(cfg!(not(target_feature = "sve2"))); -} - -#[cfg(aarch64_sve2)] -fn check_sve2_includes_neon() { - // This checks that aarch64's sve2 includes neon - assert!(cfg!(target_feature = "neon")); - assert!(cfg!(target_feature = "sve2")); -} |