about summary refs log tree commit diff
path: root/tests/mir-opt/inline/forced_inherent_dead_code.rs
blob: 057a4cac52870ce7a98da23595c58116942d52b3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
//@ compile-flags: -Copt-level=0 -Clink-dead-code
#![feature(rustc_attrs)]

struct Foo {}

impl Foo {
    #[rustc_force_inline]
    pub fn callee_forced() {}
}

// EMIT_MIR forced_inherent_dead_code.caller.ForceInline.diff
pub fn caller() {
    Foo::callee_forced();
    // CHECK-LABEL: fn caller(
    // CHECK: (inlined Foo::callee_forced)
}

fn main() {
    caller();
}