Skip to content

Commit e01d944

Browse files
disable mergefunc instead of making fns unique
1 parent a99e97a commit e01d944

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

src/test/codegen/dst-vtable-align-nonzero.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// compile-flags: -O
1+
// compile-flags: -O -Z merge-functions=disabled
22

33
#![crate_type = "lib"]
44
#![feature(core_intrinsics)]
@@ -55,9 +55,7 @@ pub fn align_load_from_align_of_val(x: &dyn Trait) -> usize {
5555
pub unsafe fn align_load_from_vtable_align_intrinsic(x: &dyn Trait) -> usize {
5656
let (data, vtable): (*const (), *const ()) = core::mem::transmute(x);
5757
// CHECK: {{%[0-9]+}} = load [[USIZE]], {{.+}} !range [[RANGE_META]]
58-
let align = core::intrinsics::vtable_align(vtable);
59-
// make this function unique so it doesn't get merged with the previous
60-
align + 1
58+
core::intrinsics::vtable_align(vtable)
6159
}
6260

6361
// CHECK: [[RANGE_META]] = !{[[USIZE]] 1, [[USIZE]] 0}

src/test/codegen/dst-vtable-size-range.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// compile-flags: -O
1+
// compile-flags: -O -Z merge-functions=disabled
22

33
#![crate_type = "lib"]
44
#![feature(core_intrinsics)]
@@ -29,9 +29,7 @@ pub fn size_load_from_size_of_val(x: &dyn Trait) -> usize {
2929
pub unsafe fn size_load_from_vtable_size_intrinsic(x: &dyn Trait) -> usize {
3030
let (data, vtable): (*const (), *const ()) = core::mem::transmute(x);
3131
// CHECK: {{%[0-9]+}} = load [[USIZE]], {{.+}} !range [[RANGE_META]]
32-
let size = core::intrinsics::vtable_size(vtable);
33-
// make this function unique so it doesn't get merged with the previous
34-
size + 1
32+
core::intrinsics::vtable_size(vtable)
3533
}
3634

3735
// CHECK: [[RANGE_META]] = !{[[USIZE]] 0, [[USIZE]] [[EXCLUSIVE_BOUND]]}

0 commit comments

Comments
 (0)