forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of rust-lang#131952 - clubby789:static-unnamed-addr, r=<try>
Always emit `unnamed_addr` for statics Fixes rust-lang#18297 Mostly to see if anything breaks/perf r? `@ghost`
- Loading branch information
Showing
5 changed files
with
25 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,77 +1,76 @@ | ||
//@ revisions: lib staticlib | ||
//@ ignore-emscripten default visibility is hidden | ||
//@ compile-flags: -O | ||
//@ [lib] compile-flags: --crate-type lib | ||
//@ [staticlib] compile-flags: --crate-type staticlib | ||
// `#[no_mangle]`d static variables always have external linkage, i.e., no `internal` in their | ||
// definitions | ||
|
||
// CHECK: @A = {{(dso_local )?}}local_unnamed_addr constant | ||
// CHECK: @A = {{(dso_local )?}}unnamed_addr constant | ||
#[no_mangle] | ||
static A: u8 = 0; | ||
|
||
// CHECK: @B = {{(dso_local )?}}local_unnamed_addr global | ||
// CHECK: @B = {{(dso_local )?}}unnamed_addr global | ||
#[no_mangle] | ||
static mut B: u8 = 0; | ||
|
||
// CHECK: @C = {{(dso_local )?}}local_unnamed_addr constant | ||
// CHECK: @C = {{(dso_local )?}}unnamed_addr constant | ||
#[no_mangle] | ||
pub static C: u8 = 0; | ||
|
||
// CHECK: @D = {{(dso_local )?}}local_unnamed_addr global | ||
// CHECK: @D = {{(dso_local )?}}unnamed_addr global | ||
#[no_mangle] | ||
pub static mut D: u8 = 0; | ||
|
||
mod private { | ||
// CHECK: @E = {{(dso_local )?}}local_unnamed_addr constant | ||
// CHECK: @E = {{(dso_local )?}}unnamed_addr constant | ||
#[no_mangle] | ||
static E: u8 = 0; | ||
|
||
// CHECK: @F = {{(dso_local )?}}local_unnamed_addr global | ||
// CHECK: @F = {{(dso_local )?}}unnamed_addr global | ||
#[no_mangle] | ||
static mut F: u8 = 0; | ||
|
||
// CHECK: @G = {{(dso_local )?}}local_unnamed_addr constant | ||
// CHECK: @G = {{(dso_local )?}}unnamed_addr constant | ||
#[no_mangle] | ||
pub static G: u8 = 0; | ||
|
||
// CHECK: @H = {{(dso_local )?}}local_unnamed_addr global | ||
// CHECK: @H = {{(dso_local )?}}unnamed_addr global | ||
#[no_mangle] | ||
pub static mut H: u8 = 0; | ||
} | ||
|
||
const HIDDEN: () = { | ||
// CHECK: @I = {{(dso_local )?}}local_unnamed_addr constant | ||
// CHECK: @I = {{(dso_local )?}}unnamed_addr constant | ||
#[no_mangle] | ||
static I: u8 = 0; | ||
|
||
// CHECK: @J = {{(dso_local )?}}local_unnamed_addr global | ||
// CHECK: @J = {{(dso_local )?}}unnamed_addr global | ||
#[no_mangle] | ||
static mut J: u8 = 0; | ||
|
||
// CHECK: @K = {{(dso_local )?}}local_unnamed_addr constant | ||
// CHECK: @K = {{(dso_local )?}}unnamed_addr constant | ||
#[no_mangle] | ||
pub static K: u8 = 0; | ||
|
||
// CHECK: @L = {{(dso_local )?}}local_unnamed_addr global | ||
// CHECK: @L = {{(dso_local )?}}unnamed_addr global | ||
#[no_mangle] | ||
pub static mut L: u8 = 0; | ||
}; | ||
|
||
fn x() { | ||
// CHECK: @M = {{(dso_local )?}}local_unnamed_addr constant | ||
// CHECK: @M = {{(dso_local )?}}unnamed_addr constant | ||
#[no_mangle] | ||
static M: fn() = x; | ||
|
||
// CHECK: @N = {{(dso_local )?}}local_unnamed_addr global | ||
// CHECK: @N = {{(dso_local )?}}unnamed_addr global | ||
#[no_mangle] | ||
static mut N: u8 = 0; | ||
|
||
// CHECK: @O = {{(dso_local )?}}local_unnamed_addr constant | ||
// CHECK: @O = {{(dso_local )?}}unnamed_addr constant | ||
#[no_mangle] | ||
pub static O: u8 = 0; | ||
|
||
// CHECK: @P = {{(dso_local )?}}local_unnamed_addr global | ||
// CHECK: @P = {{(dso_local )?}}unnamed_addr global | ||
#[no_mangle] | ||
pub static mut P: u8 = 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.