]> git.lizzy.rs Git - rust.git/blob - tests/mir-opt/inline/inline_options.rs
Rollup merge of #106726 - cmorin6:fix-comment-typos, r=Nilstrieb
[rust.git] / tests / mir-opt / inline / inline_options.rs
1 // Checks that inlining threshold can be controlled with
2 // inline-mir-threshold and inline-hint-threshold options.
3 //
4 // compile-flags: -Zinline-mir-threshold=90
5 // compile-flags: -Zinline-mir-hint-threshold=50
6
7 // EMIT_MIR inline_options.main.Inline.after.mir
8 fn main() {
9     not_inlined();
10     inlined::<u32>();
11 }
12
13 // Cost is approximately 3 * 25 + 5 = 80.
14 #[inline]
15 pub fn not_inlined() { g(); g(); g(); }
16 pub fn inlined<T>() { g(); g(); g(); }
17
18 #[inline(never)]
19 fn g() {}