diff options
| author | Jonathan Turner <jonathandturner@users.noreply.github.com> | 2016-10-24 15:41:29 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-10-24 15:41:29 -0700 |
| commit | e7da61975f168ff91c55233f489923fa1acd47e9 (patch) | |
| tree | 5a5b73a10502641b3fb082ece6014844b61919cc /src/test/codegen | |
| parent | 050499c407218fb6b0044bc4a16ffbfb906ec3a4 (diff) | |
| parent | 992203b9764c7e4e48ca454aa3162ee7d73cb87c (diff) | |
| download | rust-e7da61975f168ff91c55233f489923fa1acd47e9.tar.gz rust-e7da61975f168ff91c55233f489923fa1acd47e9.zip | |
Rollup merge of #37328 - michaelwoerister:stable-local-symbol-names, r=nagisa
trans: Make names of internal symbols independent of CGU translation order
Every codegen unit gets its own local counter for generating new symbol names. This makes bitcode and object files reproducible at the binary level even when incremental compilation is used.
The PR also solves a rare ICE resulting from a naming conflict between a user defined name and a generated one. E.g. try compiling the following program with 1.12.1 stable:
```rust
pub fn str7233() -> &'static str { "foo" }
```
This results in:
> error: internal compiler error: ../src/librustc_trans/common.rs:979: symbol `str7233` is already defined
Running into this is not very likely but it's also easily avoidable.
Diffstat (limited to 'src/test/codegen')
| -rw-r--r-- | src/test/codegen/consts.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/test/codegen/consts.rs b/src/test/codegen/consts.rs index 36a582ca737..33b4221b733 100644 --- a/src/test/codegen/consts.rs +++ b/src/test/codegen/consts.rs @@ -19,12 +19,12 @@ // CHECK: @STATIC = {{.*}}, align 4 // This checks the constants from inline_enum_const -// CHECK: @ref{{[0-9]+}} = {{.*}}, align 2 +// CHECK: @ref.{{[0-9]+}} = {{.*}}, align 2 // This checks the constants from {low,high}_align_const, they share the same // constant, but the alignment differs, so the higher one should be used -// CHECK: [[LOW_HIGH:@ref[0-9]+]] = {{.*}}, align 4 -// CHECK: [[LOW_HIGH_REF:@const[0-9]+]] = {{.*}} [[LOW_HIGH]] +// CHECK: [[LOW_HIGH:@ref.[0-9]+]] = {{.*}}, align 4 +// CHECK: [[LOW_HIGH_REF:@const.[0-9]+]] = {{.*}} [[LOW_HIGH]] #[derive(Copy, Clone)] |
