]> git.proxmox.com Git - rustc.git/blob - src/test/codegen-units/partitioning/statics.rs
New upstream version 1.23.0+dfsg1
[rustc.git] / src / test / codegen-units / partitioning / statics.rs
1 // Copyright 2016 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.
4 //
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.
10
11 // ignore-tidy-linelength
12 // We specify -Z incremental here because we want to test the partitioning for
13 // incremental compilation
14 // compile-flags:-Zprint-trans-items=lazy -Zincremental=tmp/partitioning-tests/statics
15
16 #![crate_type="rlib"]
17
18 //~ TRANS_ITEM static statics::FOO[0] @@ statics[Internal]
19 static FOO: u32 = 0;
20
21 //~ TRANS_ITEM static statics::BAR[0] @@ statics[Internal]
22 static BAR: u32 = 0;
23
24 //~ TRANS_ITEM fn statics::function[0] @@ statics[External]
25 pub fn function() {
26 //~ TRANS_ITEM static statics::function[0]::FOO[0] @@ statics[Internal]
27 static FOO: u32 = 0;
28
29 //~ TRANS_ITEM static statics::function[0]::BAR[0] @@ statics[Internal]
30 static BAR: u32 = 0;
31 }
32
33 pub mod mod1 {
34 //~ TRANS_ITEM static statics::mod1[0]::FOO[0] @@ statics-mod1[Internal]
35 static FOO: u32 = 0;
36
37 //~ TRANS_ITEM static statics::mod1[0]::BAR[0] @@ statics-mod1[Internal]
38 static BAR: u32 = 0;
39
40 //~ TRANS_ITEM fn statics::mod1[0]::function[0] @@ statics-mod1[External]
41 pub fn function() {
42 //~ TRANS_ITEM static statics::mod1[0]::function[0]::FOO[0] @@ statics-mod1[Internal]
43 static FOO: u32 = 0;
44
45 //~ TRANS_ITEM static statics::mod1[0]::function[0]::BAR[0] @@ statics-mod1[Internal]
46 static BAR: u32 = 0;
47 }
48 }