Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit e20646c

Browse files
committedDec 17, 2024·
tests/assembly/asm: Remove uses of rustc_attrs and lang_items features by using minicore
1 parent f23a80a commit e20646c

22 files changed

+108
-487
lines changed
 

‎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]

‎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) => {

‎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 {}

‎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 {

‎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 {}

‎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]

‎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]

‎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]

‎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;

‎tests/assembly/asm/loongarch-type.rs

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

6-
#![feature(no_core, lang_items, rustc_attrs)]
7+
#![feature(no_core)]
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 i64 {}
35-
impl Copy for f32 {}
36-
impl Copy for f64 {}
37-
impl Copy for ptr {}
3817
extern "C" {
3918
fn extern_func();
4019
static extern_static: u8;

‎tests/assembly/asm/m68k-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 m68k-unknown-linux-gnu
34
//@ needs-llvm-components: m68k
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 $mov:literal) => {
3418
#[no_mangle]

‎tests/assembly/asm/mips-types.rs

+4-26
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//@ add-core-stubs
12
//@ revisions: mips32 mips64
23
//@ assembly-output: emit-asm
34
//@[mips32] compile-flags: --target mips-unknown-linux-gnu
@@ -6,39 +7,16 @@
67
//@[mips64] needs-llvm-components: mips
78
//@ compile-flags: -Zmerge-functions=disabled
89

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

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

3218
type ptr = *const i32;
3319

34-
impl Copy for i8 {}
35-
impl Copy for u8 {}
36-
impl Copy for i16 {}
37-
impl Copy for i32 {}
38-
impl Copy for i64 {}
39-
impl Copy for f32 {}
40-
impl Copy for f64 {}
41-
impl Copy for ptr {}
4220
extern "C" {
4321
fn extern_func();
4422
static extern_static: u8;

‎tests/assembly/asm/msp430-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 msp430-none-elf
34
//@ needs-llvm-components: msp430
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 i16;
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]

‎tests/assembly/asm/nvptx-types.rs

+4-22
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,17 @@
1+
//@ add-core-stubs
12
//@ assembly-output: emit-asm
23
//@ compile-flags: --target nvptx64-nvidia-cuda
34
//@ compile-flags: --crate-type cdylib
45
//@ needs-llvm-components: nvptx
56

6-
#![feature(no_core, lang_items, rustc_attrs, asm_experimental_arch)]
7+
#![feature(no_core, asm_experimental_arch)]
78
#![no_core]
89

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

2313
type ptr = *mut u8;
2414

25-
impl Copy for i8 {}
26-
impl Copy for i16 {}
27-
impl Copy for i32 {}
28-
impl Copy for f32 {}
29-
impl Copy for i64 {}
30-
impl Copy for f64 {}
31-
impl Copy for ptr {}
32-
3315
// NVPTX does not support static variables
3416
#[no_mangle]
3517
fn extern_func() {}

‎tests/assembly/asm/powerpc-types.rs

+5-29
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//@ add-core-stubs
12
//@ revisions: powerpc powerpc_altivec powerpc_vsx powerpc64 powerpc64_vsx
23
//@ assembly-output: emit-asm
34
//@[powerpc] compile-flags: --target powerpc-unknown-linux-gnu
@@ -12,38 +13,21 @@
1213
//@[powerpc64_vsx] needs-llvm-components: powerpc
1314
//@ compile-flags: -Zmerge-functions=disabled
1415

15-
#![feature(no_core, lang_items, rustc_attrs, repr_simd, asm_experimental_arch)]
16+
#![feature(no_core, repr_simd, asm_experimental_arch)]
1617
#![crate_type = "rlib"]
1718
#![no_core]
1819
#![allow(asm_sub_register, non_camel_case_types)]
1920

21+
extern crate minicore;
22+
use minicore::*;
23+
2024
#[cfg_attr(altivec, cfg(not(target_feature = "altivec")))]
2125
#[cfg_attr(not(altivec), cfg(target_feature = "altivec"))]
2226
compile_error!("altivec cfg and target feature mismatch");
2327
#[cfg_attr(vsx, cfg(not(target_feature = "vsx")))]
2428
#[cfg_attr(not(vsx), cfg(target_feature = "vsx"))]
2529
compile_error!("vsx cfg and target feature mismatch");
2630

27-
#[rustc_builtin_macro]
28-
macro_rules! asm {
29-
() => {};
30-
}
31-
#[rustc_builtin_macro]
32-
macro_rules! concat {
33-
() => {};
34-
}
35-
#[rustc_builtin_macro]
36-
macro_rules! stringify {
37-
() => {};
38-
}
39-
40-
#[lang = "sized"]
41-
trait Sized {}
42-
#[lang = "copy"]
43-
trait Copy {}
44-
45-
impl<T: Copy, const N: usize> Copy for [T; N] {}
46-
4731
type ptr = *const i32;
4832

4933
#[repr(simd)]
@@ -59,14 +43,6 @@ pub struct f32x4([f32; 4]);
5943
#[repr(simd)]
6044
pub struct f64x2([f64; 2]);
6145

62-
impl Copy for i8 {}
63-
impl Copy for u8 {}
64-
impl Copy for i16 {}
65-
impl Copy for i32 {}
66-
impl Copy for i64 {}
67-
impl Copy for f32 {}
68-
impl Copy for f64 {}
69-
impl Copy for ptr {}
7046
impl Copy for i8x16 {}
7147
impl Copy for i16x8 {}
7248
impl Copy for i32x4 {}

‎tests/assembly/asm/riscv-types.rs

+4-27
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//@ add-core-stubs
12
//@ revisions: riscv64 riscv32 riscv64-zfhmin riscv32-zfhmin riscv64-zfh riscv32-zfh
23
//@ assembly-output: emit-asm
34

@@ -29,40 +30,16 @@
2930
//@ compile-flags: -C target-feature=+d
3031
//@ compile-flags: -Zmerge-functions=disabled
3132

32-
#![feature(no_core, lang_items, rustc_attrs, f16)]
33+
#![feature(no_core, f16)]
3334
#![crate_type = "rlib"]
3435
#![no_core]
3536
#![allow(asm_sub_register)]
3637

37-
#[rustc_builtin_macro]
38-
macro_rules! asm {
39-
() => {};
40-
}
41-
#[rustc_builtin_macro]
42-
macro_rules! concat {
43-
() => {};
44-
}
45-
#[rustc_builtin_macro]
46-
macro_rules! stringify {
47-
() => {};
48-
}
49-
50-
#[lang = "sized"]
51-
trait Sized {}
52-
#[lang = "copy"]
53-
trait Copy {}
38+
extern crate minicore;
39+
use minicore::*;
5440

5541
type ptr = *mut u8;
5642

57-
impl Copy for i8 {}
58-
impl Copy for i16 {}
59-
impl Copy for f16 {}
60-
impl Copy for i32 {}
61-
impl Copy for f32 {}
62-
impl Copy for i64 {}
63-
impl Copy for f64 {}
64-
impl Copy for ptr {}
65-
6643
extern "C" {
6744
fn extern_func();
6845
static extern_static: u8;

‎tests/assembly/asm/s390x-types.rs

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

9-
#![feature(no_core, lang_items, rustc_attrs, repr_simd, f128)]
10+
#![feature(no_core, repr_simd, f128)]
1011
#![cfg_attr(s390x_vector, feature(asm_experimental_reg))]
1112
#![crate_type = "rlib"]
1213
#![no_core]
1314
#![allow(asm_sub_register, non_camel_case_types)]
1415

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

3519
type ptr = *const i32;
3620

@@ -47,16 +31,6 @@ pub struct f32x4([f32; 4]);
4731
#[repr(simd)]
4832
pub struct f64x2([f64; 2]);
4933

50-
impl Copy for i8 {}
51-
impl Copy for u8 {}
52-
impl Copy for i16 {}
53-
impl Copy for i32 {}
54-
impl Copy for i64 {}
55-
impl Copy for i128 {}
56-
impl Copy for f32 {}
57-
impl Copy for f64 {}
58-
impl Copy for f128 {}
59-
impl Copy for ptr {}
6034
impl Copy for i8x16 {}
6135
impl Copy for i16x8 {}
6236
impl Copy for i32x4 {}

‎tests/assembly/asm/sparc-types.rs

+4-27
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//@ add-core-stubs
12
//@ revisions: sparc sparcv8plus sparc64
23
//@ assembly-output: emit-asm
34
//@[sparc] compile-flags: --target sparc-unknown-none-elf
@@ -8,40 +9,16 @@
89
//@[sparc64] needs-llvm-components: sparc
910
//@ compile-flags: -Zmerge-functions=disabled
1011

11-
#![feature(no_core, lang_items, rustc_attrs, repr_simd, asm_experimental_arch)]
12+
#![feature(no_core, asm_experimental_arch)]
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 {}
17+
extern crate minicore;
18+
use minicore::*;
3319

3420
type ptr = *const i32;
3521

36-
impl Copy for i8 {}
37-
impl Copy for u8 {}
38-
impl Copy for i16 {}
39-
impl Copy for i32 {}
40-
impl Copy for i64 {}
41-
impl Copy for f32 {}
42-
impl Copy for f64 {}
43-
impl Copy for ptr {}
44-
4522
extern "C" {
4623
fn extern_func();
4724
static extern_static: u8;

‎tests/assembly/asm/wasm-types.rs

+4-22
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,17 @@
1+
//@ add-core-stubs
12
//@ assembly-output: emit-asm
23
//@ compile-flags: --target wasm32-unknown-unknown
34
//@ compile-flags: --crate-type cdylib
45
//@ needs-llvm-components: webassembly
56

6-
#![feature(no_core, lang_items, rustc_attrs, asm_experimental_arch)]
7+
#![feature(no_core, asm_experimental_arch)]
78
#![no_core]
89

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

2313
type ptr = *mut u8;
2414

25-
impl Copy for i8 {}
26-
impl Copy for i16 {}
27-
impl Copy for i32 {}
28-
impl Copy for f32 {}
29-
impl Copy for i64 {}
30-
impl Copy for f64 {}
31-
impl Copy for ptr {}
32-
3315
extern "C" {
3416
fn extern_func();
3517
static extern_static: u8;

‎tests/assembly/asm/x86-modifiers.rs

+4-20
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//@ add-core-stubs
12
//@ revisions: x86_64 i686
23
//@ assembly-output: emit-asm
34
//@ compile-flags: -O -C panic=abort
@@ -9,30 +10,13 @@
910
//@ compile-flags: -C target-feature=+avx512bw
1011
//@ compile-flags: -Zmerge-functions=disabled
1112

12-
#![feature(no_core, lang_items, rustc_attrs)]
13+
#![feature(no_core)]
1314
#![crate_type = "rlib"]
1415
#![no_core]
1516
#![allow(asm_sub_register)]
1617

17-
#[rustc_builtin_macro]
18-
macro_rules! asm {
19-
() => {};
20-
}
21-
#[rustc_builtin_macro]
22-
macro_rules! concat {
23-
() => {};
24-
}
25-
#[rustc_builtin_macro]
26-
macro_rules! stringify {
27-
() => {};
28-
}
29-
30-
#[lang = "sized"]
31-
trait Sized {}
32-
#[lang = "copy"]
33-
trait Copy {}
34-
35-
impl Copy for i32 {}
18+
extern crate minicore;
19+
use minicore::*;
3620

3721
macro_rules! check {
3822
($func:ident $modifier:literal $reg:ident $mov:literal) => {

‎tests/assembly/asm/x86-types.rs

+4-22
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//@ add-core-stubs
12
//@ revisions: x86_64 i686
23
//@ assembly-output: emit-asm
34
//@[x86_64] compile-flags: --target x86_64-unknown-linux-gnu
@@ -8,31 +9,13 @@
89
//@ compile-flags: -C target-feature=+avx512bw
910
//@ compile-flags: -Zmerge-functions=disabled
1011

11-
#![feature(no_core, lang_items, rustc_attrs, repr_simd, f16, f128)]
12+
#![feature(no_core, repr_simd, f16, f128)]
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

@@ -90,7 +73,6 @@ macro_rules! impl_copy {
9073
}
9174

9275
impl_copy!(
93-
i8 i16 f16 i32 f32 i64 f64 f128 ptr
9476
i8x16 i16x8 i32x4 i64x2 f16x8 f32x4 f64x2
9577
i8x32 i16x16 i32x8 i64x4 f16x16 f32x8 f64x4
9678
i8x64 i16x32 i32x16 i64x8 f16x32 f32x16 f64x8

‎tests/auxiliary/minicore.rs

+22-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
//! <https://github.com/rust-lang/rust/blob/c0b5cc9003f6464c11ae1c0662c6a7e06f6f5cab/compiler/rustc_codegen_cranelift/example/mini_core.rs>.
1515
// ignore-tidy-linelength
1616

17-
#![feature(no_core, lang_items, rustc_attrs, decl_macro, naked_functions)]
17+
#![feature(no_core, lang_items, rustc_attrs, decl_macro, naked_functions, f16, f128)]
1818
#![allow(unused, improper_ctypes_definitions, internal_features)]
1919
#![feature(asm_experimental_arch)]
2020
#![no_std]
@@ -40,7 +40,12 @@ impl<T: ?Sized> LegacyReceiver for &mut T {}
4040
pub trait Copy: Sized {}
4141

4242
impl_marker_trait!(
43-
Copy => [ bool, char, isize, usize, i8, i16, i32, i64, u8, u16, u32, u64, f32, f64 ]
43+
Copy => [
44+
bool, char,
45+
isize, i8, i16, i32, i64, i128,
46+
usize, u8, u16, u32, u64, u128,
47+
f16, f32, f64, f128,
48+
]
4449
);
4550
impl<'a, T: ?Sized> Copy for &'a T {}
4651
impl<T: ?Sized> Copy for *const T {}
@@ -88,3 +93,18 @@ pub macro naked_asm("assembly template", $(operands,)* $(options($(option),*))?)
8893
pub macro global_asm("assembly template", $(operands,)* $(options($(option),*))?) {
8994
/* compiler built-in */
9095
}
96+
97+
#[rustc_builtin_macro]
98+
#[macro_export]
99+
macro_rules! concat {
100+
($($e:expr),* $(,)?) => {
101+
/* compiler built-in */
102+
};
103+
}
104+
#[rustc_builtin_macro]
105+
#[macro_export]
106+
macro_rules! stringify {
107+
($($t:tt)*) => {
108+
/* compiler built-in */
109+
};
110+
}

0 commit comments

Comments
 (0)
Please sign in to comment.