diff options
| author | bors <bors@rust-lang.org> | 2023-08-29 02:23:43 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2023-08-29 02:23:43 +0000 |
| commit | f3284dc3ad9254236d296daa1285dd273b492b01 (patch) | |
| tree | 3d331a48ff6ea3ffd524c11a15156a91a1149877 /tests/codegen | |
| parent | fef2f5907f4d59586e47be182d42c7a934dc3156 (diff) | |
| parent | 754f488d46fa33387c3dca3b08d3f3ec2fe02d3f (diff) | |
| download | rust-f3284dc3ad9254236d296daa1285dd273b492b01.tar.gz rust-f3284dc3ad9254236d296daa1285dd273b492b01.zip | |
Auto merge of #115260 - scottmcm:not-quite-so-cold, r=WaffleLapkin
Use `preserve_mostcc` for `extern "rust-cold"` As experimentation in #115242 has shown looks better than `coldcc`. Notably, clang exposes `preserve_most` (https://clang.llvm.org/docs/AttributeReference.html#preserve-most) but not `cold`, so this change should put us on a better-supported path. And *don't* use a different convention for cold on Windows, because that actually ends up making things worse. (See comment in the code.) cc tracking issue #97544
Diffstat (limited to 'tests/codegen')
| -rw-r--r-- | tests/codegen/cold-call-declare-and-call.rs | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/tests/codegen/cold-call-declare-and-call.rs b/tests/codegen/cold-call-declare-and-call.rs index 71d49478bfc..572dc407f51 100644 --- a/tests/codegen/cold-call-declare-and-call.rs +++ b/tests/codegen/cold-call-declare-and-call.rs @@ -1,12 +1,21 @@ +// revisions: NORMAL WINDOWS // compile-flags: -C no-prepopulate-passes +//[NORMAL] ignore-windows +//[WINDOWS] only-windows +//[WINDOWS] only-x86_64 #![crate_type = "lib"] #![feature(rust_cold_cc)] // wasm marks the definition as `dso_local`, so allow that as optional. -// CHECK: define{{( dso_local)?}} coldcc void @this_should_never_happen(i16 -// CHECK: call coldcc void @this_should_never_happen(i16 +// NORMAL: define{{( dso_local)?}} preserve_mostcc void @this_should_never_happen(i16 +// NORMAL: call preserve_mostcc void @this_should_never_happen(i16 + +// See the comment in `Target::adjust_abi` for why this differs + +// WINDOWS: define void @this_should_never_happen(i16 +// WINDOWS: call void @this_should_never_happen(i16 #[no_mangle] pub extern "rust-cold" fn this_should_never_happen(x: u16) {} |
