diff options
| author | Scott McMurray <scottmcm@users.noreply.github.com> | 2022-05-29 00:25:14 -0700 |
|---|---|---|
| committer | Scott McMurray <scottmcm@users.noreply.github.com> | 2022-05-30 00:19:23 -0700 |
| commit | e90be842fb9129aa27e5b6412f245ca39999f9f1 (patch) | |
| tree | 96cc6b49f01fae44002f56140f28014cceaa07e4 /src/test/codegen | |
| parent | 0acc4a35853215a6f9388ab61455ced309711003 (diff) | |
| download | rust-e90be842fb9129aa27e5b6412f245ca39999f9f1.tar.gz rust-e90be842fb9129aa27e5b6412f245ca39999f9f1.zip | |
Add support for emitting functions with `coldcc` in LLVM
The eventual goal is to try using this for things like the internal panicking stuff, to see whether it helps.
Diffstat (limited to 'src/test/codegen')
| -rw-r--r-- | src/test/codegen/cold-call-declare-and-call.rs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/test/codegen/cold-call-declare-and-call.rs b/src/test/codegen/cold-call-declare-and-call.rs new file mode 100644 index 00000000000..14fb8deb4fd --- /dev/null +++ b/src/test/codegen/cold-call-declare-and-call.rs @@ -0,0 +1,16 @@ +// compile-flags: -C no-prepopulate-passes + +#![crate_type = "lib"] +#![feature(rust_cold_cc)] + +// CHECK: define coldcc void @this_should_never_happen(i16 +// CHECK: call coldcc void @this_should_never_happen(i16 + +#[no_mangle] +pub extern "rust-cold" fn this_should_never_happen(x: u16) {} + +pub fn do_things(x: u16) { + if x == 12345 { + this_should_never_happen(54321); + } +} |
