about summary refs log tree commit diff
path: root/tests/ui/target-feature/abi-required-target-feature-flag-disable.rs
blob: 89736afe7185852ae30e18afe447b3bc3f90ae6a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
//! Ensure ABI-required features cannot be disabled via `-Ctarget-feature`.
//! Also covers the case of a feature indirectly disabling another via feature implications.
//@ compile-flags: --crate-type=lib
//@ revisions: x86 x86-implied aarch64 riscv loongarch
//@[x86] compile-flags: --target=x86_64-unknown-linux-gnu -Ctarget-feature=-x87
//@[x86] needs-llvm-components: x86
//@[x86-implied] compile-flags: --target=x86_64-unknown-linux-gnu -Ctarget-feature=-sse
//@[x86-implied] needs-llvm-components: x86
//@[aarch64] compile-flags: --target=aarch64-unknown-linux-gnu -Ctarget-feature=-neon
//@[aarch64] needs-llvm-components: aarch64
//@[riscv] compile-flags: --target=riscv64gc-unknown-none-elf -Ctarget-feature=-d
//@[riscv] needs-llvm-components: riscv
//@[loongarch] compile-flags: --target=loongarch64-unknown-none -Ctarget-feature=-d
//@[loongarch] needs-llvm-components: loongarch
// For now this is just a warning.
//@ build-pass
// Remove some LLVM warnings that only show up sometimes.
//@ normalize-stderr: "\n[^\n]*(target-abi|lp64f)[^\n]*" -> ""

#![feature(no_core, lang_items)]
#![no_core]

#[lang = "pointee_sized"]
pub trait PointeeSized {}

#[lang = "meta_sized"]
pub trait MetaSized: PointeeSized {}

#[lang = "sized"]
pub trait Sized {}

//~? WARN must be enabled to ensure that the ABI of the current target can be implemented correctly
//[x86,riscv]~? WARN unstable feature specified for `-Ctarget-feature`