2021-09-19 16:57:19 +00:00
|
|
|
//@ incremental
|
2024-12-05 17:51:19 +00:00
|
|
|
//@ compile-flags: -Zprint-mono-items=lazy -Copt-level=0
|
2016-03-24 15:40:49 +00:00
|
|
|
|
2024-05-29 04:25:55 +00:00
|
|
|
#![crate_type = "lib"]
|
2016-03-24 15:40:49 +00:00
|
|
|
|
|
|
|
//@ aux-build:cgu_generic_function.rs
|
|
|
|
extern crate cgu_generic_function;
|
|
|
|
|
2024-12-05 17:51:19 +00:00
|
|
|
// This test checks that, in an unoptimized build, a generic function and its callees are only
|
|
|
|
// instantiated once in this crate.
|
|
|
|
|
|
|
|
//~ MONO_ITEM fn user @@ extern_generic[External]
|
|
|
|
pub fn user() {
|
2016-03-24 15:40:49 +00:00
|
|
|
let _ = cgu_generic_function::foo("abc");
|
|
|
|
}
|
|
|
|
|
2024-12-05 17:51:19 +00:00
|
|
|
pub mod mod1 {
|
2016-03-24 15:40:49 +00:00
|
|
|
use cgu_generic_function;
|
|
|
|
|
2024-12-05 17:51:19 +00:00
|
|
|
//~ MONO_ITEM fn mod1::user @@ extern_generic-mod1[External]
|
|
|
|
pub fn user() {
|
2016-03-24 15:40:49 +00:00
|
|
|
let _ = cgu_generic_function::foo("abc");
|
|
|
|
}
|
|
|
|
|
2024-12-05 17:51:19 +00:00
|
|
|
pub mod mod1 {
|
2016-03-24 15:40:49 +00:00
|
|
|
use cgu_generic_function;
|
|
|
|
|
2024-12-05 17:51:19 +00:00
|
|
|
//~ MONO_ITEM fn mod1::mod1::user @@ extern_generic-mod1-mod1[External]
|
|
|
|
pub fn user() {
|
2016-03-24 15:40:49 +00:00
|
|
|
let _ = cgu_generic_function::foo("abc");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-08-28 13:31:03 +00:00
|
|
|
//~ MONO_ITEM fn cgu_generic_function::foo::<&str> @@ cgu_generic_function-in-extern_generic.volatile[External]
|
|
|
|
//~ MONO_ITEM fn cgu_generic_function::bar::<&str> @@ cgu_generic_function-in-extern_generic.volatile[External]
|