about summary refs log tree commit diff
path: root/tests/codegen
diff options
context:
space:
mode:
authorThe Miri Cronjob Bot <miri@cron.bot>2025-02-03 05:02:55 +0000
committerThe Miri Cronjob Bot <miri@cron.bot>2025-02-03 05:02:55 +0000
commit45c3b3d4803631ac4c0061edfbc3213eaaa86fda (patch)
treeabff4fa9ad66a86a870d05cc7938d5a698a19369 /tests/codegen
parent3f57fc170aab2da57ff0c695051bfd26571b9391 (diff)
parentd6ca7ad0d7a7e8acd14f6da3bad4e7b5a25c3d17 (diff)
downloadrust-45c3b3d4803631ac4c0061edfbc3213eaaa86fda.tar.gz
rust-45c3b3d4803631ac4c0061edfbc3213eaaa86fda.zip
Merge from rustc
Diffstat (limited to 'tests/codegen')
-rw-r--r--tests/codegen/issues/issue-136329-optnone-noinline.rs21
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() {}