disable mergefunc instead of making fns unique
This commit is contained in:
parent
a99e97af97
commit
e01d944c6c
2 changed files with 4 additions and 8 deletions
|
@ -1,4 +1,4 @@
|
|||
// compile-flags: -O
|
||||
// compile-flags: -O -Z merge-functions=disabled
|
||||
|
||||
#![crate_type = "lib"]
|
||||
#![feature(core_intrinsics)]
|
||||
|
@ -55,9 +55,7 @@ pub fn align_load_from_align_of_val(x: &dyn Trait) -> usize {
|
|||
pub unsafe fn align_load_from_vtable_align_intrinsic(x: &dyn Trait) -> usize {
|
||||
let (data, vtable): (*const (), *const ()) = core::mem::transmute(x);
|
||||
// CHECK: {{%[0-9]+}} = load [[USIZE]], {{.+}} !range [[RANGE_META]]
|
||||
let align = core::intrinsics::vtable_align(vtable);
|
||||
// make this function unique so it doesn't get merged with the previous
|
||||
align + 1
|
||||
core::intrinsics::vtable_align(vtable)
|
||||
}
|
||||
|
||||
// CHECK: [[RANGE_META]] = !{[[USIZE]] 1, [[USIZE]] 0}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// compile-flags: -O
|
||||
// compile-flags: -O -Z merge-functions=disabled
|
||||
|
||||
#![crate_type = "lib"]
|
||||
#![feature(core_intrinsics)]
|
||||
|
@ -29,9 +29,7 @@ pub fn size_load_from_size_of_val(x: &dyn Trait) -> usize {
|
|||
pub unsafe fn size_load_from_vtable_size_intrinsic(x: &dyn Trait) -> usize {
|
||||
let (data, vtable): (*const (), *const ()) = core::mem::transmute(x);
|
||||
// CHECK: {{%[0-9]+}} = load [[USIZE]], {{.+}} !range [[RANGE_META]]
|
||||
let size = core::intrinsics::vtable_size(vtable);
|
||||
// make this function unique so it doesn't get merged with the previous
|
||||
size + 1
|
||||
core::intrinsics::vtable_size(vtable)
|
||||
}
|
||||
|
||||
// CHECK: [[RANGE_META]] = !{[[USIZE]] 0, [[USIZE]] [[EXCLUSIVE_BOUND]]}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue