2022-12-30 14:11:30 -06:00
|
|
|
//@ compile-flags: -Copt-level=0
|
2022-08-08 09:00:45 -05:00
|
|
|
#![crate_type = "lib"]
|
|
|
|
#![feature(core_intrinsics)]
|
|
|
|
|
2022-08-09 10:51:45 -05:00
|
|
|
// CHECK-LABEL: @mask_ptr
|
2022-12-30 14:11:30 -06:00
|
|
|
// CHECK-SAME: [[WORD:i[0-9]+]] %mask
|
2022-08-09 10:51:45 -05:00
|
|
|
#[no_mangle]
|
2022-08-18 13:21:53 -05:00
|
|
|
pub fn mask_ptr(ptr: *const u16, mask: usize) -> *const u16 {
|
2022-08-09 10:51:45 -05:00
|
|
|
// CHECK: call
|
2023-07-27 16:44:13 -05:00
|
|
|
// CHECK-SAME: @llvm.ptrmask.{{p0|p0i8}}.[[WORD]](ptr {{%ptr|%1}}, [[WORD]] %mask)
|
2022-08-08 09:00:45 -05:00
|
|
|
core::intrinsics::ptr_mask(ptr, mask)
|
|
|
|
}
|