2024-05-15 10:01:55 +02:00
|
|
|
// This tests that -Zfixed-x18 causes a compilation failure on targets other than aarch64.
|
2025-07-21 14:34:12 +02:00
|
|
|
// Behavior on aarch64 is tested by tests/codegen-llvm/fixed-x18.rs.
|
2024-05-15 10:01:55 +02:00
|
|
|
//
|
2024-05-15 13:09:02 +02:00
|
|
|
//@ revisions: x64 i686 arm riscv32 riscv64
|
2024-05-29 16:58:46 +02:00
|
|
|
//@ dont-check-compiler-stderr
|
2024-05-15 10:01:55 +02:00
|
|
|
//
|
|
|
|
|
//@ compile-flags: -Zfixed-x18
|
|
|
|
|
//@ [x64] needs-llvm-components: x86
|
|
|
|
|
//@ [x64] compile-flags: --target=x86_64-unknown-linux-gnu --crate-type=rlib
|
|
|
|
|
//@ [i686] needs-llvm-components: x86
|
|
|
|
|
//@ [i686] compile-flags: --target=i686-unknown-linux-gnu --crate-type=rlib
|
|
|
|
|
//@ [arm] needs-llvm-components: arm
|
|
|
|
|
//@ [arm] compile-flags: --target=armv7-unknown-linux-gnueabihf --crate-type=rlib
|
|
|
|
|
//@ [riscv32] needs-llvm-components: riscv
|
|
|
|
|
//@ [riscv32] compile-flags: --target=riscv32i-unknown-none-elf --crate-type=rlib
|
|
|
|
|
//@ [riscv64] needs-llvm-components: riscv
|
|
|
|
|
//@ [riscv64] compile-flags: --target=riscv64gc-unknown-none-elf --crate-type=rlib
|
|
|
|
|
|
|
|
|
|
#![crate_type = "lib"]
|
|
|
|
|
#![feature(no_core, lang_items)]
|
|
|
|
|
#![no_core]
|
|
|
|
|
|
2025-01-23 11:25:12 +00:00
|
|
|
#[lang = "pointee_sized"]
|
|
|
|
|
trait PointeeSized {}
|
|
|
|
|
#[lang = "meta_sized"]
|
|
|
|
|
trait MetaSized: PointeeSized {}
|
2024-05-15 10:01:55 +02:00
|
|
|
#[lang = "sized"]
|
2025-01-23 11:25:12 +00:00
|
|
|
trait Sized: MetaSized {}
|
2025-03-29 02:41:32 +03:00
|
|
|
|
|
|
|
|
//~? ERROR the `-Zfixed-x18` flag is not supported on the `
|