]> git.proxmox.com Git - rustc.git/blob - src/test/codegen-units/partitioning/regular-modules.rs
New upstream version 1.18.0+dfsg1
[rustc.git] / src / test / codegen-units / partitioning / regular-modules.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=eager -Zincremental=tmp/partitioning-tests/regular-modules
15
16 #![allow(dead_code)]
17 #![crate_type="lib"]
18
19 //~ TRANS_ITEM fn regular_modules::foo[0] @@ regular_modules[External]
20 fn foo() {}
21
22 //~ TRANS_ITEM fn regular_modules::bar[0] @@ regular_modules[External]
23 fn bar() {}
24
25 //~ TRANS_ITEM static regular_modules::BAZ[0] @@ regular_modules[External]
26 static BAZ: u64 = 0;
27
28 mod mod1 {
29
30 //~ TRANS_ITEM fn regular_modules::mod1[0]::foo[0] @@ regular_modules-mod1[External]
31 fn foo() {}
32 //~ TRANS_ITEM fn regular_modules::mod1[0]::bar[0] @@ regular_modules-mod1[External]
33 fn bar() {}
34 //~ TRANS_ITEM static regular_modules::mod1[0]::BAZ[0] @@ regular_modules-mod1[External]
35 static BAZ: u64 = 0;
36
37 mod mod1 {
38 //~ TRANS_ITEM fn regular_modules::mod1[0]::mod1[0]::foo[0] @@ regular_modules-mod1-mod1[External]
39 fn foo() {}
40 //~ TRANS_ITEM fn regular_modules::mod1[0]::mod1[0]::bar[0] @@ regular_modules-mod1-mod1[External]
41 fn bar() {}
42 //~ TRANS_ITEM static regular_modules::mod1[0]::mod1[0]::BAZ[0] @@ regular_modules-mod1-mod1[External]
43 static BAZ: u64 = 0;
44 }
45
46 mod mod2 {
47 //~ TRANS_ITEM fn regular_modules::mod1[0]::mod2[0]::foo[0] @@ regular_modules-mod1-mod2[External]
48 fn foo() {}
49 //~ TRANS_ITEM fn regular_modules::mod1[0]::mod2[0]::bar[0] @@ regular_modules-mod1-mod2[External]
50 fn bar() {}
51 //~ TRANS_ITEM static regular_modules::mod1[0]::mod2[0]::BAZ[0] @@ regular_modules-mod1-mod2[External]
52 static BAZ: u64 = 0;
53 }
54 }
55
56 mod mod2 {
57
58 //~ TRANS_ITEM fn regular_modules::mod2[0]::foo[0] @@ regular_modules-mod2[External]
59 fn foo() {}
60 //~ TRANS_ITEM fn regular_modules::mod2[0]::bar[0] @@ regular_modules-mod2[External]
61 fn bar() {}
62 //~ TRANS_ITEM static regular_modules::mod2[0]::BAZ[0] @@ regular_modules-mod2[External]
63 static BAZ: u64 = 0;
64
65 mod mod1 {
66 //~ TRANS_ITEM fn regular_modules::mod2[0]::mod1[0]::foo[0] @@ regular_modules-mod2-mod1[External]
67 fn foo() {}
68 //~ TRANS_ITEM fn regular_modules::mod2[0]::mod1[0]::bar[0] @@ regular_modules-mod2-mod1[External]
69 fn bar() {}
70 //~ TRANS_ITEM static regular_modules::mod2[0]::mod1[0]::BAZ[0] @@ regular_modules-mod2-mod1[External]
71 static BAZ: u64 = 0;
72 }
73
74 mod mod2 {
75 //~ TRANS_ITEM fn regular_modules::mod2[0]::mod2[0]::foo[0] @@ regular_modules-mod2-mod2[External]
76 fn foo() {}
77 //~ TRANS_ITEM fn regular_modules::mod2[0]::mod2[0]::bar[0] @@ regular_modules-mod2-mod2[External]
78 fn bar() {}
79 //~ TRANS_ITEM static regular_modules::mod2[0]::mod2[0]::BAZ[0] @@ regular_modules-mod2-mod2[External]
80 static BAZ: u64 = 0;
81 }
82 }