Skip to content

Commit e349900

Browse files
add test for extern type
1 parent 8ebd307 commit e349900

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

tests/codegen/dst-offset.rs

+15
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
#![crate_type = "lib"]
66

7+
#![feature(extern_types)]
8+
79
use std::ptr::addr_of;
810

911
// Hack to get the correct type for usize
@@ -67,3 +69,16 @@ pub fn packed_dst_slice_offset(s: &PackedDstSlice) -> *const [u16] {
6769
// CHECK-NEXT: ret
6870
addr_of!(s.z)
6971
}
72+
73+
extern {
74+
pub type Extern;
75+
}
76+
77+
// CHECK-LABEL: @dst_extern
78+
#[no_mangle]
79+
pub fn dst_extern(s: &Dst<Extern>) -> &Extern {
80+
// Computing the alignment of an extern type is currently unsupported and just panics.
81+
82+
// CHECK: call void @{{.+}}panic
83+
&s.z
84+
}

0 commit comments

Comments
 (0)