about summary refs log tree commit diff
diff options
context:
space:
mode:
authorFolkert <folkert@folkertdev.nl>2024-07-17 15:41:16 +0200
committerFolkert <folkert@folkertdev.nl>2024-07-17 15:41:16 +0200
commit5f0f690bd6d0fbe98e82b5b98036ffe08dff4fbe (patch)
treea20cebdd6f36179b40f97bb3b7d35773fe578de7
parent09b620d179713cceb343dc172d7e5633bfd7a824 (diff)
downloadrust-5f0f690bd6d0fbe98e82b5b98036ffe08dff4fbe.tar.gz
rust-5f0f690bd6d0fbe98e82b5b98036ffe08dff4fbe.zip
add test for repr(transparent) enum
-rw-r--r--tests/ui/cmse-nonsecure/cmse-nonsecure-call/via-registers.rs17
1 files changed, 12 insertions, 5 deletions
diff --git a/tests/ui/cmse-nonsecure/cmse-nonsecure-call/via-registers.rs b/tests/ui/cmse-nonsecure/cmse-nonsecure-call/via-registers.rs
index 72b405ef282..43768dd72f7 100644
--- a/tests/ui/cmse-nonsecure/cmse-nonsecure-call/via-registers.rs
+++ b/tests/ui/cmse-nonsecure/cmse-nonsecure-call/via-registers.rs
@@ -10,7 +10,12 @@ pub trait Copy {}
 impl Copy for u32 {}
 
 #[repr(transparent)]
-pub struct ReprTransparentU64(u64);
+pub struct ReprTransparentStructU64(u64);
+
+#[repr(transparent)]
+pub enum ReprTransparentEnumU64 {
+    A(u64),
+}
 
 #[repr(C)]
 pub struct U32Compound(u16, u16);
@@ -23,7 +28,7 @@ pub fn params(
     f3: extern "C-cmse-nonsecure-call" fn(u64, u64),
     f4: extern "C-cmse-nonsecure-call" fn(u128),
     f5: extern "C-cmse-nonsecure-call" fn(f64, f32, f32),
-    f6: extern "C-cmse-nonsecure-call" fn(ReprTransparentU64, U32Compound),
+    f6: extern "C-cmse-nonsecure-call" fn(ReprTransparentStructU64, U32Compound),
     f7: extern "C-cmse-nonsecure-call" fn([u32; 4]),
 ) {
     f1();
@@ -31,7 +36,7 @@ pub fn params(
     f3(1, 2);
     f4(1);
     f5(1.0, 2.0, 3.0);
-    f6(ReprTransparentU64(1), U32Compound(2, 3));
+    f6(ReprTransparentStructU64(1), U32Compound(2, 3));
     f7([0xDEADBEEF; 4]);
 }
 
@@ -42,8 +47,9 @@ pub fn returns(
     f3: extern "C-cmse-nonsecure-call" fn() -> i64,
     f4: extern "C-cmse-nonsecure-call" fn() -> f64,
     f5: extern "C-cmse-nonsecure-call" fn() -> [u8; 4],
-    f6: extern "C-cmse-nonsecure-call" fn() -> ReprTransparentU64,
-    f7: extern "C-cmse-nonsecure-call" fn() -> U32Compound,
+    f6: extern "C-cmse-nonsecure-call" fn() -> ReprTransparentStructU64,
+    f7: extern "C-cmse-nonsecure-call" fn() -> ReprTransparentEnumU64,
+    f8: extern "C-cmse-nonsecure-call" fn() -> U32Compound,
 ) {
     f1();
     f2();
@@ -52,4 +58,5 @@ pub fn returns(
     f5();
     f6();
     f7();
+    f8();
 }