Skip to content

Commit 5f0f690

Browse files
committed
add test for repr(transparent) enum
1 parent 09b620d commit 5f0f690

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

tests/ui/cmse-nonsecure/cmse-nonsecure-call/via-registers.rs

+12-5
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,12 @@ pub trait Copy {}
1010
impl Copy for u32 {}
1111

1212
#[repr(transparent)]
13-
pub struct ReprTransparentU64(u64);
13+
pub struct ReprTransparentStructU64(u64);
14+
15+
#[repr(transparent)]
16+
pub enum ReprTransparentEnumU64 {
17+
A(u64),
18+
}
1419

1520
#[repr(C)]
1621
pub struct U32Compound(u16, u16);
@@ -23,15 +28,15 @@ pub fn params(
2328
f3: extern "C-cmse-nonsecure-call" fn(u64, u64),
2429
f4: extern "C-cmse-nonsecure-call" fn(u128),
2530
f5: extern "C-cmse-nonsecure-call" fn(f64, f32, f32),
26-
f6: extern "C-cmse-nonsecure-call" fn(ReprTransparentU64, U32Compound),
31+
f6: extern "C-cmse-nonsecure-call" fn(ReprTransparentStructU64, U32Compound),
2732
f7: extern "C-cmse-nonsecure-call" fn([u32; 4]),
2833
) {
2934
f1();
3035
f2(1, 2, 3, 4);
3136
f3(1, 2);
3237
f4(1);
3338
f5(1.0, 2.0, 3.0);
34-
f6(ReprTransparentU64(1), U32Compound(2, 3));
39+
f6(ReprTransparentStructU64(1), U32Compound(2, 3));
3540
f7([0xDEADBEEF; 4]);
3641
}
3742

@@ -42,8 +47,9 @@ pub fn returns(
4247
f3: extern "C-cmse-nonsecure-call" fn() -> i64,
4348
f4: extern "C-cmse-nonsecure-call" fn() -> f64,
4449
f5: extern "C-cmse-nonsecure-call" fn() -> [u8; 4],
45-
f6: extern "C-cmse-nonsecure-call" fn() -> ReprTransparentU64,
46-
f7: extern "C-cmse-nonsecure-call" fn() -> U32Compound,
50+
f6: extern "C-cmse-nonsecure-call" fn() -> ReprTransparentStructU64,
51+
f7: extern "C-cmse-nonsecure-call" fn() -> ReprTransparentEnumU64,
52+
f8: extern "C-cmse-nonsecure-call" fn() -> U32Compound,
4753
) {
4854
f1();
4955
f2();
@@ -52,4 +58,5 @@ pub fn returns(
5258
f5();
5359
f6();
5460
f7();
61+
f8();
5562
}

0 commit comments

Comments
 (0)