/src/test/codegen-units/partitioning/regular-modules.rs

https://gitlab.com/jianglu/rust · Rust · 82 lines · 35 code · 13 blank · 34 comment · 0 complexity · 2b50f4081fd77aa4c19fd0da9b9dc55c MD5 · raw file

  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. // ignore-tidy-linelength
  11. // We specify -Z incremental here because we want to test the partitioning for
  12. // incremental compilation
  13. // compile-flags:-Zprint-mono-items=eager -Zincremental=tmp/partitioning-tests/regular-modules
  14. #![allow(dead_code)]
  15. #![crate_type="lib"]
  16. //~ MONO_ITEM fn regular_modules::foo[0] @@ regular_modules[Internal]
  17. fn foo() {}
  18. //~ MONO_ITEM fn regular_modules::bar[0] @@ regular_modules[Internal]
  19. fn bar() {}
  20. //~ MONO_ITEM static regular_modules::BAZ[0] @@ regular_modules[Internal]
  21. static BAZ: u64 = 0;
  22. mod mod1 {
  23. //~ MONO_ITEM fn regular_modules::mod1[0]::foo[0] @@ regular_modules-mod1[Internal]
  24. fn foo() {}
  25. //~ MONO_ITEM fn regular_modules::mod1[0]::bar[0] @@ regular_modules-mod1[Internal]
  26. fn bar() {}
  27. //~ MONO_ITEM static regular_modules::mod1[0]::BAZ[0] @@ regular_modules-mod1[Internal]
  28. static BAZ: u64 = 0;
  29. mod mod1 {
  30. //~ MONO_ITEM fn regular_modules::mod1[0]::mod1[0]::foo[0] @@ regular_modules-mod1-mod1[Internal]
  31. fn foo() {}
  32. //~ MONO_ITEM fn regular_modules::mod1[0]::mod1[0]::bar[0] @@ regular_modules-mod1-mod1[Internal]
  33. fn bar() {}
  34. //~ MONO_ITEM static regular_modules::mod1[0]::mod1[0]::BAZ[0] @@ regular_modules-mod1-mod1[Internal]
  35. static BAZ: u64 = 0;
  36. }
  37. mod mod2 {
  38. //~ MONO_ITEM fn regular_modules::mod1[0]::mod2[0]::foo[0] @@ regular_modules-mod1-mod2[Internal]
  39. fn foo() {}
  40. //~ MONO_ITEM fn regular_modules::mod1[0]::mod2[0]::bar[0] @@ regular_modules-mod1-mod2[Internal]
  41. fn bar() {}
  42. //~ MONO_ITEM static regular_modules::mod1[0]::mod2[0]::BAZ[0] @@ regular_modules-mod1-mod2[Internal]
  43. static BAZ: u64 = 0;
  44. }
  45. }
  46. mod mod2 {
  47. //~ MONO_ITEM fn regular_modules::mod2[0]::foo[0] @@ regular_modules-mod2[Internal]
  48. fn foo() {}
  49. //~ MONO_ITEM fn regular_modules::mod2[0]::bar[0] @@ regular_modules-mod2[Internal]
  50. fn bar() {}
  51. //~ MONO_ITEM static regular_modules::mod2[0]::BAZ[0] @@ regular_modules-mod2[Internal]
  52. static BAZ: u64 = 0;
  53. mod mod1 {
  54. //~ MONO_ITEM fn regular_modules::mod2[0]::mod1[0]::foo[0] @@ regular_modules-mod2-mod1[Internal]
  55. fn foo() {}
  56. //~ MONO_ITEM fn regular_modules::mod2[0]::mod1[0]::bar[0] @@ regular_modules-mod2-mod1[Internal]
  57. fn bar() {}
  58. //~ MONO_ITEM static regular_modules::mod2[0]::mod1[0]::BAZ[0] @@ regular_modules-mod2-mod1[Internal]
  59. static BAZ: u64 = 0;
  60. }
  61. mod mod2 {
  62. //~ MONO_ITEM fn regular_modules::mod2[0]::mod2[0]::foo[0] @@ regular_modules-mod2-mod2[Internal]
  63. fn foo() {}
  64. //~ MONO_ITEM fn regular_modules::mod2[0]::mod2[0]::bar[0] @@ regular_modules-mod2-mod2[Internal]
  65. fn bar() {}
  66. //~ MONO_ITEM static regular_modules::mod2[0]::mod2[0]::BAZ[0] @@ regular_modules-mod2-mod2[Internal]
  67. static BAZ: u64 = 0;
  68. }
  69. }