]> git.lizzy.rs Git - rust.git/blob - src/test/codegen/link-dead-code.rs
Enable emission of alignment attrs for pointer params
[rust.git] / src / test / codegen / link-dead-code.rs
1 // Copyright 2017 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
4 //
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
10
11 // compile-flags:-Clink-dead-code
12
13 #![crate_type = "rlib"]
14
15 // This test makes sure that, when -Clink-dead-code is specified, we generate
16 // code for functions that would otherwise be skipped.
17
18 // CHECK-LABEL: define hidden i32 @_ZN14link_dead_code8const_fn
19 const fn const_fn() -> i32 { 1 }
20
21 // CHECK-LABEL: define hidden i32 @_ZN14link_dead_code9inline_fn
22 #[inline]
23 fn inline_fn() -> i32 { 2 }
24
25 // CHECK-LABEL: define hidden i32 @_ZN14link_dead_code10private_fn
26 fn private_fn() -> i32 { 3 }