Skip to content

Commit

Permalink
Unrolled build for rust-lang#134436
Browse files Browse the repository at this point in the history
Rollup merge of rust-lang#134436 - taiki-e:assembly-asm-minicore, r=jieyouxu

tests/assembly/asm: Remove uses of rustc_attrs and lang_items features by using minicore

Similar to rust-lang#134385 (for tests/ui/asm), but for tests/assembly/asm.

r? jieyouxu
  • Loading branch information
rust-timer authored Dec 18, 2024
2 parents 057bdb3 + bd7213f commit be1dffa
Show file tree
Hide file tree
Showing 22 changed files with 110 additions and 489 deletions.
12 changes: 4 additions & 8 deletions tests/assembly/asm/aarch64-el2vmsa.rs
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
//@ add-core-stubs
//@ assembly-output: emit-asm
//@ compile-flags: --target aarch64-unknown-linux-gnu
//@ needs-llvm-components: aarch64

#![feature(no_core, lang_items, rustc_attrs)]
#![feature(no_core)]
#![crate_type = "rlib"]
#![no_core]

#[rustc_builtin_macro]
macro_rules! asm {
() => {};
}

#[lang = "sized"]
trait Sized {}
extern crate minicore;
use minicore::*;

// CHECK-LABEL: ttbr0_el2:
#[no_mangle]
Expand Down
20 changes: 4 additions & 16 deletions tests/assembly/asm/aarch64-modifiers.rs
Original file line number Diff line number Diff line change
@@ -1,29 +1,17 @@
//@ add-core-stubs
//@ assembly-output: emit-asm
//@ compile-flags: -O -C panic=abort
//@ compile-flags: --target aarch64-unknown-linux-gnu
//@ compile-flags: -Zmerge-functions=disabled
//@ needs-llvm-components: aarch64

#![feature(no_core, lang_items, rustc_attrs)]
#![feature(no_core)]
#![crate_type = "rlib"]
#![no_core]
#![allow(asm_sub_register)]

#[rustc_builtin_macro]
macro_rules! asm {
() => {};
}
#[rustc_builtin_macro]
macro_rules! stringify {
() => {};
}

#[lang = "sized"]
trait Sized {}
#[lang = "copy"]
trait Copy {}

impl Copy for i32 {}
extern crate minicore;
use minicore::*;

