Skip to content

Commit af96692

Browse files
authored
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
2 parents 099faa8 + bd7213f commit af96692

22 files changed

+110
-489
lines changed

Diff for: tests/assembly/asm/aarch64-el2vmsa.rs

+4-8
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,14 @@
1+
//@ add-core-stubs
12
//@ assembly-output: emit-asm
23
//@ compile-flags: --target aarch64-unknown-linux-gnu
34
//@ needs-llvm-components: aarch64
45

5-
#![feature(no_core, lang_items, rustc_attrs)]
6+
#![feature(no_core)]
67
#![crate_type = "rlib"]
78
#![no_core]
89

9-
#[rustc_builtin_macro]
10-
macro_rules! asm {
11-
() => {};
12-
}
13-
14-
#[lang = "sized"]
15-
trait Sized {}
10+
extern crate minicore;
11+
use minicore::*;
1612

1713
// CHECK-LABEL: ttbr0_el2:
1814
#[no_mangle]

Diff for: tests/assembly/asm/aarch64-modifiers.rs

+4-16
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,17 @@
1+
//@ add-core-stubs
12
//@ assembly-output: emit-asm
23
//@ compile-flags: -O -C panic=abort
34
//@ compile-flags: --target aarch64-unknown-linux-gnu
45
//@ compile-flags: -Zmerge-functions=disabled
56
//@ needs-llvm-components: aarch64
67

7-
#![feature(no_core, lang_items, rustc_attrs)]
8+
#![feature(no_core)]
89
#![crate_type = "rlib"]
910
#![no_core]
1011
#![allow(asm_sub_register)]
1112

12-
#[rustc_builtin_macro]
13-
macro_rules! asm {
14-
() => {};
15-
}
16-
#[rustc_builtin_macro]
17-
macro_rules! stringify {
18-
() => {};
19-
}
20-
21-
#[lang = "sized"]
22-
trait Sized {}
23-
#[lang = "copy"]
24-
trait Copy {}
25-
26-
impl Copy for i32 {}
13+
extern crate minicore;
14+
use minicore::*;
2715

