From e349900339fc5ff512828aee9fddf87995e5e347 Mon Sep 17 00:00:00 2001 From: Erik Desjardins Date: Wed, 6 Mar 2024 19:53:45 -0500 Subject: [PATCH] add test for extern type --- tests/codegen/dst-offset.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tests/codegen/dst-offset.rs b/tests/codegen/dst-offset.rs index 55212112b3d98..f0157e5a10646 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 { +// Computing the alignment of an extern type is currently unsupported and just panics. + +// CHECK: call void @{{.+}}panic + &s.z +}