1 // Copyright 2018 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: -C no-prepopulate-passes
12 // `#[no_mangle]`d functions always have external linkage, i.e., no `internal` in their `define`s
14 #![crate_type = "lib"]
17 // CHECK: define void @a()
21 // CHECK: define void @b()
26 // CHECK: define void @c()
30 // CHECK: define void @d()
36 // CHECK: define void @e()
40 // CHECK: define void @f()
45 // The surrounding item should not accidentally become external
46 // CHECK: define internal{{.*}} void @_ZN22external_no_mangle_fns1x
49 // CHECK: define void @g()
55 // CHECK: define void @h()
59 // side effect to keep `x` around
61 core::ptr::read_volatile(&42);