2816
macro_rules! check {
2917
($func:ident $reg:ident $code:literal) => {

Diff for: tests/assembly/asm/aarch64-types.rs

+5-31
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//@ add-core-stubs
12
//@ revisions: aarch64 arm64ec
23
//@ assembly-output: emit-asm
34
//@ [aarch64] compile-flags: --target aarch64-unknown-linux-gnu
@@ -6,33 +7,15 @@
67
//@ [arm64ec] needs-llvm-components: aarch64
78
//@ compile-flags: -Zmerge-functions=disabled
89

9-
#![feature(no_core, lang_items, rustc_attrs, repr_simd, f16, f128)]
10+
#![feature(no_core, repr_simd, f16, f128)]
1011
#![crate_type = "rlib"]
1112
#![no_core]
1213
#![allow(asm_sub_register, non_camel_case_types)]
1314
// FIXME(f16_f128): Only needed for FIXME in check! and check_reg!
14-
#![feature(auto_traits)]
15+
#![feature(auto_traits, lang_items)]
1516

16-
#[rustc_builtin_macro]
17-
macro_rules! asm {
18-
() => {};
19-
}
20-
#[rustc_builtin_macro]
21-
macro_rules! concat {
22-
() => {};
23-
}
24-
#[rustc_builtin_macro]
25-
macro_rules! stringify {
26-
() => {};
27-
}
28-
29-
#[lang = "sized"]
30-
trait Sized {}
31-
#[lang = "copy"]
32-
trait Copy {}
33-
34-
// Do we really need to use no_core for this?!?
35-
impl<T: Copy, const N: usize> Copy for [T; N] {}
17+
extern crate minicore;
18+
use minicore::*;
3619

3720
type ptr = *mut u8;
3821

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

68-
impl Copy for i8 {}
69-
impl Copy for i16 {}
70-
impl Copy for f16 {}
71-
impl Copy for i32 {}
72-
impl Copy for f32 {}
73-
impl Copy for i64 {}
74-
impl Copy for f64 {}
75-
impl Copy for f128 {}
76-
impl Copy for ptr {}
7751
impl Copy for i8x8 {}
7852
impl Copy for i16x4 {}
7953
impl Copy for i32x2 {}

Diff for: tests/assembly/asm/arm-modifiers.rs

+4-24
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,22 @@
1+
//@ add-core-stubs
12
//@ assembly-output: emit-asm
23
//@ compile-flags: -O -C panic=abort
34
//@ compile-flags: --target armv7-unknown-linux-gnueabihf
45
//@ compile-flags: -C target-feature=+neon
56
//@ compile-flags: -Zmerge-functions=disabled
67
//@ needs-llvm-components: arm
78

8-
#![feature(no_core, lang_items, rustc_attrs, repr_simd)]
9+
#![feature(no_core, repr_simd)]
910
#![crate_type = "rlib"]
1011
#![no_core]
1112
#![allow(asm_sub_register, non_camel_case_types)]
1213

13-
#[rustc_builtin_macro]
14-
macro_rules! asm {
15-
() => {};
16-
}
17-
#[rustc_builtin_macro]
18-
macro_rules! concat {
19-
() => {};
20-
}
21-
#[rustc_builtin_macro]
22-
macro_rules! stringify {
23-
() => {};
24-
}
25-
26-
#[lang = "sized"]
27-
trait Sized {}
28-
#[lang = "copy"]
29-
trait Copy {}
30-
31-
// Do we really need to use no_core for this?!?
32-
impl<T: Copy, const N: usize> Copy for [T; N] {}
14+
extern crate minicore;
15+
use minicore::*;
3316

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

37-
impl Copy for i32 {}
38-
impl Copy for f32 {}
39-
impl Copy for f64 {}
4020
impl Copy for f32x4 {}
4121

4222
macro_rules! check {

Diff for: tests/assembly/asm/arm-types.rs

+4-29
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//@ add-core-stubs
12
//@ revisions: base d32 neon
23
//@ assembly-output: emit-asm
34
//@ compile-flags: --target armv7-unknown-linux-gnueabihf
@@ -8,31 +9,13 @@
89
//@[neon] filecheck-flags: --check-prefix d32
910
//@ needs-llvm-components: arm
1011

11-
#![feature(no_core, lang_items, rustc_attrs, repr_simd, f16)]
12+
#![feature(no_core, repr_simd, f16)]
1213
#![crate_type = "rlib"]
1314
#![no_core]
1415
#![allow(asm_sub_register, non_camel_case_types)]
1516

16-
#[rustc_builtin_macro]
17-
macro_rules! asm {
18-
() => {};
19-
}
20-
#[rustc_builtin_macro]
21-
macro_rules! concat {
22-
() => {};
23-
}
24-
#[rustc_builtin_macro]
25-
macro_rules! stringify {
26-
() => {};
27-
}
28-
29-
#[lang = "sized"]
30-
trait Sized {}
31-
#[lang = "copy"]
32-
trait Copy {}
33-
34-
// Do we really need to use no_core for this?!?
35-
impl<T: Copy, const N: usize> Copy for [T; N] {}
17+
extern crate minicore;
18+
use minicore::*;
3619

3720
type ptr = *mut u8;
3821

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

64-
impl Copy for i8 {}
65-
impl Copy for i16 {}
66-
impl Copy for i32 {}
67-
impl Copy for f16 {}
68-
impl Copy for f32 {}
69-
impl Copy for i64 {}
70-
impl Copy for f64 {}
71-
impl Copy for ptr {}
7247
impl Copy for i8x8 {}
7348
impl Copy for i16x4 {}
7449
impl Copy for i32x2 {}

Diff for: tests/assembly/asm/avr-modifiers.rs

+4-20
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,18 @@
1+
//@ add-core-stubs
12
//@ assembly-output: emit-asm
23
//@ compile-flags: --target avr-unknown-gnu-atmega328
34
//@ needs-llvm-components: avr
45

5-
#![feature(no_core, lang_items, rustc_attrs, asm_experimental_arch)]
6+
#![feature(no_core, asm_experimental_arch)]
67
#![crate_type = "rlib"]
78
#![no_core]
89
#![allow(non_camel_case_types)]
910

10-
#[rustc_builtin_macro]
11-
macro_rules! asm {
12-
() => {};
13-
}
14-
#[rustc_builtin_macro]
15-
macro_rules! concat {
16-
() => {};
17-
}
18-
19-
#[lang = "sized"]
20-
trait Sized {}
21-
#[lang = "copy"]
22-
trait Copy {}
11+
extern crate minicore;
12+
use minicore::*;
2313

2414
type ptr = *const u64;
2515

26-
impl Copy for i8 {}
27-
impl Copy for i16 {}
28-
impl Copy for i32 {}
29-
impl Copy for i64 {}
30-
impl Copy for ptr {}
31-
3216
macro_rules! check {
3317
($func:ident $hi:literal $lo:literal $reg:tt) => {
3418
#[no_mangle]

Diff for: tests/assembly/asm/avr-types.rs

+4-20
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,18 @@
1+
//@ add-core-stubs
12
//@ assembly-output: emit-asm
23
//@ compile-flags: --target avr-unknown-gnu-atmega328
34
//@ needs-llvm-components: avr
45

5-
#![feature(no_core, lang_items, rustc_attrs, asm_experimental_arch)]
6+
#![feature(no_core, asm_experimental_arch)]
67
#![crate_type = "rlib"]
78
#![no_core]
89
#![allow(non_camel_case_types)]
910

10-
#[rustc_builtin_macro]
11-
macro_rules! asm {
12-
() => {};
13-
}
14-
#[rustc_builtin_macro]
15-
macro_rules! concat {
16-
() => {};
17-
}
18-
19-
#[lang = "sized"]
20-
trait Sized {}
21-
#[lang = "copy"]
22-
trait Copy {}
11+
extern crate minicore;
12+
use minicore::*;
2313

2414
type ptr = *const u64;
2515

26-
impl Copy for i8 {}
27-
impl Copy for i16 {}
28-
impl Copy for i32 {}
29-
impl Copy for i64 {}
30-
impl Copy for ptr {}
31-
3216
macro_rules! check {
3317
($func:ident $ty:ident $class:ident) => {
3418
#[no_mangle]

Diff for: tests/assembly/asm/bpf-types.rs

+4-24
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,18 @@
1+
//@ add-core-stubs
12
//@ assembly-output: emit-asm
23
//@ compile-flags: --target bpfel-unknown-none -C target_feature=+alu32
34
//@ needs-llvm-components: bpf
45

5-
#![feature(no_core, lang_items, rustc_attrs, repr_simd, asm_experimental_arch)]
6+
#![feature(no_core, asm_experimental_arch)]
67
#![crate_type = "rlib"]
78
#![no_core]
89
#![allow(asm_sub_register, non_camel_case_types)]
910

10-
#[rustc_builtin_macro]
11-
macro_rules! asm {
12-
() => {};
13-
}
14-
#[rustc_builtin_macro]
15-
macro_rules! concat {
16-
() => {};
17-
}
18-
#[rustc_builtin_macro]
19-
macro_rules! stringify {
20-
() => {};
21-
}
22-
23-
#[lang = "sized"]
24-
trait Sized {}
25-
#[lang = "copy"]
26-
trait Copy {}
11+
extern crate minicore;
12+
use minicore::*;
2713

2814
type ptr = *const u64;
2915

30-
impl Copy for i8 {}
31-
impl Copy for i16 {}
32-
impl Copy for i32 {}
33-
impl Copy for i64 {}
34-
impl Copy for ptr {}
35-
3616
macro_rules! check {
3717
($func:ident $ty:ident $class:ident) => {
3818
#[no_mangle]

Diff for: tests/assembly/asm/hexagon-types.rs

+4-23
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,19 @@
1+
//@ add-core-stubs
12
//@ assembly-output: emit-asm
23
//@ compile-flags: --target hexagon-unknown-linux-musl
34
//@ compile-flags: -Zmerge-functions=disabled
45
//@ needs-llvm-components: hexagon
56

6-
#![feature(no_core, lang_items, rustc_attrs, repr_simd, asm_experimental_arch)]
7+
#![feature(no_core, asm_experimental_arch)]
78
#![crate_type = "rlib"]
89
#![no_core]
910
#![allow(asm_sub_register, non_camel_case_types)]
1011

11-
#[rustc_builtin_macro]
12-
macro_rules! asm {
13-
() => {};
14-
}
15-
#[rustc_builtin_macro]
16-
macro_rules! concat {
17-
() => {};
18-
}
19-
#[rustc_builtin_macro]
20-
macro_rules! stringify {
21-
() => {};
22-
}
23-
24-
#[lang = "sized"]
25-
trait Sized {}
26-
#[lang = "copy"]
27-
trait Copy {}
12+
extern crate minicore;
13+
use minicore::*;
2814

2915
type ptr = *const i32;
3016

31-
impl Copy for i8 {}
32-
impl Copy for i16 {}
33-
impl Copy for i32 {}
34-
impl Copy for f32 {}
35-
impl Copy for ptr {}
3617
extern "C" {
3718
fn extern_func();
3819
static extern_static: u8;

0 commit comments

Comments
 (0)