diff options
| author | The Miri Cronjob Bot <miri@cron.bot> | 2025-02-03 05:02:55 +0000 |
|---|---|---|
| committer | The Miri Cronjob Bot <miri@cron.bot> | 2025-02-03 05:02:55 +0000 |
| commit | 45c3b3d4803631ac4c0061edfbc3213eaaa86fda (patch) | |
| tree | abff4fa9ad66a86a870d05cc7938d5a698a19369 /tests/codegen | |
| parent | 3f57fc170aab2da57ff0c695051bfd26571b9391 (diff) | |
| parent | d6ca7ad0d7a7e8acd14f6da3bad4e7b5a25c3d17 (diff) | |
| download | rust-45c3b3d4803631ac4c0061edfbc3213eaaa86fda.tar.gz rust-45c3b3d4803631ac4c0061edfbc3213eaaa86fda.zip | |
Merge from rustc
Diffstat (limited to 'tests/codegen')
| -rw-r--r-- | tests/codegen/issues/issue-136329-optnone-noinline.rs | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/codegen/issues/issue-136329-optnone-noinline.rs b/tests/codegen/issues/issue-136329-optnone-noinline.rs new file mode 100644 index 00000000000..57c9e47a499 --- /dev/null +++ b/tests/codegen/issues/issue-136329-optnone-noinline.rs @@ -0,0 +1,21 @@ +//! Ensure that `#[optimize(none)]` functions are never inlined + +//@ compile-flags: -Copt-level=3 + +#![feature(optimize_attribute)] + +#[optimize(none)] +pub fn foo() { + let _x = 123; +} + +// CHECK-LABEL: define{{.*}}void @bar +// CHECK: start: +// CHECK: {{.*}}call {{.*}}void +// CHECK: ret void +#[no_mangle] +pub fn bar() { + foo(); +} + +fn main() {} |
