Skip to content

Commit c72d443

Browse files
Use core stubs in some CMSE tests
1 parent 6dce9f8 commit c72d443

File tree

3 files changed

+19
-20
lines changed

3 files changed

+19
-20
lines changed

tests/ui/cmse-nonsecure/cmse-nonsecure-call/return-via-stack.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
//@ compile-flags: --target thumbv8m.main-none-eabi --crate-type lib
22
//@ needs-llvm-components: arm
3+
//@ add-core-stubs
4+
35
#![feature(abi_c_cmse_nonsecure_call, no_core, lang_items)]
46
#![no_core]
5-
#[lang = "sized"]
6-
pub trait Sized {}
7-
#[lang = "copy"]
8-
pub trait Copy {}
9-
impl Copy for u32 {}
7+
8+
extern crate minicore;
9+
use minicore::*;
1010

1111
#[repr(C)]
1212
pub struct ReprCU64(u64);

tests/ui/cmse-nonsecure/cmse-nonsecure-entry/return-via-stack.rs

+5-6
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
//@ compile-flags: --target thumbv8m.main-none-eabi --crate-type lib
22
//@ needs-llvm-components: arm
3+
//@ add-core-stubs
4+
35
#![feature(cmse_nonsecure_entry, no_core, lang_items)]
46
#![no_core]
5-
#[lang = "sized"]
6-
pub trait Sized {}
7-
#[lang = "copy"]
8-
pub trait Copy {}
9-
impl Copy for u32 {}
10-
impl Copy for u8 {}
7+
8+
extern crate minicore;
9+
use minicore::*;
1110

1211
#[repr(C)]
1312
pub struct ReprCU64(u64);

tests/ui/cmse-nonsecure/cmse-nonsecure-entry/return-via-stack.stderr

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0798]: return value of `"C-cmse-nonsecure-entry"` function too large to pass via registers
2-
--> $DIR/return-via-stack.rs:25:48
2+
--> $DIR/return-via-stack.rs:24:48
33
|
44
LL | pub extern "C-cmse-nonsecure-entry" fn f1() -> ReprCU64 {
55
| ^^^^^^^^ this type doesn't fit in the available registers
@@ -8,7 +8,7 @@ LL | pub extern "C-cmse-nonsecure-entry" fn f1() -> ReprCU64 {
88
= note: the result must either be a (transparently wrapped) i64, u64 or f64, or be at most 4 bytes in size
99

1010
error[E0798]: return value of `"C-cmse-nonsecure-entry"` function too large to pass via registers
11-
--> $DIR/return-via-stack.rs:30:48
11+
--> $DIR/return-via-stack.rs:29:48
1212
|
1313
LL | pub extern "C-cmse-nonsecure-entry" fn f2() -> ReprCBytes {
1414
| ^^^^^^^^^^ this type doesn't fit in the available registers
@@ -17,7 +17,7 @@ LL | pub extern "C-cmse-nonsecure-entry" fn f2() -> ReprCBytes {
1717
= note: the result must either be a (transparently wrapped) i64, u64 or f64, or be at most 4 bytes in size
1818

1919
error[E0798]: return value of `"C-cmse-nonsecure-entry"` function too large to pass via registers
20-
--> $DIR/return-via-stack.rs:35:48
20+
--> $DIR/return-via-stack.rs:34:48
2121
|
2222
LL | pub extern "C-cmse-nonsecure-entry" fn f3() -> U64Compound {
2323
| ^^^^^^^^^^^ this type doesn't fit in the available registers
@@ -26,7 +26,7 @@ LL | pub extern "C-cmse-nonsecure-entry" fn f3() -> U64Compound {
2626
= note: the result must either be a (transparently wrapped) i64, u64 or f64, or be at most 4 bytes in size
2727

2828
error[E0798]: return value of `"C-cmse-nonsecure-entry"` function too large to pass via registers
29-
--> $DIR/return-via-stack.rs:40:48
29+
--> $DIR/return-via-stack.rs:39:48
3030
|
3131
LL | pub extern "C-cmse-nonsecure-entry" fn f4() -> ReprCAlign16 {
3232
| ^^^^^^^^^^^^ this type doesn't fit in the available registers
@@ -35,7 +35,7 @@ LL | pub extern "C-cmse-nonsecure-entry" fn f4() -> ReprCAlign16 {
3535
= note: the result must either be a (transparently wrapped) i64, u64 or f64, or be at most 4 bytes in size
3636

3737
error[E0798]: return value of `"C-cmse-nonsecure-entry"` function too large to pass via registers
38-
--> $DIR/return-via-stack.rs:47:48
38+
--> $DIR/return-via-stack.rs:46:48
3939
|
4040
LL | pub extern "C-cmse-nonsecure-entry" fn f5() -> [u8; 5] {
4141
| ^^^^^^^ this type doesn't fit in the available registers
@@ -44,7 +44,7 @@ LL | pub extern "C-cmse-nonsecure-entry" fn f5() -> [u8; 5] {
4444
= note: the result must either be a (transparently wrapped) i64, u64 or f64, or be at most 4 bytes in size
4545

4646
error[E0798]: return value of `"C-cmse-nonsecure-entry"` function too large to pass via registers
47-
--> $DIR/return-via-stack.rs:53:50
47+
--> $DIR/return-via-stack.rs:52:50
4848
|
4949
LL | pub extern "C-cmse-nonsecure-entry" fn u128() -> u128 {
5050
| ^^^^ this type doesn't fit in the available registers
@@ -53,7 +53,7 @@ LL | pub extern "C-cmse-nonsecure-entry" fn u128() -> u128 {
5353
= note: the result must either be a (transparently wrapped) i64, u64 or f64, or be at most 4 bytes in size
5454

5555
error[E0798]: return value of `"C-cmse-nonsecure-entry"` function too large to pass via registers
56-
--> $DIR/return-via-stack.rs:59:50
56+
--> $DIR/return-via-stack.rs:58:50
5757
|
5858
LL | pub extern "C-cmse-nonsecure-entry" fn i128() -> i128 {
5959
| ^^^^ this type doesn't fit in the available registers
@@ -62,7 +62,7 @@ LL | pub extern "C-cmse-nonsecure-entry" fn i128() -> i128 {
6262
= note: the result must either be a (transparently wrapped) i64, u64 or f64, or be at most 4 bytes in size
6363

6464
error[E0798]: return value of `"C-cmse-nonsecure-entry"` function too large to pass via registers
65-
--> $DIR/return-via-stack.rs:76:56
65+
--> $DIR/return-via-stack.rs:75:56
6666
|
6767
LL | pub extern "C-cmse-nonsecure-entry" fn union_rust() -> ReprRustUnionU64 {
6868
| ^^^^^^^^^^^^^^^^ this type doesn't fit in the available registers
@@ -71,7 +71,7 @@ LL | pub extern "C-cmse-nonsecure-entry" fn union_rust() -> ReprRustUnionU64 {
7171
= note: the result must either be a (transparently wrapped) i64, u64 or f64, or be at most 4 bytes in size
7272

7373
error[E0798]: return value of `"C-cmse-nonsecure-entry"` function too large to pass via registers
74-
--> $DIR/return-via-stack.rs:81:53
74+
--> $DIR/return-via-stack.rs:80:53
7575
|
7676
LL | pub extern "C-cmse-nonsecure-entry" fn union_c() -> ReprCUnionU64 {
7777
| ^^^^^^^^^^^^^ this type doesn't fit in the available registers

0 commit comments

Comments
 (0)