macro_rules! check {
($func:ident $reg:ident $code:literal) => {
Expand Down
36 changes: 5 additions & 31 deletions tests/assembly/asm/aarch64-types.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//@ add-core-stubs
//@ revisions: aarch64 arm64ec
//@ assembly-output: emit-asm
//@ [aarch64] compile-flags: --target aarch64-unknown-linux-gnu
Expand All @@ -6,33 +7,15 @@
//@ [arm64ec] needs-llvm-components: aarch64
//@ compile-flags: -Zmerge-functions=disabled

#![feature(no_core, lang_items, rustc_attrs, repr_simd, f16, f128)]
#![feature(no_core, repr_simd, f16, f128)]
#![crate_type = "rlib"]
#![no_core]
#![allow(asm_sub_register, non_camel_case_types)]
// FIXME(f16_f128): Only needed for FIXME in check! and check_reg!
#![feature(auto_traits)]
#![feature(auto_traits, lang_items)]

#[rustc_builtin_macro]
macro_rules! asm {
() => {};
}
#[rustc_builtin_macro]
macro_rules! concat {
() => {};
}
#[rustc_builtin_macro]
macro_rules! stringify {
() => {};
}

#[lang = "sized"]
trait Sized {}
#[lang = "copy"]
trait Copy {}

// Do we really need to use no_core for this?!?
impl<T: Copy, const N: usize> Copy for [T; N] {}
extern crate minicore;
use minicore::*;

type ptr = *mut u8;

Expand Down Expand Up @@ -65,15 +48,6 @@ pub struct f32x4([f32; 4]);
#[repr(simd)]
pub struct f64x2([f64; 2]);

impl Copy for i8 {}
impl Copy for i16 {}
impl Copy for f16 {}
impl Copy for i32 {}
impl Copy for f32 {}
impl Copy for i64 {}
impl Copy for f64 {}
impl Copy for f128 {}
impl Copy for ptr {}
impl Copy for i8x8 {}
impl Copy for i16x4 {}
impl Copy for i32x2 {}
Expand Down
28 changes: 4 additions & 24 deletions tests/assembly/asm/arm-modifiers.rs
Original file line number Diff line number Diff line change
@@ -1,42 +1,22 @@
//@ add-core-stubs
//@ assembly-output: emit-asm
//@ compile-flags: -O -C panic=abort
//@ compile-flags: --target armv7-unknown-linux-gnueabihf
//@ compile-flags: -C target-feature=+neon
//@ compile-flags: -Zmerge-functions=disabled
//@ needs-llvm-components: arm

#![feature(no_core, lang_items, rustc_attrs, repr_simd)]
#![feature(no_core, repr_simd)]
#![crate_type = "rlib"]
#![no_core]
#![allow(asm_sub_register, non_camel_case_types)]

#[rustc_builtin_macro]
macro_rules! asm {
() => {};
}
#[rustc_builtin_macro]
macro_rules! concat {
() => {};
}
#[rustc_builtin_macro]
macro_rules! stringify {
() => {};
}

#[lang = "sized"]
trait Sized {}
#[lang = "copy"]
trait Copy {}

// Do we really need to use no_core for this?!?
impl<T: Copy, const N: usize> Copy for [T; N] {}
extern crate minicore;
use minicore::*;

#[repr(simd)]
pub struct f32x4([f32; 4]);

impl Copy for i32 {}
impl Copy for f32 {}
impl Copy for f64 {}
impl Copy for f32x4 {}

macro_rules! check {
Expand Down
33 changes: 4 additions & 29 deletions tests/assembly/asm/arm-types.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//@ add-core-stubs
//@ revisions: base d32 neon
//@ assembly-output: emit-asm
//@ compile-flags: --target armv7-unknown-linux-gnueabihf
Expand All @@ -8,31 +9,13 @@
//@[neon] filecheck-flags: --check-prefix d32
//@ needs-llvm-components: arm

#![feature(no_core, lang_items, rustc_attrs, repr_simd, f16)]
#![feature(no_core, repr_simd, f16)]
#![crate_type = "rlib"]
#![no_core]
#![allow(asm_sub_register, non_camel_case_types)]

#[rustc_builtin_macro]
macro_rules! asm {
() => {};
}
#[rustc_builtin_macro]
macro_rules! concat {
() => {};
}
#[rustc_builtin_macro]
macro_rules! stringify {
() => {};
}

#[lang = "sized"]
trait Sized {}
#[lang = "copy"]
trait Copy {}

// Do we really need to use no_core for this?!?
impl<T: Copy, const N: usize> Copy for [T; N] {}
extern crate minicore;
use minicore::*;

type ptr = *mut u8;

Expand Down Expand Up @@ -61,14 +44,6 @@ pub struct f16x8([f16; 8]);
#[repr(simd)]
pub struct f32x4([f32; 4]);

impl Copy for i8 {}
impl Copy for i16 {}
impl Copy for i32 {}
impl Copy for f16 {}
impl Copy for f32 {}
impl Copy for i64 {}
impl Copy for f64 {}
impl Copy for ptr {}
impl Copy for i8x8 {}
impl Copy for i16x4 {}
impl Copy for i32x2 {}
Expand Down
24 changes: 4 additions & 20 deletions tests/assembly/asm/avr-modifiers.rs
Original file line number Diff line number Diff line change
@@ -1,34 +1,18 @@
//@ add-core-stubs
//@ assembly-output: emit-asm
//@ compile-flags: --target avr-unknown-gnu-atmega328
//@ needs-llvm-components: avr

#![feature(no_core, lang_items, rustc_attrs, asm_experimental_arch)]
#![feature(no_core, asm_experimental_arch)]
#![crate_type = "rlib"]
#![no_core]
#![allow(non_camel_case_types)]

#[rustc_builtin_macro]
macro_rules! asm {
() => {};
}
#[rustc_builtin_macro]
macro_rules! concat {
() => {};
}

#[lang = "sized"]
trait Sized {}
#[lang = "copy"]
trait Copy {}
extern crate minicore;
use minicore::*;

type ptr = *const u64;

impl Copy for i8 {}
impl Copy for i16 {}
impl Copy for i32 {}
impl Copy for i64 {}
impl Copy for ptr {}

macro_rules! check {
($func:ident $hi:literal $lo:literal $reg:tt) => {
#[no_mangle]
Expand Down
24 changes: 4 additions & 20 deletions tests/assembly/asm/avr-types.rs
Original file line number Diff line number Diff line change
@@ -1,34 +1,18 @@
//@ add-core-stubs
//@ assembly-output: emit-asm
//@ compile-flags: --target avr-unknown-gnu-atmega328
//@ needs-llvm-components: avr

#![feature(no_core, lang_items, rustc_attrs, asm_experimental_arch)]
#![feature(no_core, asm_experimental_arch)]
#![crate_type = "rlib"]
#![no_core]
#![allow(non_camel_case_types)]

#[rustc_builtin_macro]
macro_rules! asm {
() => {};
}
#[rustc_builtin_macro]
macro_rules! concat {
() => {};
}

#[lang = "sized"]
trait Sized {}
#[lang = "copy"]
trait Copy {}
extern crate minicore;
use minicore::*;

type ptr = *const u64;

impl Copy for i8 {}
impl Copy for i16 {}
impl Copy for i32 {}
impl Copy for i64 {}
impl Copy for ptr {}

macro_rules! check {
($func:ident $ty:ident $class:ident) => {
#[no_mangle]
Expand Down
28 changes: 4 additions & 24 deletions tests/assembly/asm/bpf-types.rs
Original file line number Diff line number Diff line change
@@ -1,38 +1,18 @@
//@ add-core-stubs
//@ assembly-output: emit-asm
//@ compile-flags: --target bpfel-unknown-none -C target_feature=+alu32
//@ needs-llvm-components: bpf

#![feature(no_core, lang_items, rustc_attrs, repr_simd, asm_experimental_arch)]
#![feature(no_core, asm_experimental_arch)]
#![crate_type = "rlib"]
#![no_core]
#![allow(asm_sub_register, non_camel_case_types)]

#[rustc_builtin_macro]
macro_rules! asm {
() => {};
}
#[rustc_builtin_macro]
macro_rules! concat {
() => {};
}
#[rustc_builtin_macro]
macro_rules! stringify {
() => {};
}

#[lang = "sized"]
trait Sized {}
#[lang = "copy"]
trait Copy {}
extern crate minicore;
use minicore::*;

type ptr = *const u64;

impl Copy for i8 {}
impl Copy for i16 {}
impl Copy for i32 {}
impl Copy for i64 {}
impl Copy for ptr {}

macro_rules! check {
($func:ident $ty:ident $class:ident) => {
#[no_mangle]
Expand Down
27 changes: 4 additions & 23 deletions tests/assembly/asm/hexagon-types.rs
Original file line number Diff line number Diff line change
@@ -1,38 +1,19 @@
//@ add-core-stubs
//@ assembly-output: emit-asm
//@ compile-flags: --target hexagon-unknown-linux-musl
//@ compile-flags: -Zmerge-functions=disabled
//@ needs-llvm-components: hexagon

#![feature(no_core, lang_items, rustc_attrs, repr_simd, asm_experimental_arch)]
#![feature(no_core, asm_experimental_arch)]
#![crate_type = "rlib"]
#![no_core]
#![allow(asm_sub_register, non_camel_case_types)]

#[rustc_builtin_macro]
macro_rules! asm {
() => {};
}
#[rustc_builtin_macro]
macro_rules! concat {
() => {};
}
#[rustc_builtin_macro]
macro_rules! stringify {
() => {};
}

#[lang = "sized"]
trait Sized {}
#[lang = "copy"]
trait Copy {}
extern crate minicore;
use minicore::*;

type ptr = *const i32;

impl Copy for i8 {}
impl Copy for i16 {}
impl Copy for i32 {}
impl Copy for f32 {}
impl Copy for ptr {}
extern "C" {
fn extern_func();
static extern_static: u8;
Expand Down
Loading

0 comments on commit be1dffa

Please sign in to comment.