diff options
| author | The Miri Cronjob Bot <miri@cron.bot> | 2024-03-17 05:22:24 +0000 |
|---|---|---|
| committer | The Miri Cronjob Bot <miri@cron.bot> | 2024-03-17 05:22:24 +0000 |
| commit | 0dff16a30ccfed16ba397c2f2dbed25475329dab (patch) | |
| tree | ec40433a2b051e80ba1672eeee084b1a81bc73dd /tests/codegen | |
| parent | 96674fce4ce73a231bae472d4e214f034eb2c4c9 (diff) | |
| parent | 872781b22697882051481a4ed7c764551a8b2cf2 (diff) | |
| download | rust-0dff16a30ccfed16ba397c2f2dbed25475329dab.tar.gz rust-0dff16a30ccfed16ba397c2f2dbed25475329dab.zip | |
Merge from rustc
Diffstat (limited to 'tests/codegen')
| -rw-r--r-- | tests/codegen/dont_codegen_private_const_fn_only_used_in_const_eval.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/codegen/dont_codegen_private_const_fn_only_used_in_const_eval.rs b/tests/codegen/dont_codegen_private_const_fn_only_used_in_const_eval.rs new file mode 100644 index 00000000000..eeeaebe52dd --- /dev/null +++ b/tests/codegen/dont_codegen_private_const_fn_only_used_in_const_eval.rs @@ -0,0 +1,10 @@ +//! This test checks that we do not monomorphize functions that are only +//! used to evaluate static items, but never used in runtime code. + +//@compile-flags: --crate-type=lib -Copt-level=0 + +const fn foo() {} + +pub static FOO: () = foo(); + +// CHECK-NOT: define{{.*}}foo{{.*}} |
