Rollup merge of #137599 - davidtwco:use-minicore-more, r=jieyouxu
tests: use minicore more minicore makes it much easier to add new language items to all of the existing `no_core` tests. Most of the remaining tests that *could* use minicore either fail because.. 1. LLVM IR output changes and doesn't pass the test as written. I didn't look into these further. 2. The test has revisions w/ different compilation flags, expecting some to fail, and when using minicore, minicore is compiled with those flags and fails in the expected way because of the flags rather than the test, and that's considered a failure. But these tests can be changed and make adding new language items a lot easier. r? ```@jieyouxu```
This commit is contained in:
commit
50ed7f974b
183 changed files with 828 additions and 1063 deletions
|
|
@ -1,5 +1,6 @@
|
|||
// Test that PAC instructions are emitted when branch-protection is specified.
|
||||
|
||||
//@ add-core-stubs
|
||||
//@ revisions: PACRET PAUTHLR_NOP PAUTHLR
|
||||
//@ assembly-output: emit-asm
|
||||
//@ needs-llvm-components: aarch64
|
||||
|
|
@ -14,8 +15,8 @@
|
|||
#![no_core]
|
||||
#![crate_type = "lib"]
|
||||
|
||||
#[lang = "sized"]
|
||||
trait Sized {}
|
||||
extern crate minicore;
|
||||
use minicore::*;
|
||||
|
||||
// PACRET: hint #25
|
||||
// PACRET: hint #29
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
//@ add-core-stubs
|
||||
//@ revisions: hard soft
|
||||
//@ assembly-output: emit-asm
|
||||
//@ [hard] compile-flags: --target thumbv8m.main-none-eabihf --crate-type lib -Copt-level=1
|
||||
|
|
@ -7,10 +8,9 @@
|
|||
#![crate_type = "lib"]
|
||||
#![feature(abi_c_cmse_nonsecure_call, cmse_nonsecure_entry, no_core, lang_items)]
|
||||
#![no_core]
|
||||
#[lang = "sized"]
|
||||
pub trait Sized {}
|
||||
#[lang = "copy"]
|
||||
pub trait Copy {}
|
||||
|
||||
extern crate minicore;
|
||||
use minicore::*;
|
||||
|
||||
// CHECK-LABEL: __acle_se_entry_point:
|
||||
// CHECK-NEXT: entry_point:
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
// Makes sure that `-Z dwarf-version=4` causes `rustc` to emit DWARF version 4.
|
||||
//@ assembly-output: emit-asm
|
||||
//@ add-core-stubs
|
||||
//@ compile-flags: -g --target x86_64-unknown-linux-gnu -Z dwarf-version=4 -Copt-level=0
|
||||
//@ needs-llvm-components: x86
|
||||
|
||||
|
|
@ -7,10 +8,8 @@
|
|||
#![crate_type = "rlib"]
|
||||
#![no_core]
|
||||
|
||||
#[lang = "sized"]
|
||||
trait Sized {}
|
||||
#[lang = "copy"]
|
||||
trait Copy {}
|
||||
extern crate minicore;
|
||||
use minicore::*;
|
||||
|
||||
pub fn wibble() {}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
// Makes sure that `-Z dwarf-version=5` causes `rustc` to emit DWARF version 5.
|
||||
//@ add-core-stubs
|
||||
//@ assembly-output: emit-asm
|
||||
//@ compile-flags: -g --target x86_64-unknown-linux-gnu -Z dwarf-version=5 -Copt-level=0
|
||||
//@ needs-llvm-components: x86
|
||||
|
|
@ -7,10 +8,8 @@
|
|||
#![crate_type = "rlib"]
|
||||
#![no_core]
|
||||
|
||||
#[lang = "sized"]
|
||||
trait Sized {}
|
||||
#[lang = "copy"]
|
||||
trait Copy {}
|
||||
extern crate minicore;
|
||||
use minicore::*;
|
||||
|
||||
pub fn wibble() {}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
//@ add-core-stubs
|
||||
//@ revisions: x64
|
||||
//@ assembly-output: emit-asm
|
||||
//@ [x64] compile-flags: --target x86_64-unknown-linux-gnu -Crelocation-model=pic
|
||||
|
|
@ -7,10 +8,8 @@
|
|||
#![no_core]
|
||||
#![crate_type = "rlib"]
|
||||
|
||||
#[lang = "sized"]
|
||||
trait Sized {}
|
||||
#[lang = "copy"]
|
||||
trait Copy {}
|
||||
extern crate minicore;
|
||||
use minicore::*;
|
||||
|
||||
// CHECK-LABEL: call_other_fn:
|
||||
// CHECK: {{(jmpq|callq)}} *other_fn@GOTPCREL(%rip)
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
//@ add-core-stubs
|
||||
//@ revisions: x64
|
||||
//@ assembly-output: emit-asm
|
||||
//@ [x64] compile-flags: --target x86_64-unknown-linux-gnu -Crelocation-model=pie
|
||||
|
|
@ -7,10 +8,8 @@
|
|||
#![no_core]
|
||||
#![crate_type = "rlib"]
|
||||
|
||||
#[lang = "sized"]
|
||||
trait Sized {}
|
||||
#[lang = "copy"]
|
||||
trait Copy {}
|
||||
extern crate minicore;
|
||||
use minicore::*;
|
||||
|
||||
// CHECK-LABEL: call_other_fn:
|
||||
// With PIE local functions are called "directly".
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
//@ add-core-stubs
|
||||
//@ revisions: elfv1-be elfv2-be elfv2-le aix
|
||||
//@ assembly-output: emit-asm
|
||||
//@ compile-flags: -Copt-level=3
|
||||
|
|
@ -20,21 +21,9 @@
|
|||
#![no_core]
|
||||
#![crate_type = "lib"]
|
||||
|
||||
#[lang = "sized"]
|
||||
trait Sized {}
|
||||
extern crate minicore;
|
||||
use minicore::*;
|
||||
|
||||
#[lang = "copy"]
|
||||
trait Copy {}
|
||||
|
||||
#[lang = "freeze"]
|
||||
trait Freeze {}
|
||||
|
||||
#[lang = "unpin"]
|
||||
trait Unpin {}
|
||||
|
||||
impl Copy for u8 {}
|
||||
impl Copy for u16 {}
|
||||
impl Copy for u32 {}
|
||||
impl Copy for FiveU32s {}
|
||||
impl Copy for FiveU16s {}
|
||||
impl Copy for ThreeU8s {}
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
//@ add-core-stubs
|
||||
//@ assembly-output: emit-asm
|
||||
//@ compile-flags: --target riscv64imac-unknown-none-elf -Ctarget-feature=+f,+d
|
||||
//@ needs-llvm-components: riscv
|
||||
|
|
@ -9,15 +10,8 @@
|
|||
#![crate_type = "lib"]
|
||||
#![no_core]
|
||||
|
||||
#[lang = "sized"]
|
||||
trait Sized {}
|
||||
|
||||
#[lang = "copy"]
|
||||
trait Copy {}
|
||||
|
||||
impl Copy for f16 {}
|
||||
impl Copy for f32 {}
|
||||
impl Copy for f64 {}
|
||||
extern crate minicore;
|
||||
use minicore::*;
|
||||
|
||||
// This test checks that the floats are all returned in `a0` as required by the `lp64` ABI.
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
//@ add-core-stubs
|
||||
//@ revisions: enable-backchain disable-backchain
|
||||
//@ assembly-output: emit-asm
|
||||
//@ compile-flags: -Copt-level=3 --crate-type=lib --target=s390x-unknown-linux-gnu
|
||||
|
|
@ -8,8 +9,8 @@
|
|||
#![no_std]
|
||||
#![no_core]
|
||||
|
||||
#[lang = "sized"]
|
||||
trait Sized {}
|
||||
extern crate minicore;
|
||||
use minicore::*;
|
||||
|
||||
extern "C" {
|
||||
fn extern_func();
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
//@ add-core-stubs
|
||||
//@ revisions: x86 x86-avx2 x86-avx512 aarch64
|
||||
//@ [x86] compile-flags: --target=x86_64-unknown-linux-gnu -C llvm-args=-x86-asm-syntax=intel
|
||||
//@ [x86] needs-llvm-components: x86
|
||||
|
|
@ -16,12 +17,8 @@
|
|||
#![no_core]
|
||||
#![allow(non_camel_case_types)]
|
||||
|
||||
// Because we don't have core yet.
|
||||
#[lang = "sized"]
|
||||
pub trait Sized {}
|
||||
|
||||
#[lang = "copy"]
|
||||
trait Copy {}
|
||||
extern crate minicore;
|
||||
use minicore::*;
|
||||
|
||||
#[repr(simd)]
|
||||
pub struct m8x16([i8; 16]);
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
//@ add-core-stubs
|
||||
//@ revisions: x86-avx512
|
||||
//@ [x86-avx512] compile-flags: --target=x86_64-unknown-linux-gnu -C llvm-args=-x86-asm-syntax=intel
|
||||
//@ [x86-avx512] compile-flags: -C target-feature=+avx512f,+avx512vl,+avx512bw,+avx512dq
|
||||
|
|
@ -9,12 +10,8 @@
|
|||
#![no_core]
|
||||
#![allow(non_camel_case_types)]
|
||||
|
||||
// Because we don't have core yet.
|
||||
#[lang = "sized"]
|
||||
pub trait Sized {}
|
||||
|
||||
#[lang = "copy"]
|
||||
trait Copy {}
|
||||
extern crate minicore;
|
||||
use minicore::*;
|
||||
|
||||
#[repr(simd)]
|
||||
pub struct f64x4([f64; 4]);
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
//@ add-core-stubs
|
||||
//@ revisions: x86-avx2 x86-avx512
|
||||
//@ [x86-avx2] compile-flags: --target=x86_64-unknown-linux-gnu -C llvm-args=-x86-asm-syntax=intel
|
||||
//@ [x86-avx2] compile-flags: -C target-feature=+avx2
|
||||
|
|
@ -12,13 +13,8 @@
|
|||
#![no_core]
|
||||
#![allow(non_camel_case_types)]
|
||||
|
||||
// Because we don't have core yet.
|
||||
#[lang = "sized"]
|
||||
pub trait Sized {}
|
||||
|
||||
#[lang = "copy"]
|
||||
trait Copy {}
|
||||
impl<T: ?Sized> Copy for *const T {}
|
||||
extern crate minicore;
|
||||
use minicore::*;
|
||||
|
||||
#[repr(simd)]
|
||||
pub struct i8x16([i8; 16]);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
// verify that simd mask reductions do not introduce additional bit shift operations
|
||||
//@ add-core-stubs
|
||||
//@ revisions: x86 aarch64
|
||||
//@ [x86] compile-flags: --target=x86_64-unknown-linux-gnu -C llvm-args=-x86-asm-syntax=intel
|
||||
// Set the base cpu explicitly, in case the default has been changed.
|
||||
|
|
@ -13,12 +14,8 @@
|
|||
#![no_core]
|
||||
#![allow(non_camel_case_types)]
|
||||
|
||||
// Because we don't have core yet.
|
||||
#[lang = "sized"]
|
||||
pub trait Sized {}
|
||||
|
||||
#[lang = "copy"]
|
||||
trait Copy {}
|
||||
extern crate minicore;
|
||||
use minicore::*;
|
||||
|
||||
#[repr(simd)]
|
||||
pub struct mask8x16([i8; 16]);
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
//@ add-core-stubs
|
||||
//@ revisions: x86-avx2 x86-avx512
|
||||
//@ [x86-avx2] compile-flags: --target=x86_64-unknown-linux-gnu -C llvm-args=-x86-asm-syntax=intel
|
||||
//@ [x86-avx2] compile-flags: -C target-feature=+avx2
|
||||
|
|
@ -12,13 +13,8 @@
|
|||
#![no_core]
|
||||
#![allow(non_camel_case_types)]
|
||||
|
||||
// Because we don't have core yet.
|
||||
#[lang = "sized"]
|
||||
pub trait Sized {}
|
||||
|
||||
#[lang = "copy"]
|
||||
trait Copy {}
|
||||
impl<T: ?Sized> Copy for *mut T {}
|
||||
extern crate minicore;
|
||||
use minicore::*;
|
||||
|
||||
#[repr(simd)]
|
||||
pub struct i8x16([i8; 16]);
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
//@ add-core-stubs
|
||||
//@ revisions: x86-avx512
|
||||
//@ [x86-avx512] compile-flags: --target=x86_64-unknown-linux-gnu -C llvm-args=-x86-asm-syntax=intel
|
||||
//@ [x86-avx512] compile-flags: -C target-feature=+avx512f,+avx512vl,+avx512bw,+avx512dq
|
||||
|
|
@ -9,12 +10,8 @@
|
|||
#![no_core]
|
||||
#![allow(non_camel_case_types)]
|
||||
|
||||
// Because we don't have core yet.
|
||||
#[lang = "sized"]
|
||||
pub trait Sized {}
|
||||
|
||||
#[lang = "copy"]
|
||||
trait Copy {}
|
||||
extern crate minicore;
|
||||
use minicore::*;
|
||||
|
||||
#[repr(simd)]
|
||||
pub struct f64x4([f64; 4]);
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
//@ add-core-stubs
|
||||
//@ revisions: x86-avx2 x86-avx512 aarch64
|
||||
//@ [x86-avx2] compile-flags: --target=x86_64-unknown-linux-gnu -C llvm-args=-x86-asm-syntax=intel
|
||||
//@ [x86-avx2] compile-flags: -C target-feature=+avx2
|
||||
|
|
@ -14,12 +15,8 @@
|
|||
#![no_core]
|
||||
#![allow(non_camel_case_types)]
|
||||
|
||||
// Because we don't have core yet.
|
||||
#[lang = "sized"]
|
||||
pub trait Sized {}
|
||||
|
||||
#[lang = "copy"]
|
||||
trait Copy {}
|
||||
extern crate minicore;
|
||||
use minicore::*;
|
||||
|
||||
#[repr(simd)]
|
||||
pub struct i8x16([i8; 16]);
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
// - float structure members are passes in floating point registers
|
||||
// (#86163)
|
||||
|
||||
//@ add-core-stubs
|
||||
//@ assembly-output: emit-asm
|
||||
//@ needs-llvm-components: sparc
|
||||
//@ compile-flags: --target=sparcv9-sun-solaris -Copt-level=3
|
||||
|
|
@ -9,11 +10,8 @@
|
|||
#![feature(no_core, lang_items)]
|
||||
#![no_core]
|
||||
|
||||
#[lang = "sized"]
|
||||
pub trait Sized {}
|
||||
#[lang = "copy"]
|
||||
pub trait Copy {}
|
||||
impl Copy for f32 {}
|
||||
extern crate minicore;
|
||||
use minicore::*;
|
||||
|
||||
#[repr(C)]
|
||||
pub struct Franta {
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
//@ add-core-stubs
|
||||
//@ revisions: x86_64 i686 aarch64
|
||||
//@ assembly-output: emit-asm
|
||||
//@[x86_64] compile-flags: --target x86_64-unknown-linux-gnu -C llvm-args=-x86-asm-syntax=intel
|
||||
|
|
@ -11,12 +12,8 @@
|
|||
#![crate_type = "lib"]
|
||||
#![no_core]
|
||||
|
||||
#[lang = "sized"]
|
||||
trait Sized {}
|
||||
#[lang = "copy"]
|
||||
trait Copy {}
|
||||
|
||||
impl Copy for u8 {}
|
||||
extern crate minicore;
|
||||
use minicore::*;
|
||||
|
||||
// Check that inline-asm stack probes are generated correctly.
|
||||
// To avoid making this test fragile to slight asm changes,
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
// Test that stack smash protection code is emitted for all tier1 and tier2
|
||||
// targets, with the exception of nvptx64-nvidia-cuda
|
||||
//
|
||||
//@ add-core-stubs
|
||||
//@ revisions: r1 r2 r3 r4 r5 r6 r7 r8 r9 r10 r11 r12 r13 r14 r15 r16 r17 r18 r19 r20 r21 r22 r23
|
||||
//@ revisions: r24 r25 r26 r27 r28 r29 r30 r31 r32 r33 r35 r36 r37 r38 r39 r40 r41 r42 r43 r44
|
||||
//@ revisions: r45 r46 r47 r48 r49 r50 r51 r52 r53 r54 r55 r56 r57 r58 r59 r60 r61 r62 r63 r64 r65
|
||||
|
|
@ -183,10 +184,8 @@
|
|||
#![crate_type = "lib"]
|
||||
#![no_core]
|
||||
|
||||
#[lang = "sized"]
|
||||
trait Sized {}
|
||||
#[lang = "copy"]
|
||||
trait Copy {}
|
||||
extern crate minicore;
|
||||
use minicore::*;
|
||||
|
||||
#[no_mangle]
|
||||
pub fn foo() {
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
//@ add-core-stubs
|
||||
//@ revisions: x64 A64 ppc64le
|
||||
//@ assembly-output: emit-asm
|
||||
//@ [x64] compile-flags: --target x86_64-unknown-linux-gnu -Crelocation-model=static
|
||||
|
|
@ -11,20 +12,8 @@
|
|||
#![no_core]
|
||||
#![crate_type = "rlib"]
|
||||
|
||||
#[lang = "sized"]
|
||||
trait Sized {}
|
||||
|
||||
#[lang = "copy"]
|
||||
trait Copy {}
|
||||
|
||||
#[lang = "sync"]
|
||||
trait Sync {}
|
||||
|
||||
#[lang = "drop_in_place"]
|
||||
fn drop_in_place<T>(_: *mut T) {}
|
||||
|
||||
impl Copy for u8 {}
|
||||
impl Sync for u8 {}
|
||||
extern crate minicore;
|
||||
use minicore::*;
|
||||
|
||||
#[no_mangle]
|
||||
pub static PIERIS: u8 = 42;
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
//@ add-core-stubs
|
||||
//@ assembly-output: emit-asm
|
||||
//@ needs-llvm-components: x86
|
||||
//@ revisions: TWOFLAGS SINGLEFLAG
|
||||
|
|
@ -19,11 +20,8 @@
|
|||
#![crate_type = "lib"]
|
||||
#![no_core]
|
||||
|
||||
#[lang = "sized"]
|
||||
trait Sized {}
|
||||
#[lang = "copy"]
|
||||
trait Copy {}
|
||||
impl Copy for u32 {}
|
||||
extern crate minicore;
|
||||
use minicore::*;
|
||||
|
||||
// Use of these requires target features to be enabled
|
||||
extern "unadjusted" {
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
//@ add-core-stubs
|
||||
//@ assembly-output: emit-asm
|
||||
// ignore-tidy-linelength
|
||||
//@ revisions: amdgcn_amd_amdhsa
|
||||
|
|
@ -11,8 +12,8 @@
|
|||
#![no_core]
|
||||
#![crate_type = "lib"]
|
||||
|
||||
#[lang = "sized"]
|
||||
trait Sized {}
|
||||
extern crate minicore;
|
||||
use minicore::*;
|
||||
|
||||
pub fn test() -> u8 {
|
||||
42
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
//@ add-core-stubs
|
||||
//@ assembly-output: emit-asm
|
||||
// ignore-tidy-linelength
|
||||
//@ revisions: aarch64_be_unknown_linux_gnu
|
||||
|
|
@ -709,8 +710,8 @@
|
|||
#![no_core]
|
||||
#![crate_type = "lib"]
|
||||
|
||||
#[lang = "sized"]
|
||||
trait Sized {}
|
||||
extern crate minicore;
|
||||
use minicore::*;
|
||||
|
||||
// Force linkage to ensure code is actually generated
|
||||
#[no_mangle]
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
//@ add-core-stubs
|
||||
//@ assembly-output: emit-asm
|
||||
// ignore-tidy-linelength
|
||||
//@ revisions: aarch64_apple_darwin
|
||||
|
|
@ -80,8 +81,8 @@
|
|||
#![no_core]
|
||||
#![crate_type = "lib"]
|
||||
|
||||
#[lang = "sized"]
|
||||
trait Sized {}
|
||||
extern crate minicore;
|
||||
use minicore::*;
|
||||
|
||||
// Force linkage to ensure code is actually generated
|
||||
#[no_mangle]
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
//@ add-core-stubs
|
||||
//@ assembly-output: emit-asm
|
||||
// ignore-tidy-linelength
|
||||
//@ revisions: nvptx64_nvidia_cuda
|
||||
|
|
@ -11,8 +12,8 @@
|
|||
#![no_core]
|
||||
#![crate_type = "lib"]
|
||||
|
||||
#[lang = "sized"]
|
||||
trait Sized {}
|
||||
extern crate minicore;
|
||||
use minicore::*;
|
||||
|
||||
pub fn test() -> u8 {
|
||||
42
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
//@ add-core-stubs
|
||||
//@ assembly-output: emit-asm
|
||||
// ignore-tidy-linelength
|
||||
//@ revisions: aarch64_pc_windows_msvc
|
||||
|
|
@ -95,8 +96,8 @@
|
|||
#![no_core]
|
||||
#![crate_type = "lib"]
|
||||
|
||||
#[lang = "sized"]
|
||||
trait Sized {}
|
||||
extern crate minicore;
|
||||
use minicore::*;
|
||||
|
||||
pub fn test() -> u8 {
|
||||
42
|
||||
|
|
|
|||
|
|
@ -25,7 +25,8 @@
|
|||
naked_functions,
|
||||
f16,
|
||||
f128,
|
||||
asm_experimental_arch
|
||||
asm_experimental_arch,
|
||||
unboxed_closures
|
||||
)]
|
||||
#![allow(unused, improper_ctypes_definitions, internal_features)]
|
||||
#![no_std]
|
||||
|
|
@ -61,7 +62,7 @@ pub auto trait Unpin {}
|
|||
|
||||
impl_marker_trait!(
|
||||
Copy => [
|
||||
bool, char,
|
||||
char, bool,
|
||||
isize, i8, i16, i32, i64, i128,
|
||||
usize, u8, u16, u32, u64, u128,
|
||||
f16, f32, f64, f128,
|
||||
|
|
@ -102,6 +103,9 @@ pub struct UnsafeCell<T: ?Sized> {
|
|||
}
|
||||
impl<T: ?Sized> !Freeze for UnsafeCell<T> {}
|
||||
|
||||
#[lang = "tuple_trait"]
|
||||
pub trait Tuple {}
|
||||
|
||||
#[rustc_builtin_macro]
|
||||
pub macro asm("assembly template", $(operands,)* $(options($(option),*))?) {
|
||||
/* compiler built-in */
|
||||
|
|
@ -129,3 +133,61 @@ macro_rules! stringify {
|
|||
/* compiler built-in */
|
||||
};
|
||||
}
|
||||
|
||||
#[lang = "add"]
|
||||
pub trait Add<Rhs = Self> {
|
||||
type Output;
|
||||
|
||||
fn add(self, _: Rhs) -> Self::Output;
|
||||
}
|
||||
|
||||
impl Add<isize> for isize {
|
||||
type Output = isize;
|
||||
|
||||
fn add(self, other: isize) -> isize {
|
||||
7 // avoid needing to add all of the overflow handling and panic language items
|
||||
}
|
||||
}
|
||||
|
||||
#[lang = "sync"]
|
||||
trait Sync {}
|
||||
impl Sync for u8 {}
|
||||
|
||||
#[lang = "drop_in_place"]
|
||||
fn drop_in_place<T>(_: *mut T) {}
|
||||
|
||||
#[lang = "fn_once"]
|
||||
pub trait FnOnce<Args: Tuple> {
|
||||
#[lang = "fn_once_output"]
|
||||
type Output;
|
||||
|
||||
extern "rust-call" fn call_once(self, args: Args) -> Self::Output;
|
||||
}
|
||||
|
||||
#[lang = "fn_mut"]
|
||||
pub trait FnMut<Args: Tuple>: FnOnce<Args> {
|
||||
extern "rust-call" fn call_mut(&mut self, args: Args) -> Self::Output;
|
||||
}
|
||||
|
||||
#[lang = "fn"]
|
||||
pub trait Fn<Args: Tuple>: FnMut<Args> {
|
||||
extern "rust-call" fn call(&self, args: Args) -> Self::Output;
|
||||
}
|
||||
|
||||
#[lang = "dispatch_from_dyn"]
|
||||
trait DispatchFromDyn<T> {}
|
||||
|
||||
impl<'a, T: ?Sized + Unsize<U>, U: ?Sized> DispatchFromDyn<&'a U> for &'a T {}
|
||||
|
||||
#[lang = "unsize"]
|
||||
trait Unsize<T: ?Sized> {}
|
||||
|
||||
#[lang = "coerce_unsized"]
|
||||
pub trait CoerceUnsized<T: ?Sized> {}
|
||||
|
||||
impl<'a, 'b: 'a, T: ?Sized + Unsize<U>, U: ?Sized> CoerceUnsized<&'a U> for &'b T {}
|
||||
|
||||
#[lang = "drop"]
|
||||
trait Drop {
|
||||
fn drop(&mut self);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,15 +1,12 @@
|
|||
//@ add-core-stubs
|
||||
//@ compile-flags: --target aarch64-unknown-none-softfloat -Zmerge-functions=disabled
|
||||
//@ needs-llvm-components: aarch64
|
||||
#![crate_type = "lib"]
|
||||
#![feature(no_core, lang_items)]
|
||||
#![no_core]
|
||||
|
||||
#[lang = "sized"]
|
||||
trait Sized {}
|
||||
#[lang = "copy"]
|
||||
trait Copy {}
|
||||
impl Copy for f32 {}
|
||||
impl Copy for f64 {}
|
||||
extern crate minicore;
|
||||
use minicore::*;
|
||||
|
||||
// CHECK: i64 @pass_f64_C(i64 {{[^,]*}})
|
||||
#[no_mangle]
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
// Test that structs aligned to 128 bits are passed with the correct ABI on aarch64.
|
||||
|
||||
//@ add-core-stubs
|
||||
//@ revisions: linux darwin win
|
||||
//@[linux] compile-flags: --target aarch64-unknown-linux-gnu
|
||||
//@[darwin] compile-flags: --target aarch64-apple-darwin
|
||||
|
|
@ -12,12 +13,8 @@
|
|||
#![crate_type = "lib"]
|
||||
#![no_core]
|
||||
|
||||
#[lang = "sized"]
|
||||
trait Sized {}
|
||||
#[lang = "freeze"]
|
||||
trait Freeze {}
|
||||
#[lang = "copy"]
|
||||
trait Copy {}
|
||||
extern crate minicore;
|
||||
use minicore::*;
|
||||
|
||||
// Passed as `[i64 x 2]`, since it's an aggregate with size <= 128 bits, align < 128 bits.
|
||||
#[repr(C)]
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
// Checks if the correct annotation for the efiapi ABI is passed to llvm.
|
||||
|
||||
//@ add-core-stubs
|
||||
//@ revisions:x86_64 i686 aarch64 arm riscv
|
||||
//@[x86_64] compile-flags: --target x86_64-unknown-uefi
|
||||
//@[x86_64] needs-llvm-components: aarch64 arm riscv
|
||||
|
|
@ -17,12 +18,8 @@
|
|||
#![feature(no_core, lang_items)]
|
||||
#![no_core]
|
||||
|
||||
#[lang = "sized"]
|
||||
trait Sized {}
|
||||
#[lang = "freeze"]
|
||||
trait Freeze {}
|
||||
#[lang = "copy"]
|
||||
trait Copy {}
|
||||
extern crate minicore;
|
||||
use minicore::*;
|
||||
|
||||
//x86_64: define win64cc void @has_efiapi
|
||||
//i686: define void @has_efiapi
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
//@ add-core-stubs
|
||||
//@ compile-flags: -Copt-level=3
|
||||
|
||||
//@ revisions:x86_64 i686 aarch64-apple aarch64-windows aarch64-linux arm riscv
|
||||
|
|
@ -24,12 +25,8 @@
|
|||
#![no_std]
|
||||
#![no_core]
|
||||
|
||||
#[lang = "sized"]
|
||||
trait Sized {}
|
||||
#[lang = "freeze"]
|
||||
trait Freeze {}
|
||||
#[lang = "copy"]
|
||||
trait Copy {}
|
||||
extern crate minicore;
|
||||
use minicore::*;
|
||||
|
||||
#[repr(i8)]
|
||||
pub enum Type {
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
// llvm. Also checks that the abi-sysv64 feature gate allows usage
|
||||
// of the sysv64 abi.
|
||||
//
|
||||
//@ add-core-stubs
|
||||
//@ needs-llvm-components: x86
|
||||
//@ compile-flags: -C no-prepopulate-passes --target=x86_64-unknown-linux-gnu -Copt-level=0
|
||||
|
||||
|
|
@ -9,11 +10,8 @@
|
|||
#![no_core]
|
||||
#![feature(abi_x86_interrupt, no_core, lang_items)]
|
||||
|
||||
#[lang = "sized"]
|
||||
trait Sized {}
|
||||
#[lang = "copy"]
|
||||
trait Copy {}
|
||||
impl Copy for i64 {}
|
||||
extern crate minicore;
|
||||
use minicore::*;
|
||||
|
||||
// CHECK: define x86_64_sysvcc i64 @has_sysv64_abi
|
||||
#[no_mangle]
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
//@ add-core-stubs
|
||||
//@ compile-flags: -Z merge-functions=disabled
|
||||
//@ add-core-stubs
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
// llvm. Also checks that the abi_x86_interrupt feature gate allows usage
|
||||
// of the x86-interrupt abi.
|
||||
|
||||
//@ add-core-stubs
|
||||
//@ needs-llvm-components: x86
|
||||
//@ compile-flags: -C no-prepopulate-passes --target=x86_64-unknown-linux-gnu -Copt-level=0
|
||||
|
||||
|
|
@ -9,11 +10,8 @@
|
|||
#![no_core]
|
||||
#![feature(abi_x86_interrupt, no_core, lang_items)]
|
||||
|
||||
#[lang = "sized"]
|
||||
trait Sized {}
|
||||
#[lang = "copy"]
|
||||
trait Copy {}
|
||||
impl Copy for i64 {}
|
||||
extern crate minicore;
|
||||
use minicore::*;
|
||||
|
||||
// CHECK: define x86_intrcc i64 @has_x86_interrupt_abi
|
||||
#[no_mangle]
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
//@ add-core-stubs
|
||||
//@ compile-flags: -Copt-level=3 --target=avr-none -C target-cpu=atmega328p --crate-type=rlib -C panic=abort
|
||||
//@ needs-llvm-components: avr
|
||||
|
||||
|
|
@ -13,45 +14,8 @@
|
|||
#![crate_type = "lib"]
|
||||
#![no_core]
|
||||
|
||||
#[lang = "sized"]
|
||||
pub trait Sized {}
|
||||
#[lang = "copy"]
|
||||
pub trait Copy {}
|
||||
impl<T: ?Sized> Copy for *const T {}
|
||||
#[lang = "legacy_receiver"]
|
||||
pub trait LegacyReceiver {}
|
||||
#[lang = "tuple_trait"]
|
||||
pub trait Tuple {}
|
||||
|
||||
pub struct Result<T, E> {
|
||||
_a: T,
|
||||
_b: E,
|
||||
}
|
||||
|
||||
impl Copy for usize {}
|
||||
impl Copy for &usize {}
|
||||
|
||||
#[lang = "drop_in_place"]
|
||||
pub unsafe fn drop_in_place<T: ?Sized>(_: *mut T) {}
|
||||
|
||||
#[lang = "fn_once"]
|
||||
pub trait FnOnce<Args: Tuple> {
|
||||
#[lang = "fn_once_output"]
|
||||
type Output;
|
||||
|
||||
extern "rust-call" fn call_once(self, args: Args) -> Self::Output;
|
||||
}
|
||||
|
||||
#[lang = "fn_mut"]
|
||||
pub trait FnMut<Args: Tuple>: FnOnce<Args> {
|
||||
extern "rust-call" fn call_mut(&mut self, args: Args) -> Self::Output;
|
||||
}
|
||||
|
||||
#[lang = "fn"]
|
||||
pub trait Fn<Args: Tuple>: FnOnce<Args> {
|
||||
/// Performs the call operation.
|
||||
extern "rust-call" fn call(&self, args: Args) -> Self::Output;
|
||||
}
|
||||
extern crate minicore;
|
||||
use minicore::*;
|
||||
|
||||
extern "rust-intrinsic" {
|
||||
pub fn transmute<Src, Dst>(src: Src) -> Dst;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
// Test that the correct module flags are emitted with different branch protection flags.
|
||||
|
||||
//@ add-core-stubs
|
||||
//@ revisions: BTI PACRET LEAF BKEY NONE
|
||||
//@ needs-llvm-components: aarch64
|
||||
//@ [BTI] compile-flags: -Z branch-protection=bti
|
||||
|
|
@ -13,8 +14,8 @@
|
|||
#![feature(no_core, lang_items)]
|
||||
#![no_core]
|
||||
|
||||
#[lang = "sized"]
|
||||
trait Sized {}
|
||||
extern crate minicore;
|
||||
use minicore::*;
|
||||
|
||||
// A basic test function.
|
||||
pub fn test() {}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
// Test that the correct module flags are emitted with different branch protection flags.
|
||||
|
||||
//@ add-core-stubs
|
||||
//@ revisions: BTI PACRET LEAF BKEY PAUTHLR PAUTHLR_BKEY PAUTHLR_LEAF PAUTHLR_BTI NONE
|
||||
//@ needs-llvm-components: aarch64
|
||||
//@ [BTI] compile-flags: -Z branch-protection=bti
|
||||
|
|
@ -17,8 +18,8 @@
|
|||
#![feature(no_core, lang_items)]
|
||||
#![no_core]
|
||||
|
||||
#[lang = "sized"]
|
||||
trait Sized {}
|
||||
extern crate minicore;
|
||||
use minicore::*;
|
||||
|
||||
// A basic test function.
|
||||
// CHECK: @test(){{.*}} [[ATTR:#[0-9]+]] {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
// ignore-tidy-linelength
|
||||
//@ add-core-stubs
|
||||
//@ revisions:aarch64 loongarch64 powerpc64 sparc64 x86_64
|
||||
//@ min-llvm-version: 19
|
||||
//@ compile-flags: -Copt-level=3 -Cno-prepopulate-passes -Zlint-llvm-ir -Cllvm-args=-lint-abort-on-error
|
||||
|
|
@ -21,12 +22,8 @@
|
|||
#![no_std]
|
||||
#![no_core]
|
||||
|
||||
#[lang = "sized"]
|
||||
trait Sized {}
|
||||
#[lang = "freeze"]
|
||||
trait Freeze {}
|
||||
#[lang = "copy"]
|
||||
trait Copy {}
|
||||
extern crate minicore;
|
||||
use minicore::*;
|
||||
|
||||
// This struct will be passed as a single `i64` or `i32`.
|
||||
// This may be (if `i64)) larger than the Rust layout, which is just `{ i16, i16 }`.
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
// Test that the correct module flags are emitted with different control-flow protection flags.
|
||||
|
||||
//@ add-core-stubs
|
||||
//@ revisions: undefined none branch return full
|
||||
//@ needs-llvm-components: x86
|
||||
//@ [undefined] compile-flags:
|
||||
|
|
@ -13,8 +14,8 @@
|
|||
#![feature(no_core, lang_items)]
|
||||
#![no_core]
|
||||
|
||||
#[lang = "sized"]
|
||||
trait Sized {}
|
||||
extern crate minicore;
|
||||
use minicore::*;
|
||||
|
||||
// A basic test function.
|
||||
pub fn test() {}
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
//@ add-core-stubs
|
||||
//@ revisions: linux apple
|
||||
//@ min-llvm-version: 19
|
||||
//@ compile-flags: -Copt-level=0 -Cno-prepopulate-passes -Zlint-llvm-ir -Cllvm-args=-lint-abort-on-error
|
||||
|
|
@ -14,12 +15,8 @@
|
|||
#![no_std]
|
||||
#![no_core]
|
||||
|
||||
#[lang = "sized"]
|
||||
trait Sized {}
|
||||
#[lang = "freeze"]
|
||||
trait Freeze {}
|
||||
#[lang = "copy"]
|
||||
trait Copy {}
|
||||
extern crate minicore;
|
||||
use minicore::*;
|
||||
|
||||
#[repr(C)]
|
||||
struct S {
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
//@ add-core-stubs
|
||||
//@ revisions: WINDOWS_ ANDROID_
|
||||
//@ compile-flags: -C panic=abort -Copt-level=0
|
||||
//@ [WINDOWS_] compile-flags: --target=x86_64-pc-windows-msvc
|
||||
|
|
@ -9,8 +10,8 @@
|
|||
#![crate_type = "lib"]
|
||||
#![no_core]
|
||||
|
||||
#[lang = "sized"]
|
||||
trait Sized {}
|
||||
extern crate minicore;
|
||||
use minicore::*;
|
||||
|
||||
// CHECK: attributes #{{.*}} uwtable
|
||||
pub fn foo() {}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
// as "inreg" like the C/C++ compilers for the platforms.
|
||||
// x86 only.
|
||||
|
||||
//@ add-core-stubs
|
||||
//@ compile-flags: --target i686-unknown-linux-gnu -Cno-prepopulate-passes -Copt-level=3
|
||||
//@ needs-llvm-components: x86
|
||||
|
||||
|
|
@ -9,10 +10,8 @@
|
|||
#![no_core]
|
||||
#![feature(no_core, lang_items)]
|
||||
|
||||
#[lang = "sized"]
|
||||
trait Sized {}
|
||||
#[lang = "copy"]
|
||||
trait Copy {}
|
||||
extern crate minicore;
|
||||
use minicore::*;
|
||||
|
||||
pub mod tests {
|
||||
// CHECK: @f1(i32 inreg noundef %_1, i32 inreg noundef %_2, i32 noundef %_3)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
// Test that the `reserve-x18` target feature is (not) emitted when
|
||||
// the `-Zfixed-x18` flag is (not) set.
|
||||
|
||||
//@ add-core-stubs
|
||||
//@ revisions: unset set
|
||||
//@ needs-llvm-components: aarch64
|
||||
//@ compile-flags: --target aarch64-unknown-none
|
||||
|
|
@ -10,8 +11,8 @@
|
|||
#![feature(no_core, lang_items)]
|
||||
#![no_core]
|
||||
|
||||
#[lang = "sized"]
|
||||
trait Sized {}
|
||||
extern crate minicore;
|
||||
use minicore::*;
|
||||
|
||||
#[no_mangle]
|
||||
pub fn foo() {
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
//@ add-core-stubs
|
||||
//@ compile-flags: --crate-type=rlib -Copt-level=0
|
||||
//@ revisions: aarch64-apple aarch64-linux force x64-apple x64-linux
|
||||
//@ [aarch64-apple] needs-llvm-components: aarch64
|
||||
|
|
@ -13,11 +14,9 @@
|
|||
|
||||
#![feature(no_core, lang_items)]
|
||||
#![no_core]
|
||||
#[lang = "sized"]
|
||||
trait Sized {}
|
||||
#[lang = "copy"]
|
||||
trait Copy {}
|
||||
impl Copy for u32 {}
|
||||
|
||||
extern crate minicore;
|
||||
use minicore::*;
|
||||
|
||||
// CHECK: define i32 @peach{{.*}}[[PEACH_ATTRS:\#[0-9]+]] {
|
||||
#[no_mangle]
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
// Test that the `fn_ret_thunk_extern` function attribute is (not) emitted when
|
||||
// the `-Zfunction-return={keep,thunk-extern}` flag is (not) set.
|
||||
|
||||
//@ add-core-stubs
|
||||
//@ revisions: unset keep thunk-extern keep-thunk-extern thunk-extern-keep
|
||||
//@ needs-llvm-components: x86
|
||||
//@ compile-flags: --target x86_64-unknown-linux-gnu
|
||||
|
|
@ -13,8 +14,8 @@
|
|||
#![feature(no_core, lang_items)]
|
||||
#![no_core]
|
||||
|
||||
#[lang = "sized"]
|
||||
trait Sized {}
|
||||
extern crate minicore;
|
||||
use minicore::*;
|
||||
|
||||
#[no_mangle]
|
||||
pub fn foo() {
|
||||
|
|
|
|||
|
|
@ -1,17 +1,14 @@
|
|||
// Checks that the gpu-kernel calling convention correctly translates to LLVM calling conventions.
|
||||
|
||||
//@ add-core-stubs
|
||||
//@ revisions: nvptx
|
||||
//@ [nvptx] compile-flags: --crate-type=rlib --target=nvptx64-nvidia-cuda
|
||||
//@ [nvptx] needs-llvm-components: nvptx
|
||||
#![feature(no_core, lang_items, abi_gpu_kernel)]
|
||||
#![no_core]
|
||||
|
||||
#[lang = "sized"]
|
||||
trait Sized {}
|
||||
#[lang = "freeze"]
|
||||
trait Freeze {}
|
||||
#[lang = "copy"]
|
||||
trait Copy {}
|
||||
extern crate minicore;
|
||||
use minicore::*;
|
||||
|
||||
// nvptx: define ptx_kernel void @fun(i32
|
||||
#[no_mangle]
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
//@ add-core-stubs
|
||||
//@ compile-flags: -Copt-level=3
|
||||
//@revisions: with_nontemporal without_nontemporal
|
||||
//@[with_nontemporal] compile-flags: --target aarch64-unknown-linux-gnu
|
||||
|
|
@ -14,13 +15,8 @@
|
|||
#![no_core]
|
||||
#![crate_type = "lib"]
|
||||
|
||||
#[lang = "sized"]
|
||||
pub trait Sized {}
|
||||
#[lang = "copy"]
|
||||
pub trait Copy {}
|
||||
|
||||
impl Copy for u32 {}
|
||||
impl<T> Copy for *mut T {}
|
||||
extern crate minicore;
|
||||
use minicore::*;
|
||||
|
||||
extern "rust-intrinsic" {
|
||||
pub fn nontemporal_store<T>(ptr: *mut T, val: T);
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
//@ add-core-stubs
|
||||
//@ compile-flags: -Copt-level=3 -C no-prepopulate-passes --target loongarch64-unknown-linux-gnu
|
||||
//@ needs-llvm-components: loongarch
|
||||
|
||||
|
|
@ -6,12 +7,8 @@
|
|||
#![no_std]
|
||||
#![no_core]
|
||||
|
||||
#[lang = "sized"]
|
||||
trait Sized {}
|
||||
#[lang = "freeze"]
|
||||
trait Freeze {}
|
||||
#[lang = "copy"]
|
||||
trait Copy {}
|
||||
extern crate minicore;
|
||||
use minicore::*;
|
||||
|
||||
// CHECK: define void @f_fpr_tracking(double %0, double %1, double %2, double %3, double %4, double %5, double %6, double %7, i8 noundef zeroext %i)
|
||||
#[no_mangle]
|
||||
|
|
|
|||
|
|
@ -1,19 +1,15 @@
|
|||
//
|
||||
// Checks that we correctly modify the target when MACOSX_DEPLOYMENT_TARGET is set.
|
||||
// See issue #60235.
|
||||
|
||||
//@ add-core-stubs
|
||||
//@ compile-flags: -Copt-level=3 --target=i686-apple-darwin --crate-type=rlib
|
||||
//@ needs-llvm-components: x86
|
||||
//@ rustc-env:MACOSX_DEPLOYMENT_TARGET=10.14
|
||||
#![feature(no_core, lang_items)]
|
||||
#![no_core]
|
||||
|
||||
#[lang = "sized"]
|
||||
trait Sized {}
|
||||
#[lang = "freeze"]
|
||||
trait Freeze {}
|
||||
#[lang = "copy"]
|
||||
trait Copy {}
|
||||
extern crate minicore;
|
||||
use minicore::*;
|
||||
|
||||
#[repr(C)]
|
||||
pub struct Bool {
|
||||
|
|
|
|||
|
|
@ -1,19 +1,15 @@
|
|||
//
|
||||
// Checks that we leave the target alone MACOSX_DEPLOYMENT_TARGET is unset.
|
||||
// See issue #60235.
|
||||
|
||||
//@ add-core-stubs
|
||||
//@ compile-flags: -Copt-level=3 --target=i686-apple-darwin --crate-type=rlib
|
||||
//@ needs-llvm-components: x86
|
||||
//@ unset-rustc-env:MACOSX_DEPLOYMENT_TARGET
|
||||
#![feature(no_core, lang_items)]
|
||||
#![no_core]
|
||||
|
||||
#[lang = "sized"]
|
||||
trait Sized {}
|
||||
#[lang = "freeze"]
|
||||
trait Freeze {}
|
||||
#[lang = "copy"]
|
||||
trait Copy {}
|
||||
extern crate minicore;
|
||||
use minicore::*;
|
||||
|
||||
#[repr(C)]
|
||||
pub struct Bool {
|
||||
|
|
|
|||
|
|
@ -1,19 +1,15 @@
|
|||
//
|
||||
// Checks that we correctly modify the target when MACOSX_DEPLOYMENT_TARGET is set.
|
||||
// See issue #60235.
|
||||
|
||||
//@ add-core-stubs
|
||||
//@ compile-flags: -Copt-level=3 --target=x86_64-apple-darwin --crate-type=rlib
|
||||
//@ needs-llvm-components: x86
|
||||
//@ rustc-env:MACOSX_DEPLOYMENT_TARGET=10.14
|
||||
#![feature(no_core, lang_items)]
|
||||
#![no_core]
|
||||
|
||||
#[lang = "sized"]
|
||||
trait Sized {}
|
||||
#[lang = "freeze"]
|
||||
trait Freeze {}
|
||||
#[lang = "copy"]
|
||||
trait Copy {}
|
||||
extern crate minicore;
|
||||
use minicore::*;
|
||||
|
||||
#[repr(C)]
|
||||
pub struct Bool {
|
||||
|
|
|
|||
|
|
@ -1,19 +1,15 @@
|
|||
//
|
||||
// Checks that we leave the target alone when MACOSX_DEPLOYMENT_TARGET is unset.
|
||||
// See issue #60235.
|
||||
|
||||
//@ add-core-stubs
|
||||
//@ compile-flags: -Copt-level=3 --target=x86_64-apple-darwin --crate-type=rlib
|
||||
//@ needs-llvm-components: x86
|
||||
//@ unset-rustc-env:MACOSX_DEPLOYMENT_TARGET
|
||||
#![feature(no_core, lang_items)]
|
||||
#![no_core]
|
||||
|
||||
#[lang = "sized"]
|
||||
trait Sized {}
|
||||
#[lang = "freeze"]
|
||||
trait Freeze {}
|
||||
#[lang = "copy"]
|
||||
trait Copy {}
|
||||
extern crate minicore;
|
||||
use minicore::*;
|
||||
|
||||
#[repr(C)]
|
||||
pub struct Bool {
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
//@ add-core-stubs
|
||||
//@ revisions: arm-mode thumb-mode
|
||||
//@ [arm-mode] compile-flags: --target armv5te-none-eabi
|
||||
//@ [thumb-mode] compile-flags: --target thumbv5te-none-eabi
|
||||
|
|
@ -8,15 +9,8 @@
|
|||
#![feature(no_core, lang_items, rustc_attrs, naked_functions)]
|
||||
#![no_core]
|
||||
|
||||
#[rustc_builtin_macro]
|
||||
macro_rules! naked_asm {
|
||||
() => {};
|
||||
}
|
||||
|
||||
#[lang = "sized"]
|
||||
trait Sized {}
|
||||
#[lang = "copy"]
|
||||
trait Copy {}
|
||||
extern crate minicore;
|
||||
use minicore::*;
|
||||
|
||||
// arm-mode: .arm
|
||||
// thumb-mode: .thumb
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
//@ add-core-stubs
|
||||
//@ revisions: linux win macos thumb
|
||||
//
|
||||
//@[linux] compile-flags: --target x86_64-unknown-linux-gnu
|
||||
|
|
@ -13,15 +14,8 @@
|
|||
#![feature(no_core, lang_items, rustc_attrs, naked_functions)]
|
||||
#![no_core]
|
||||
|
||||
#[rustc_builtin_macro]
|
||||
macro_rules! naked_asm {
|
||||
() => {};
|
||||
}
|
||||
|
||||
#[lang = "sized"]
|
||||
trait Sized {}
|
||||
#[lang = "copy"]
|
||||
trait Copy {}
|
||||
extern crate minicore;
|
||||
use minicore::*;
|
||||
|
||||
// linux,win: .intel_syntax
|
||||
//
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
// Test that the `no-jump-tables` function attribute are (not) emitted when
|
||||
// the `-Zno-jump-tables` flag is (not) set.
|
||||
|
||||
//@ add-core-stubs
|
||||
//@ revisions: unset set
|
||||
//@ needs-llvm-components: x86
|
||||
//@ compile-flags: --target x86_64-unknown-linux-gnu
|
||||
|
|
@ -10,8 +11,8 @@
|
|||
#![feature(no_core, lang_items)]
|
||||
#![no_core]
|
||||
|
||||
#[lang = "sized"]
|
||||
trait Sized {}
|
||||
extern crate minicore;
|
||||
use minicore::*;
|
||||
|
||||
#[no_mangle]
|
||||
pub fn foo() {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
// Test that structs aligned to 128 bits are passed with the correct ABI on powerpc64le.
|
||||
// This is similar to aarch64-struct-align-128.rs, but for ppc.
|
||||
|
||||
//@ add-core-stubs
|
||||
//@ compile-flags: --target powerpc64le-unknown-linux-gnu
|
||||
//@ needs-llvm-components: powerpc
|
||||
|
||||
|
|
@ -8,12 +9,8 @@
|
|||
#![crate_type = "lib"]
|
||||
#![no_core]
|
||||
|
||||
#[lang = "sized"]
|
||||
trait Sized {}
|
||||
#[lang = "freeze"]
|
||||
trait Freeze {}
|
||||
#[lang = "copy"]
|
||||
trait Copy {}
|
||||
extern crate minicore;
|
||||
use minicore::*;
|
||||
|
||||
#[repr(C)]
|
||||
pub struct Align8 {
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
// marks function arguments as "inreg" like the C/C++ compilers for the platforms.
|
||||
// x86 only.
|
||||
|
||||
//@ add-core-stubs
|
||||
//@ compile-flags: --target i686-unknown-linux-gnu -Cno-prepopulate-passes -Copt-level=3
|
||||
//@ needs-llvm-components: x86
|
||||
|
||||
|
|
@ -14,10 +15,9 @@
|
|||
#![crate_type = "lib"]
|
||||
#![no_core]
|
||||
#![feature(no_core, lang_items, repr_simd)]
|
||||
#[lang = "sized"]
|
||||
trait Sized {}
|
||||
#[lang = "copy"]
|
||||
trait Copy {}
|
||||
|
||||
extern crate minicore;
|
||||
use minicore::*;
|
||||
|
||||
pub mod tests {
|
||||
// regparm doesn't work for "fastcall" calling conv (only 2 inregs)
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
//@ add-core-stubs
|
||||
//@ revisions: i686-linux i686-freebsd x64-linux x64-apple
|
||||
//@ compile-flags: -Copt-level=3 -C no-prepopulate-passes
|
||||
|
||||
|
|
@ -21,14 +22,9 @@
|
|||
#![no_std]
|
||||
#![no_core]
|
||||
|
||||
#[lang = "sized"]
|
||||
trait Sized {}
|
||||
#[lang = "freeze"]
|
||||
trait Freeze {}
|
||||
#[lang = "copy"]
|
||||
trait Copy {}
|
||||
extern crate minicore;
|
||||
use minicore::*;
|
||||
|
||||
impl Copy for [u32; 16] {}
|
||||
impl Copy for BigS {}
|
||||
impl Copy for BigU {}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
//@ add-core-stubs
|
||||
//@ revisions: arm-linux arm-android armv7-linux armv7-android mips thumb sparc
|
||||
//@ compile-flags: -Copt-level=3 -C no-prepopulate-passes
|
||||
|
||||
|
|
@ -27,14 +28,8 @@
|
|||
#![no_std]
|
||||
#![no_core]
|
||||
|
||||
#[lang = "sized"]
|
||||
trait Sized {}
|
||||
#[lang = "freeze"]
|
||||
trait Freeze {}
|
||||
#[lang = "copy"]
|
||||
trait Copy {}
|
||||
|
||||
impl Copy for [u32; 16] {}
|
||||
extern crate minicore;
|
||||
use minicore::*;
|
||||
impl Copy for BigS {}
|
||||
impl Copy for BigU {}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
//@ add-core-stubs
|
||||
//@ revisions: mips64 mips64el
|
||||
//@ compile-flags: -Copt-level=3 -C no-prepopulate-passes
|
||||
|
||||
|
|
@ -13,14 +14,9 @@
|
|||
#![no_std]
|
||||
#![no_core]
|
||||
|
||||
#[lang = "sized"]
|
||||
trait Sized {}
|
||||
#[lang = "freeze"]
|
||||
trait Freeze {}
|
||||
#[lang = "copy"]
|
||||
trait Copy {}
|
||||
extern crate minicore;
|
||||
use minicore::*;
|
||||
|
||||
impl Copy for [u32; 16] {}
|
||||
impl Copy for BigS {}
|
||||
impl Copy for BigU {}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
//@ add-core-stubs
|
||||
//@ revisions: aarch64-linux aarch64-darwin wasm32-wasip1
|
||||
//@ compile-flags: -Copt-level=3 -C no-prepopulate-passes
|
||||
|
||||
|
|
@ -19,14 +20,9 @@
|
|||
#![no_std]
|
||||
#![no_core]
|
||||
|
||||
#[lang = "sized"]
|
||||
trait Sized {}
|
||||
#[lang = "freeze"]
|
||||
trait Freeze {}
|
||||
#[lang = "copy"]
|
||||
trait Copy {}
|
||||
extern crate minicore;
|
||||
use minicore::*;
|
||||
|
||||
impl Copy for [u32; 16] {}
|
||||
impl Copy for BigS {}
|
||||
impl Copy for BigU {}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
//@ add-core-stubs
|
||||
//@ compile-flags: -Copt-level=3 -C no-prepopulate-passes --target sparc64-unknown-linux-gnu
|
||||
//@ needs-llvm-components: sparc
|
||||
|
||||
|
|
@ -8,14 +9,8 @@
|
|||
#![no_std]
|
||||
#![no_core]
|
||||
|
||||
#[lang = "sized"]
|
||||
trait Sized {}
|
||||
#[lang = "freeze"]
|
||||
trait Freeze {}
|
||||
#[lang = "copy"]
|
||||
trait Copy {}
|
||||
|
||||
impl Copy for [u32; 16] {}
|
||||
extern crate minicore;
|
||||
use minicore::*;
|
||||
impl Copy for BigS {}
|
||||
impl Copy for BigU {}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
//@ add-core-stubs
|
||||
//@ revisions: linux apple win
|
||||
//@ compile-flags: -Copt-level=3 -C no-prepopulate-passes
|
||||
|
||||
|
|
@ -13,12 +14,8 @@
|
|||
#![no_std]
|
||||
#![no_core]
|
||||
|
||||
#[lang = "sized"]
|
||||
trait Sized {}
|
||||
#[lang = "freeze"]
|
||||
trait Freeze {}
|
||||
#[lang = "copy"]
|
||||
trait Copy {}
|
||||
extern crate minicore;
|
||||
use minicore::*;
|
||||
|
||||
#[repr(C)]
|
||||
pub struct Rgb8 {
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
//@ add-core-stubs
|
||||
//@ compile-flags: --target riscv64gc-unknown-linux-gnu -Copt-level=3 -C no-prepopulate-passes -C panic=abort
|
||||
//@ needs-llvm-components: riscv
|
||||
|
||||
|
|
@ -6,19 +7,8 @@
|
|||
#![feature(no_core, lang_items)]
|
||||
#![allow(improper_ctypes)]
|
||||
|
||||
#[lang = "sized"]
|
||||
trait Sized {}
|
||||
#[lang = "copy"]
|
||||
trait Copy {}
|
||||
impl Copy for bool {}
|
||||
impl Copy for i8 {}
|
||||
impl Copy for u8 {}
|
||||
impl Copy for i32 {}
|
||||
impl Copy for i64 {}
|
||||
impl Copy for u64 {}
|
||||
impl Copy for f32 {}
|
||||
impl Copy for f64 {}
|
||||
impl<T> Copy for *mut T {}
|
||||
extern crate minicore;
|
||||
use minicore::*;
|
||||
|
||||
// CHECK: define void @f_void()
|
||||
#[no_mangle]
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
//@ add-core-stubs
|
||||
//@ compile-flags: -Copt-level=3 -C no-prepopulate-passes --target riscv64gc-unknown-linux-gnu
|
||||
//@ needs-llvm-components: riscv
|
||||
|
||||
|
|
@ -6,12 +7,8 @@
|
|||
#![no_std]
|
||||
#![no_core]
|
||||
|
||||
#[lang = "sized"]
|
||||
trait Sized {}
|
||||
#[lang = "freeze"]
|
||||
trait Freeze {}
|
||||
#[lang = "copy"]
|
||||
trait Copy {}
|
||||
extern crate minicore;
|
||||
use minicore::*;
|
||||
|
||||
// CHECK: define void @f_fpr_tracking(double %0, double %1, double %2, double %3, double %4, double %5, double %6, double %7, i8 noundef zeroext %i)
|
||||
#[no_mangle]
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
//@ add-core-stubs
|
||||
//@ compile-flags: -Copt-level=3 -C no-prepopulate-passes --target riscv64gc-unknown-linux-gnu
|
||||
//@ needs-llvm-components: riscv
|
||||
|
||||
|
|
@ -6,12 +7,8 @@
|
|||
#![no_std]
|
||||
#![no_core]
|
||||
|
||||
#[lang = "sized"]
|
||||
trait Sized {}
|
||||
#[lang = "freeze"]
|
||||
trait Freeze {}
|
||||
#[lang = "copy"]
|
||||
trait Copy {}
|
||||
extern crate minicore;
|
||||
use minicore::*;
|
||||
|
||||
// CHECK: define void @f_fpr_tracking(float %0, float %1, float %2, float %3, float %4, float %5, float %6, float %7, i8 noundef zeroext %i)
|
||||
#[no_mangle]
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
//@ add-core-stubs
|
||||
//@ revisions:riscv64gc riscv32gc riscv32imac
|
||||
|
||||
//@[riscv64gc] compile-flags: --target=riscv64gc-unknown-linux-gnu
|
||||
|
|
@ -16,5 +17,5 @@
|
|||
#![crate_type = "lib"]
|
||||
#![no_core]
|
||||
|
||||
#[lang = "sized"]
|
||||
trait Sized {}
|
||||
extern crate minicore;
|
||||
use minicore::*;
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
//@ add-core-stubs
|
||||
//@ revisions: aarch64 android
|
||||
//@[aarch64] compile-flags: --target aarch64-unknown-none -Zfixed-x18 -Zsanitizer=shadow-call-stack
|
||||
//@[aarch64] needs-llvm-components: aarch64
|
||||
|
|
@ -9,8 +10,8 @@
|
|||
#![feature(no_core, lang_items)]
|
||||
#![no_core]
|
||||
|
||||
#[lang = "sized"]
|
||||
trait Sized {}
|
||||
extern crate minicore;
|
||||
use minicore::*;
|
||||
|
||||
// CHECK: ; Function Attrs:{{.*}}shadowcallstack
|
||||
#[no_mangle]
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
// Verifies that `-Zsanitizer=kernel-address` emits sanitizer instrumentation.
|
||||
|
||||
//@ add-core-stubs
|
||||
//@ compile-flags: -Zsanitizer=kernel-address -Copt-level=0
|
||||
//@ revisions: aarch64 riscv64imac riscv64gc x86_64
|
||||
//@[aarch64] compile-flags: --target aarch64-unknown-none
|
||||
|
|
@ -15,13 +16,8 @@
|
|||
#![feature(no_core, no_sanitize, lang_items)]
|
||||
#![no_core]
|
||||
|
||||
#[lang = "sized"]
|
||||
trait Sized {}
|
||||
|
||||
#[lang = "copy"]
|
||||
trait Copy {}
|
||||
|
||||
impl Copy for u8 {}
|
||||
extern crate minicore;
|
||||
use minicore::*;
|
||||
|
||||
// CHECK-LABEL: ; kasan_emits_instrumentation::unsanitized
|
||||
// CHECK-NEXT: ; Function Attrs:
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
// Verifies that "cfi-normalize-integers" module flag is added.
|
||||
//
|
||||
//@ add-core-stubs
|
||||
//@ revisions: aarch64 x86_64
|
||||
//@ [aarch64] compile-flags: --target aarch64-unknown-none
|
||||
//@ [aarch64] needs-llvm-components: aarch64
|
||||
|
|
@ -11,10 +12,8 @@
|
|||
#![crate_type = "lib"]
|
||||
#![no_core]
|
||||
|
||||
#[lang = "sized"]
|
||||
trait Sized {}
|
||||
#[lang = "copy"]
|
||||
trait Copy {}
|
||||
extern crate minicore;
|
||||
use minicore::*;
|
||||
|
||||
pub fn foo() {}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
// Verifies that "kcfi" module flag is added.
|
||||
//
|
||||
//@ add-core-stubs
|
||||
//@ revisions: aarch64 x86_64
|
||||
//@ [aarch64] compile-flags: --target aarch64-unknown-none
|
||||
//@ [aarch64] needs-llvm-components: aarch64
|
||||
|
|
@ -11,10 +12,8 @@
|
|||
#![crate_type = "lib"]
|
||||
#![no_core]
|
||||
|
||||
#[lang = "sized"]
|
||||
trait Sized {}
|
||||
#[lang = "copy"]
|
||||
trait Copy {}
|
||||
extern crate minicore;
|
||||
use minicore::*;
|
||||
|
||||
pub fn foo() {}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
// Verifies that "kcfi-offset" module flag is added.
|
||||
//
|
||||
//@ add-core-stubs
|
||||
//@ revisions: aarch64 x86_64
|
||||
//@ [aarch64] compile-flags: --target aarch64-unknown-none
|
||||
//@ [aarch64] needs-llvm-components: aarch64
|
||||
|
|
@ -11,10 +12,8 @@
|
|||
#![crate_type = "lib"]
|
||||
#![no_core]
|
||||
|
||||
#[lang = "sized"]
|
||||
trait Sized {}
|
||||
#[lang = "copy"]
|
||||
trait Copy {}
|
||||
extern crate minicore;
|
||||
use minicore::*;
|
||||
|
||||
pub fn foo() {}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
// Verifies that KCFI operand bundles are omitted.
|
||||
//
|
||||
//@ add-core-stubs
|
||||
//@ revisions: aarch64 x86_64
|
||||
//@ [aarch64] compile-flags: --target aarch64-unknown-none
|
||||
//@ [aarch64] needs-llvm-components: aarch64
|
||||
|
|
@ -11,12 +12,8 @@
|
|||
#![feature(no_core, no_sanitize, lang_items)]
|
||||
#![no_core]
|
||||
|
||||
#[lang = "sized"]
|
||||
trait Sized {}
|
||||
#[lang = "copy"]
|
||||
trait Copy {}
|
||||
|
||||
impl Copy for i32 {}
|
||||
extern crate minicore;
|
||||
use minicore::*;
|
||||
|
||||
#[no_sanitize(kcfi)]
|
||||
pub fn foo(f: fn(i32) -> i32, arg: i32) -> i32 {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
// Verifies that generalized KCFI type metadata for functions are emitted.
|
||||
//
|
||||
//@ add-core-stubs
|
||||
//@ revisions: aarch64 x86_64
|
||||
//@ [aarch64] compile-flags: --target aarch64-unknown-none
|
||||
//@ [aarch64] needs-llvm-components: aarch64
|
||||
|
|
@ -11,12 +12,8 @@
|
|||
#![feature(no_core, lang_items)]
|
||||
#![no_core]
|
||||
|
||||
#[lang = "sized"]
|
||||
trait Sized {}
|
||||
#[lang = "copy"]
|
||||
trait Copy {}
|
||||
|
||||
impl Copy for i32 {}
|
||||
extern crate minicore;
|
||||
use minicore::*;
|
||||
|
||||
pub fn foo(f: fn(i32) -> i32, arg: i32) -> i32 {
|
||||
// CHECK-LABEL: define{{.*}}foo
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
// Verifies that normalized and generalized KCFI type metadata for functions are emitted.
|
||||
//
|
||||
//@ add-core-stubs
|
||||
//@ revisions: aarch64 x86_64
|
||||
//@ [aarch64] compile-flags: --target aarch64-unknown-none
|
||||
//@ [aarch64] needs-llvm-components: aarch64
|
||||
|
|
@ -11,12 +12,8 @@
|
|||
#![feature(no_core, lang_items)]
|
||||
#![no_core]
|
||||
|
||||
#[lang = "sized"]
|
||||
trait Sized {}
|
||||
#[lang = "copy"]
|
||||
trait Copy {}
|
||||
|
||||
impl Copy for i32 {}
|
||||
extern crate minicore;
|
||||
use minicore::*;
|
||||
|
||||
pub fn foo(f: fn(i32) -> i32, arg: i32) -> i32 {
|
||||
// CHECK-LABEL: define{{.*}}foo
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
// Verifies that normalized KCFI type metadata for functions are emitted.
|
||||
//
|
||||
//@ add-core-stubs
|
||||
//@ revisions: aarch64 x86_64
|
||||
//@ [aarch64] compile-flags: --target aarch64-unknown-none
|
||||
//@ [aarch64] needs-llvm-components: aarch64
|
||||
|
|
@ -11,12 +12,8 @@
|
|||
#![feature(no_core, lang_items)]
|
||||
#![no_core]
|
||||
|
||||
#[lang = "sized"]
|
||||
trait Sized {}
|
||||
#[lang = "copy"]
|
||||
trait Copy {}
|
||||
|
||||
impl Copy for i32 {}
|
||||
extern crate minicore;
|
||||
use minicore::*;
|
||||
|
||||
pub fn foo(f: fn(i32) -> i32, arg: i32) -> i32 {
|
||||
// CHECK-LABEL: define{{.*}}foo
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
// Verifies that KCFI type metadata for functions are emitted.
|
||||
//
|
||||
//@ add-core-stubs
|
||||
//@ revisions: aarch64 x86_64
|
||||
//@ [aarch64] compile-flags: --target aarch64-unknown-none
|
||||
//@ [aarch64] needs-llvm-components: aarch64
|
||||
|
|
@ -11,12 +12,8 @@
|
|||
#![feature(no_core, lang_items)]
|
||||
#![no_core]
|
||||
|
||||
#[lang = "sized"]
|
||||
trait Sized {}
|
||||
#[lang = "copy"]
|
||||
trait Copy {}
|
||||
|
||||
impl Copy for i32 {}
|
||||
extern crate minicore;
|
||||
use minicore::*;
|
||||
|
||||
pub fn foo(f: fn(i32) -> i32, arg: i32) -> i32 {
|
||||
// CHECK-LABEL: define{{.*}}foo
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
// Verifies that KCFI operand bundles are emitted.
|
||||
//
|
||||
//@ add-core-stubs
|
||||
//@ revisions: aarch64 x86_64
|
||||
//@ [aarch64] compile-flags: --target aarch64-unknown-none
|
||||
//@ [aarch64] needs-llvm-components: aarch64
|
||||
|
|
@ -11,12 +12,8 @@
|
|||
#![feature(no_core, lang_items)]
|
||||
#![no_core]
|
||||
|
||||
#[lang = "sized"]
|
||||
trait Sized {}
|
||||
#[lang = "copy"]
|
||||
trait Copy {}
|
||||
|
||||
impl Copy for i32 {}
|
||||
extern crate minicore;
|
||||
use minicore::*;
|
||||
|
||||
pub fn foo(f: fn(i32) -> i32, arg: i32) -> i32 {
|
||||
// CHECK-LABEL: define{{.*}}foo{{.*}}!{{<unknown kind #36>|kcfi_type}} !{{[0-9]+}}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
// Verifies that type metadata identifiers for trait objects are emitted correctly.
|
||||
//
|
||||
//@ add-core-stubs
|
||||
//@ revisions: aarch64 x86_64
|
||||
//@ [aarch64] compile-flags: --target aarch64-unknown-none
|
||||
//@ [aarch64] needs-llvm-components: aarch64
|
||||
|
|
@ -11,29 +12,8 @@
|
|||
#![feature(arbitrary_self_types, no_core, lang_items)]
|
||||
#![no_core]
|
||||
|
||||
#[lang = "sized"]
|
||||
trait Sized {}
|
||||
#[lang = "copy"]
|
||||
trait Copy {}
|
||||
impl<T: ?Sized> Copy for &T {}
|
||||
#[lang = "legacy_receiver"]
|
||||
trait LegacyReceiver {}
|
||||
#[lang = "dispatch_from_dyn"]
|
||||
trait DispatchFromDyn<T> {}
|
||||
impl<'a, T: ?Sized + Unsize<U>, U: ?Sized> DispatchFromDyn<&'a U> for &'a T {}
|
||||
#[lang = "unsize"]
|
||||
trait Unsize<T: ?Sized> {}
|
||||
#[lang = "coerce_unsized"]
|
||||
pub trait CoerceUnsized<T: ?Sized> {}
|
||||
impl<'a, 'b: 'a, T: ?Sized + Unsize<U>, U: ?Sized> CoerceUnsized<&'a U> for &'b T {}
|
||||
#[lang = "freeze"]
|
||||
trait Freeze {}
|
||||
#[lang = "drop_in_place"]
|
||||
fn drop_in_place_fn<T>() {}
|
||||
#[lang = "drop"]
|
||||
trait Drop {
|
||||
fn drop(&mut self);
|
||||
}
|
||||
extern crate minicore;
|
||||
use minicore::*;
|
||||
|
||||
pub trait Trait1 {
|
||||
fn foo(&self);
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
//@ add-core-stubs
|
||||
//@ compile-flags: --target riscv64imac-unknown-none-elf -Zsanitizer=shadow-call-stack
|
||||
//@ needs-llvm-components: riscv
|
||||
|
||||
|
|
@ -6,8 +7,8 @@
|
|||
#![feature(no_core, lang_items)]
|
||||
#![no_core]
|
||||
|
||||
#[lang = "sized"]
|
||||
trait Sized {}
|
||||
extern crate minicore;
|
||||
use minicore::*;
|
||||
|
||||
// CHECK: ; Function Attrs:{{.*}}shadowcallstack
|
||||
// CHECK: define dso_local void @foo() unnamed_addr #0
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
//@ add-core-stubs
|
||||
//@ compile-flags: -Cno-prepopulate-passes -Copt-level=0
|
||||
|
||||
//@ revisions:x86_64 i686 aarch64-apple aarch64-windows aarch64-linux arm riscv
|
||||
|
|
@ -24,12 +25,8 @@
|
|||
#![no_std]
|
||||
#![no_core]
|
||||
|
||||
#[lang = "sized"]
|
||||
trait Sized {}
|
||||
#[lang = "freeze"]
|
||||
trait Freeze {}
|
||||
#[lang = "copy"]
|
||||
trait Copy {}
|
||||
extern crate minicore;
|
||||
use minicore::*;
|
||||
|
||||
// The patterns in this file are written in the style of a table to make the
|
||||
// uniformities and distinctions more apparent.
|
||||
|
|
|
|||
|
|
@ -1,17 +1,14 @@
|
|||
// Checks that we correctly codegen extern "C" functions returning structs.
|
||||
// See issues #52638 and #86163.
|
||||
|
||||
//@ add-core-stubs
|
||||
//@ compile-flags: -Copt-level=3 --target=sparc64-unknown-linux-gnu --crate-type=rlib
|
||||
//@ needs-llvm-components: sparc
|
||||
#![feature(no_core, lang_items)]
|
||||
#![no_core]
|
||||
|
||||
#[lang = "sized"]
|
||||
trait Sized {}
|
||||
#[lang = "freeze"]
|
||||
trait Freeze {}
|
||||
#[lang = "copy"]
|
||||
trait Copy {}
|
||||
extern crate minicore;
|
||||
use minicore::*;
|
||||
|
||||
#[repr(C)]
|
||||
pub struct Bool {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
// Check the "probe-stack" attribute for targets with `StackProbeType::Inline`,
|
||||
// or `StackProbeType::InlineOrCall` when running on newer LLVM.
|
||||
|
||||
//@ add-core-stubs
|
||||
//@ compile-flags: -C no-prepopulate-passes
|
||||
//@ revisions: aarch64 powerpc powerpc64 powerpc64le s390x i686 x86_64
|
||||
//@[aarch64] compile-flags: --target aarch64-unknown-linux-gnu
|
||||
|
|
@ -22,8 +23,8 @@
|
|||
#![feature(no_core, lang_items)]
|
||||
#![no_core]
|
||||
|
||||
#[lang = "sized"]
|
||||
trait Sized {}
|
||||
extern crate minicore;
|
||||
use minicore::*;
|
||||
|
||||
#[no_mangle]
|
||||
pub fn foo() {
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
//@ add-core-stubs
|
||||
//@ revisions: COMPAT INCOMPAT
|
||||
//@ needs-llvm-components: x86
|
||||
//@ compile-flags: --target=x86_64-unknown-linux-gnu -Copt-level=3
|
||||
|
|
@ -9,10 +10,8 @@
|
|||
#![crate_type = "lib"]
|
||||
#![no_core]
|
||||
|
||||
#[lang = "sized"]
|
||||
trait Sized {}
|
||||
#[lang = "copy"]
|
||||
trait Copy {}
|
||||
extern crate minicore;
|
||||
use minicore::*;
|
||||
|
||||
extern "C" {
|
||||
fn peach() -> u32;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
// ignore-tidy-linelength
|
||||
//@ add-core-stubs
|
||||
//@ revisions: ENABLE_SVE DISABLE_SVE DISABLE_NEON ENABLE_NEON
|
||||
//@ compile-flags: --crate-type=rlib --target=aarch64-unknown-linux-gnu
|
||||
//@ needs-llvm-components: aarch64
|
||||
|
|
@ -22,7 +23,7 @@
|
|||
#![feature(no_core, lang_items)]
|
||||
#![no_core]
|
||||
|
||||
#[lang = "sized"]
|
||||
trait Sized {}
|
||||
extern crate minicore;
|
||||
use minicore::*;
|
||||
|
||||
pub fn test() {}
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
//@ add-core-stubs
|
||||
//@ build-pass
|
||||
//@ revisions: arm
|
||||
//@[arm] compile-flags: --target arm-unknown-linux-gnueabi
|
||||
|
|
@ -14,19 +15,8 @@
|
|||
#![crate_type = "lib"]
|
||||
#![allow(non_camel_case_types)]
|
||||
|
||||
/// To work cross-target this test must be no_core.
|
||||
/// This little prelude supplies what we need.
|
||||
#[lang = "sized"]
|
||||
pub trait Sized {}
|
||||
|
||||
#[lang = "copy"]
|
||||
pub trait Copy: Sized {}
|
||||
impl Copy for i8 {}
|
||||
impl<T: ?Sized> Copy for *const T {}
|
||||
impl<T: ?Sized> Copy for *mut T {}
|
||||
|
||||
// I hate no_core tests!
|
||||
impl<T: Copy, const N: usize> Copy for [T; N] {}
|
||||
extern crate minicore;
|
||||
use minicore::*;
|
||||
|
||||
// Regression test for https://github.com/rust-lang/rust/issues/118124.
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
error[E0703]: invalid ABI: found `riscv-interrupt`
|
||||
--> $DIR/riscv-discoverability-guidance.rs:17:8
|
||||
--> $DIR/riscv-discoverability-guidance.rs:15:8
|
||||
|
|
||||
LL | extern "riscv-interrupt" fn isr() {}
|
||||
| ^^^^^^^^^^^^^^^^^
|
||||
|
|
@ -10,7 +10,7 @@ LL | extern "riscv-interrupt" fn isr() {}
|
|||
= note: invoke `rustc --print=calling-conventions` for a full list of supported calling conventions
|
||||
|
||||
error[E0703]: invalid ABI: found `riscv-interrupt-u`
|
||||
--> $DIR/riscv-discoverability-guidance.rs:22:8
|
||||
--> $DIR/riscv-discoverability-guidance.rs:20:8
|
||||
|
|
||||
LL | extern "riscv-interrupt-u" fn isr_U() {}
|
||||
| ^^^^^^^^^^^^^^^^^^^
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
error[E0703]: invalid ABI: found `riscv-interrupt`
|
||||
--> $DIR/riscv-discoverability-guidance.rs:17:8
|
||||
--> $DIR/riscv-discoverability-guidance.rs:15:8
|
||||
|
|
||||
LL | extern "riscv-interrupt" fn isr() {}
|
||||
| ^^^^^^^^^^^^^^^^^
|
||||
|
|
@ -10,7 +10,7 @@ LL | extern "riscv-interrupt" fn isr() {}
|
|||
= note: invoke `rustc --print=calling-conventions` for a full list of supported calling conventions
|
||||
|
||||
error[E0703]: invalid ABI: found `riscv-interrupt-u`
|
||||
--> $DIR/riscv-discoverability-guidance.rs:22:8
|
||||
--> $DIR/riscv-discoverability-guidance.rs:20:8
|
||||
|
|
||||
LL | extern "riscv-interrupt-u" fn isr_U() {}
|
||||
| ^^^^^^^^^^^^^^^^^^^
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
// ignore-tidy-linelength
|
||||
//@ add-core-stubs
|
||||
//@ revisions: riscv32 riscv64
|
||||
//
|
||||
//@ [riscv32] needs-llvm-components: riscv
|
||||
|
|
@ -6,13 +7,10 @@
|
|||
//@ [riscv64] needs-llvm-components: riscv
|
||||
//@ [riscv64] compile-flags: --target=riscv64gc-unknown-none-elf -C target-feature=-unaligned-scalar-mem --crate-type=rlib
|
||||
#![no_core]
|
||||
#![feature(
|
||||
no_core,
|
||||
lang_items,
|
||||
abi_riscv_interrupt
|
||||
)]
|
||||
#[lang = "sized"]
|
||||
trait Sized {}
|
||||
#![feature(no_core, lang_items, abi_riscv_interrupt)]
|
||||
|
||||
extern crate minicore;
|
||||
use minicore::*;
|
||||
|
||||
extern "riscv-interrupt" fn isr() {}
|
||||
//~^ ERROR invalid ABI
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
//@ add-core-stubs
|
||||
//@ revisions: sparc sparcv8plus sparc_cpu_v9 sparc_feature_v8plus sparc_cpu_v9_feature_v8plus
|
||||
//@[sparc] compile-flags: --target sparc-unknown-none-elf
|
||||
//@[sparc] needs-llvm-components: sparc
|
||||
|
|
@ -15,10 +16,8 @@
|
|||
#![feature(no_core, rustc_attrs, lang_items)]
|
||||
#![no_core]
|
||||
|
||||
#[lang = "sized"]
|
||||
trait Sized {}
|
||||
#[lang = "copy"]
|
||||
trait Copy {}
|
||||
extern crate minicore;
|
||||
use minicore::*;
|
||||
|
||||
#[rustc_builtin_macro]
|
||||
macro_rules! compile_error {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
error: -v8plus,-v9
|
||||
--> $DIR/sparcv8plus-llvm19.rs:29:1
|
||||
--> $DIR/sparcv8plus-llvm19.rs:28:1
|
||||
|
|
||||
LL | compile_error!("-v8plus,-v9");
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
error: +v8plus,+v9
|
||||
--> $DIR/sparcv8plus-llvm19.rs:34:1
|
||||
--> $DIR/sparcv8plus-llvm19.rs:33:1
|
||||
|
|
||||
LL | compile_error!("+v8plus,+v9");
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
error: +v8plus,+v9
|
||||
--> $DIR/sparcv8plus-llvm19.rs:34:1
|
||||
--> $DIR/sparcv8plus-llvm19.rs:33:1
|
||||
|
|
||||
LL | compile_error!("+v8plus,+v9");
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
error: +v8plus,-v9 (FIXME)
|
||||
--> $DIR/sparcv8plus-llvm19.rs:39:1
|
||||
--> $DIR/sparcv8plus-llvm19.rs:38:1
|
||||
|
|
||||
LL | compile_error!("+v8plus,-v9 (FIXME)");
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
error: +v8plus,+v9
|
||||
--> $DIR/sparcv8plus-llvm19.rs:34:1
|
||||
--> $DIR/sparcv8plus-llvm19.rs:33:1
|
||||
|
|
||||
LL | compile_error!("+v8plus,+v9");
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
//@ add-core-stubs
|
||||
//@ revisions: sparc sparcv8plus sparc_cpu_v9 sparc_feature_v8plus sparc_cpu_v9_feature_v8plus
|
||||
//@[sparc] compile-flags: --target sparc-unknown-none-elf
|
||||
//@[sparc] needs-llvm-components: sparc
|
||||
|
|
@ -15,10 +16,8 @@
|
|||
#![feature(no_core, rustc_attrs, lang_items)]
|
||||
#![no_core]
|
||||
|
||||
#[lang = "sized"]
|
||||
trait Sized {}
|
||||
#[lang = "copy"]
|
||||
trait Copy {}
|
||||
extern crate minicore;
|
||||
use minicore::*;
|
||||
|
||||
#[rustc_builtin_macro]
|
||||
macro_rules! compile_error {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
error: -v8plus,-v9
|
||||
--> $DIR/sparcv8plus.rs:29:1
|
||||
--> $DIR/sparcv8plus.rs:28:1
|
||||
|
|
||||
LL | compile_error!("-v8plus,-v9");
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
error: -v8plus,+v9
|
||||
--> $DIR/sparcv8plus.rs:42:1
|
||||
--> $DIR/sparcv8plus.rs:41:1
|
||||
|
|
||||
LL | compile_error!("-v8plus,+v9");
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
error: +v8plus,+v9
|
||||
--> $DIR/sparcv8plus.rs:33:1
|
||||
--> $DIR/sparcv8plus.rs:32:1
|
||||
|
|
||||
LL | compile_error!("+v8plus,+v9");
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
error: +v8plus,-v9 (FIXME)
|
||||
--> $DIR/sparcv8plus.rs:38:1
|
||||
--> $DIR/sparcv8plus.rs:37:1
|
||||
|
|
||||
LL | compile_error!("+v8plus,-v9 (FIXME)");
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue