about summary refs log tree commit diff
path: root/tests/codegen
diff options
context:
space:
mode:
authorErik Desjardins <erikdesjardins@users.noreply.github.com>2024-03-06 19:53:45 -0500
committerErik Desjardins <erikdesjardins@users.noreply.github.com>2024-03-06 19:53:45 -0500
commite349900339fc5ff512828aee9fddf87995e5e347 (patch)
tree03296172e1bc137090b95b0854d982ddd0b55698 /tests/codegen
parent8ebd307d2a95840e193ff03aff21c87b5c643ef4 (diff)
downloadrust-e349900339fc5ff512828aee9fddf87995e5e347.tar.gz
rust-e349900339fc5ff512828aee9fddf87995e5e347.zip
add test for extern type
Diffstat (limited to 'tests/codegen')
-rw-r--r--tests/codegen/dst-offset.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/codegen/dst-offset.rs b/tests/codegen/dst-offset.rs
index 55212112b3d..f0157e5a106 100644
--- a/tests/codegen/dst-offset.rs
+++ b/tests/codegen/dst-offset.rs
@@ -4,6 +4,8 @@
 
 #![crate_type = "lib"]
 
+#![feature(extern_types)]
+
 use std::ptr::addr_of;
 
 // Hack to get the correct type for usize
@@ -67,3 +69,16 @@ pub fn packed_dst_slice_offset(s: &PackedDstSlice) -> *const [u16] {
 // CHECK-NEXT: ret
     addr_of!(s.z)
 }
+
+extern {
+    pub type Extern;
+}
+
+// CHECK-LABEL: @dst_extern
+#[no_mangle]
+pub fn dst_extern(s: &Dst<Extern>) -> &Extern {
+// Computing the alignment of an extern type is currently unsupported and just panics.
+
+// CHECK: call void @{{.+}}panic
+    &s.z
+}