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 +}