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.
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.
11 // compile-flags:-Clink-dead-code
13 #![feature(min_const_fn)]
14 #![crate_type = "rlib"]
16 // This test makes sure that, when -Clink-dead-code is specified, we generate
17 // code for functions that would otherwise be skipped.
19 // CHECK-LABEL: define hidden i32 @_ZN14link_dead_code8const_fn
20 const fn const_fn() -> i32 { 1 }
22 // CHECK-LABEL: define hidden i32 @_ZN14link_dead_code9inline_fn
24 fn inline_fn() -> i32 { 2 }
26 // CHECK-LABEL: define hidden i32 @_ZN14link_dead_code10private_fn
27 fn private_fn() -> i32 { 3 }