Skip to content

Commit fb85ff8

Browse files
authored
Rollup merge of rust-lang#134562 - taiki-e:codegen-asm-minicore, r=jieyouxu
tests/codegen/asm: Remove uses of rustc_attrs and lang_items features by using minicore Similar to rust-lang#134385 (for tests/ui/asm) and rust-lang#134436 (for tests/assembly/asm), but for tests/codegen/asm. r? jieyouxu
2 parents 34604dd + 96edf41 commit fb85ff8

9 files changed

+36
-74
lines changed

tests/codegen/asm/aarch64-clobbers.rs

+4-8
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//@ add-core-stubs
12
//@ revisions: aarch64 aarch64_fixed_x18 aarch64_no_x18 aarch64_reserve_x18 arm64ec
23
//@[aarch64] compile-flags: --target aarch64-unknown-linux-gnu
34
//@[aarch64] needs-llvm-components: aarch64
@@ -14,16 +15,11 @@
1415
// ignore-tidy-linelength
1516

1617
#![crate_type = "rlib"]
17-
#![feature(no_core, rustc_attrs, lang_items)]
18+
#![feature(no_core)]
1819
#![no_core]
1920

20-
#[lang = "sized"]
21-
trait Sized {}
22-
23-
#[rustc_builtin_macro]
24-
macro_rules! asm {
25-
() => {};
26-
}
21+
extern crate minicore;
22+
use minicore::*;
2723

2824
// CHECK-LABEL: @cc_clobber
2925
// CHECK: call void asm sideeffect "", "~{cc}"()

tests/codegen/asm/avr-clobbers.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 avr-unknown-gnu-atmega328
34
//@ needs-llvm-components: avr
45

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

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

1713
// CHECK-LABEL: @sreg_is_clobbered
1814
// CHECK: void asm sideeffect "", "~{sreg}"()

tests/codegen/asm/hexagon-clobbers.rs

+4-8
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,15 @@
1+
//@ add-core-stubs
12
//@ revisions: hexagon
23
//@[hexagon] compile-flags: --target hexagon-unknown-linux-musl
34
//@[hexagon] needs-llvm-components: hexagon
45
//@ compile-flags: -Zmerge-functions=disabled
56

67
#![crate_type = "rlib"]
7-
#![feature(no_core, rustc_attrs, lang_items, asm_experimental_arch)]
8+
#![feature(no_core, asm_experimental_arch)]
89
#![no_core]
910

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

1814
// CHECK-LABEL: @flags_clobber
1915
// CHECK: call void asm sideeffect "", ""()

tests/codegen/asm/msp430-clobbers.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 msp430-none-elf
34
//@ needs-llvm-components: msp430
45

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

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

1713
// CHECK-LABEL: @sr_clobber
1814
// CHECK: call void asm sideeffect "", "~{sr}"()

tests/codegen/asm/powerpc-clobbers.rs

+4-8
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//@ add-core-stubs
12
//@ revisions: powerpc powerpc64 powerpc64le aix64
23
//@[powerpc] compile-flags: --target powerpc-unknown-linux-gnu
34
//@[powerpc] needs-llvm-components: powerpc
@@ -10,16 +11,11 @@
1011
// ignore-tidy-linelength
1112

1213
#![crate_type = "rlib"]
13-
#![feature(no_core, rustc_attrs, lang_items, asm_experimental_arch)]
14+
#![feature(no_core, asm_experimental_arch)]
1415
#![no_core]
1516

16-
#[lang = "sized"]
17-
trait Sized {}
18-
19-
#[rustc_builtin_macro]
20-
macro_rules! asm {
21-
() => {};
22-
}
17+
extern crate minicore;
18+
use minicore::*;
2319

2420
// CHECK-LABEL: @cr_clobber
2521
// CHECK: call void asm sideeffect "", "~{cr}"()

tests/codegen/asm/riscv-clobbers.rs

+4-8
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//@ add-core-stubs
12
//@ assembly-output: emit-asm
23
//@ revisions: rv32i rv64i rv32e
34
//@[rv32i] compile-flags: --target riscv32i-unknown-none-elf
@@ -9,16 +10,11 @@
910
// ignore-tidy-linelength
1011

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

15-
#[lang = "sized"]
16-
trait Sized {}
17-
18-
#[rustc_builtin_macro]
19-
macro_rules! asm {
20-
() => {};
21-
}
16+
extern crate minicore;
17+
use minicore::*;
2218

2319
// CHECK-LABEL: @flags_clobber
2420
// CHECK: call void asm sideeffect "", "~{vtype},~{vl},~{vxsat},~{vxrm}"()

tests/codegen/asm/s390x-clobbers.rs

+4-8
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,14 @@
1+
//@ add-core-stubs
12
//@ revisions: s390x
23
//@[s390x] compile-flags: --target s390x-unknown-linux-gnu
34
//@[s390x] needs-llvm-components: systemz
45

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

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

1713
// CHECK-LABEL: @cc_clobber
1814
// CHECK: call void asm sideeffect "", "~{cc}"()

tests/codegen/asm/sanitize-llvm.rs

+4-10
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,17 @@
1+
//@ add-core-stubs
12
// FIXME(nagisa): remove the flags below once all targets support `asm!`.
23
//@ compile-flags: --target x86_64-unknown-linux-gnu -Copt-level=0
34
//@ needs-llvm-components: x86
45

56
// Verify we sanitize the special tokens for the LLVM inline-assembly, ensuring people won't
67
// inadvertently rely on the LLVM-specific syntax and features.
78
#![no_core]
8-
#![feature(no_core, lang_items, rustc_attrs)]
9+
#![feature(no_core)]
910
#![crate_type = "rlib"]
1011
#![allow(named_asm_labels)]
1112

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

2216
pub unsafe fn we_escape_dollar_signs() {
2317
// CHECK: call void asm sideeffect alignstack inteldialect "banana$$:"

tests/codegen/asm/sparc-clobbers.rs

+4-8
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//@ add-core-stubs
12
//@ revisions: sparc sparcv8plus sparc64
23
//@[sparc] compile-flags: --target sparc-unknown-none-elf
34
//@[sparc] needs-llvm-components: sparc
@@ -7,16 +8,11 @@
78
//@[sparc64] needs-llvm-components: sparc
89

910
#![crate_type = "rlib"]
10-
#![feature(no_core, rustc_attrs, lang_items, asm_experimental_arch)]
11+
#![feature(no_core, asm_experimental_arch)]
1112
#![no_core]
1213

13-
#[lang = "sized"]
14-
trait Sized {}
15-
16-
#[rustc_builtin_macro]
17-
macro_rules! asm {
18-
() => {};
19-
}
14+
extern crate minicore;
15+
use minicore::*;
2016

2117
// CHECK-LABEL: @cc_clobber
2218
// CHECK: call void asm sideeffect "", "~{icc},~{fcc0},~{fcc1},~{fcc2},~{fcc3}"()

0 commit comments

Comments
 (0)