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