add test for extern type
This commit is contained in:
parent
8ebd307d2a
commit
e349900339
@ -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
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user