2021-08-14 15:24:33 +00:00
|
|
|
// revisions: lib staticlib
|
2019-08-17 05:08:01 +00:00
|
|
|
// ignore-emscripten default visibility is hidden
|
2018-09-21 22:58:11 +00:00
|
|
|
// compile-flags: -O
|
2022-07-26 22:24:30 +00:00
|
|
|
// [lib] compile-flags: --crate-type lib
|
|
|
|
// [staticlib] compile-flags: --crate-type staticlib
|
2018-11-27 02:59:49 +00:00
|
|
|
// `#[no_mangle]`d static variables always have external linkage, i.e., no `internal` in their
|
2018-09-21 22:58:11 +00:00
|
|
|
// definitions
|
|
|
|
|
|
|
|
// CHECK: @A = local_unnamed_addr constant
|
|
|
|
#[no_mangle]
|
|
|
|
static A: u8 = 0;
|
|
|
|
|
|
|
|
// CHECK: @B = local_unnamed_addr global
|
|
|
|
#[no_mangle]
|
|
|
|
static mut B: u8 = 0;
|
|
|
|
|
|
|
|
// CHECK: @C = local_unnamed_addr constant
|
|
|
|
#[no_mangle]
|
|
|
|
pub static C: u8 = 0;
|
|
|
|
|
|
|
|
// CHECK: @D = local_unnamed_addr global
|
|
|
|
#[no_mangle]
|
|
|
|
pub static mut D: u8 = 0;
|
|
|
|
|
|
|
|
mod private {
|
|
|
|
// CHECK: @E = local_unnamed_addr constant
|
|
|
|
#[no_mangle]
|
|
|
|
static E: u8 = 0;
|
|
|
|
|
|
|
|
// CHECK: @F = local_unnamed_addr global
|
|
|
|
#[no_mangle]
|
|
|
|
static mut F: u8 = 0;
|
|
|
|
|
|
|
|
// CHECK: @G = local_unnamed_addr constant
|
|
|
|
#[no_mangle]
|
|
|
|
pub static G: u8 = 0;
|
|
|
|
|
|
|
|
// CHECK: @H = local_unnamed_addr global
|
|
|
|
#[no_mangle]
|
|
|
|
pub static mut H: u8 = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
const HIDDEN: () = {
|
|
|
|
// CHECK: @I = local_unnamed_addr constant
|
|
|
|
#[no_mangle]
|
|
|
|
static I: u8 = 0;
|
|
|
|
|
|
|
|
// CHECK: @J = local_unnamed_addr global
|
|
|
|
#[no_mangle]
|
|
|
|
static mut J: u8 = 0;
|
|
|
|
|
|
|
|
// CHECK: @K = local_unnamed_addr constant
|
|
|
|
#[no_mangle]
|
|
|
|
pub static K: u8 = 0;
|
|
|
|
|
|
|
|
// CHECK: @L = local_unnamed_addr global
|
|
|
|
#[no_mangle]
|
|
|
|
pub static mut L: u8 = 0;
|
|
|
|
};
|
|
|
|
|
|
|
|
fn x() {
|
|
|
|
// CHECK: @M = local_unnamed_addr constant
|
|
|
|
#[no_mangle]
|
|
|
|
static M: fn() = x;
|
|
|
|
|
|
|
|
// CHECK: @N = local_unnamed_addr global
|
|
|
|
#[no_mangle]
|
|
|
|
static mut N: u8 = 0;
|
|
|
|
|
|
|
|
// CHECK: @O = local_unnamed_addr constant
|
|
|
|
#[no_mangle]
|
|
|
|
pub static O: u8 = 0;
|
|
|
|
|
|
|
|
// CHECK: @P = local_unnamed_addr global
|
|
|
|
#[no_mangle]
|
|
|
|
pub static mut P: u8 = 0;
|
|
|
|
}
|