]> git.lizzy.rs Git - rust.git/blob - tests/codegen/link-dead-code.rs
Rollup merge of #107769 - compiler-errors:pointer-like, r=eholk
[rust.git] / tests / codegen / link-dead-code.rs
1 // compile-flags:-Clink-dead-code
2
3 #![crate_type = "rlib"]
4
5 // This test makes sure that, when -Clink-dead-code is specified, we generate
6 // code for functions that would otherwise be skipped.
7
8 // CHECK-LABEL: ; link_dead_code::const_fn
9 // CHECK-NEXT: ; Function Attrs:
10 // CHECK-NEXT: define hidden
11 const fn const_fn() -> i32 { 1 }
12
13 // CHECK-LABEL: ; link_dead_code::inline_fn
14 // CHECK-NEXT: ; Function Attrs:
15 // CHECK-NEXT: define hidden
16 #[inline]
17 fn inline_fn() -> i32 { 2 }
18
19 // CHECK-LABEL: ; link_dead_code::private_fn
20 // CHECK-NEXT: ; Function Attrs:
21 // CHECK-NEXT: define hidden
22 fn private_fn() -> i32 { 3 }