]> git.lizzy.rs Git - rust.git/blob - tests/ui/target-feature/tied-features.rs
Rollup merge of #106797 - FawazTirmizi:dev/issues/104284, r=bjorn3
[rust.git] / tests / ui / target-feature / tied-features.rs
1 // build-fail
2 // compile-flags: --crate-type=rlib --target=aarch64-unknown-linux-gnu
3 // needs-llvm-components: aarch64
4 #![feature(no_core, lang_items)]
5 #![no_core]
6
7 #[lang="sized"]
8 trait Sized {}
9
10 // FIXME: this should not need to be public.
11 pub fn main() {
12     #[target_feature(enable = "pacg")]
13     //~^ ERROR must all be either enabled or disabled together
14     unsafe fn inner() {}
15
16     unsafe {
17         foo();
18         bar();
19         baz();
20         inner();
21     }
22 }
23
24 #[target_feature(enable = "paca")]
25 //~^ ERROR must all be either enabled or disabled together
26 unsafe fn foo() {}
27
28
29 #[target_feature(enable = "paca,pacg")]
30 unsafe fn bar() {}
31
32 #[target_feature(enable = "paca")]
33 #[target_feature(enable = "pacg")]
34 unsafe fn baz() {}