diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:19:03 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:19:03 +0000 |
commit | 64d98f8ee037282c35007b64c2649055c56af1db (patch) | |
tree | 5492bcf97fce41ee1c0b1cc2add283f3e66cdab0 /tests/codegen-units/partitioning/regular-modules.rs | |
parent | Adding debian version 1.67.1+dfsg1-1. (diff) | |
download | rustc-64d98f8ee037282c35007b64c2649055c56af1db.tar.xz rustc-64d98f8ee037282c35007b64c2649055c56af1db.zip |
Merging upstream version 1.68.2+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/codegen-units/partitioning/regular-modules.rs')
-rw-r--r-- | tests/codegen-units/partitioning/regular-modules.rs | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/tests/codegen-units/partitioning/regular-modules.rs b/tests/codegen-units/partitioning/regular-modules.rs new file mode 100644 index 000000000..ce7fe9c3a --- /dev/null +++ b/tests/codegen-units/partitioning/regular-modules.rs @@ -0,0 +1,72 @@ +// We specify incremental here because we want to test the partitioning for +// incremental compilation +// incremental +// compile-flags:-Zprint-mono-items=eager + +#![allow(dead_code)] +#![crate_type="lib"] + +//~ MONO_ITEM fn foo @@ regular_modules[Internal] +fn foo() {} + +//~ MONO_ITEM fn bar @@ regular_modules[Internal] +fn bar() {} + +//~ MONO_ITEM static BAZ @@ regular_modules[Internal] +static BAZ: u64 = 0; + +mod mod1 { + + //~ MONO_ITEM fn mod1::foo @@ regular_modules-mod1[Internal] + fn foo() {} + //~ MONO_ITEM fn mod1::bar @@ regular_modules-mod1[Internal] + fn bar() {} + //~ MONO_ITEM static mod1::BAZ @@ regular_modules-mod1[Internal] + static BAZ: u64 = 0; + + mod mod1 { + //~ MONO_ITEM fn mod1::mod1::foo @@ regular_modules-mod1-mod1[Internal] + fn foo() {} + //~ MONO_ITEM fn mod1::mod1::bar @@ regular_modules-mod1-mod1[Internal] + fn bar() {} + //~ MONO_ITEM static mod1::mod1::BAZ @@ regular_modules-mod1-mod1[Internal] + static BAZ: u64 = 0; + } + + mod mod2 { + //~ MONO_ITEM fn mod1::mod2::foo @@ regular_modules-mod1-mod2[Internal] + fn foo() {} + //~ MONO_ITEM fn mod1::mod2::bar @@ regular_modules-mod1-mod2[Internal] + fn bar() {} + //~ MONO_ITEM static mod1::mod2::BAZ @@ regular_modules-mod1-mod2[Internal] + static BAZ: u64 = 0; + } +} + +mod mod2 { + + //~ MONO_ITEM fn mod2::foo @@ regular_modules-mod2[Internal] + fn foo() {} + //~ MONO_ITEM fn mod2::bar @@ regular_modules-mod2[Internal] + fn bar() {} + //~ MONO_ITEM static mod2::BAZ @@ regular_modules-mod2[Internal] + static BAZ: u64 = 0; + + mod mod1 { + //~ MONO_ITEM fn mod2::mod1::foo @@ regular_modules-mod2-mod1[Internal] + fn foo() {} + //~ MONO_ITEM fn mod2::mod1::bar @@ regular_modules-mod2-mod1[Internal] + fn bar() {} + //~ MONO_ITEM static mod2::mod1::BAZ @@ regular_modules-mod2-mod1[Internal] + static BAZ: u64 = 0; + } + + mod mod2 { + //~ MONO_ITEM fn mod2::mod2::foo @@ regular_modules-mod2-mod2[Internal] + fn foo() {} + //~ MONO_ITEM fn mod2::mod2::bar @@ regular_modules-mod2-mod2[Internal] + fn bar() {} + //~ MONO_ITEM static mod2::mod2::BAZ @@ regular_modules-mod2-mod2[Internal] + static BAZ: u64 = 0; + } +} |