summary refs log tree commit diff
path: root/tests/codegen-units
diff options
context:
space:
mode:
authorBen Kimock <kimockb@gmail.com>2023-10-06 20:29:42 -0400
committerBen Kimock <kimockb@gmail.com>2023-10-17 19:53:51 -0400
commit33b0e4be060c8a3f5cc86b6a3e89d8e980a9a51b (patch)
tree79040aac88d1e13a620fd8d730822a727a6cf323 /tests/codegen-units
parent09df6108c84fdec400043d99d9ee232336fd5a9f (diff)
downloadrust-33b0e4be060c8a3f5cc86b6a3e89d8e980a9a51b.tar.gz
rust-33b0e4be060c8a3f5cc86b6a3e89d8e980a9a51b.zip
Automatically enable cross-crate inlining for small functions
Diffstat (limited to 'tests/codegen-units')
-rw-r--r--tests/codegen-units/item-collection/asm-sym.rs3
-rw-r--r--tests/codegen-units/item-collection/auxiliary/cgu_export_trait_method.rs2
-rw-r--r--tests/codegen-units/item-collection/cross-crate-trait-method.rs2
-rw-r--r--tests/codegen-units/item-collection/items-within-generic-items.rs2
-rw-r--r--tests/codegen-units/item-collection/unreferenced-const-fn.rs1
5 files changed, 8 insertions, 2 deletions
diff --git a/tests/codegen-units/item-collection/asm-sym.rs b/tests/codegen-units/item-collection/asm-sym.rs
index 8bafb95bc16..4b05b771a9b 100644
--- a/tests/codegen-units/item-collection/asm-sym.rs
+++ b/tests/codegen-units/item-collection/asm-sym.rs
@@ -6,15 +6,18 @@ pub unsafe fn f() {
     //~ MONO_ITEM static f::S @@ asm_sym-cgu.0[External]
     static S: usize = 1;
     //~ MONO_ITEM fn f::fun @@ asm_sym-cgu.0[External]
+    #[inline(never)]
     fn fun() {}
     core::arch::asm!("/* {0} {1} */", sym S, sym fun);
 }
 
 //~ MONO_ITEM fn g @@ asm_sym-cgu.0[External]
+#[inline(never)]
 pub unsafe fn g() {
     //~ MONO_ITEM static g::S @@ asm_sym-cgu.0[Internal]
     static S: usize = 2;
     //~ MONO_ITEM fn g::fun @@ asm_sym-cgu.0[Internal]
+    #[inline(never)]
     fn fun() {}
     core::arch::asm!("/* {0} {1} */", sym S, sym fun);
 }
diff --git a/tests/codegen-units/item-collection/auxiliary/cgu_export_trait_method.rs b/tests/codegen-units/item-collection/auxiliary/cgu_export_trait_method.rs
index ecea26dc4be..e94dded55cf 100644
--- a/tests/codegen-units/item-collection/auxiliary/cgu_export_trait_method.rs
+++ b/tests/codegen-units/item-collection/auxiliary/cgu_export_trait_method.rs
@@ -1,3 +1,5 @@
+// compile-flags: -Copt-level=0
+
 #![crate_type = "lib"]
 
 pub trait Trait : Sized {
diff --git a/tests/codegen-units/item-collection/cross-crate-trait-method.rs b/tests/codegen-units/item-collection/cross-crate-trait-method.rs
index b7216a14318..778b3820f18 100644
--- a/tests/codegen-units/item-collection/cross-crate-trait-method.rs
+++ b/tests/codegen-units/item-collection/cross-crate-trait-method.rs
@@ -1,4 +1,4 @@
-// compile-flags:-Zprint-mono-items=eager -Zinline-mir=no
+// compile-flags:-Zprint-mono-items=eager -Zinline-mir=no -Copt-level=0
 
 #![deny(dead_code)]
 #![feature(start)]
diff --git a/tests/codegen-units/item-collection/items-within-generic-items.rs b/tests/codegen-units/item-collection/items-within-generic-items.rs
index d37d7f7d9b2..bb1a3be36c5 100644
--- a/tests/codegen-units/item-collection/items-within-generic-items.rs
+++ b/tests/codegen-units/item-collection/items-within-generic-items.rs
@@ -1,4 +1,4 @@
-// compile-flags:-Zprint-mono-items=eager
+// compile-flags:-Zprint-mono-items=eager -Copt-level=0
 
 #![deny(dead_code)]
 #![feature(start)]
diff --git a/tests/codegen-units/item-collection/unreferenced-const-fn.rs b/tests/codegen-units/item-collection/unreferenced-const-fn.rs
index 17b92eae00d..5f59d801504 100644
--- a/tests/codegen-units/item-collection/unreferenced-const-fn.rs
+++ b/tests/codegen-units/item-collection/unreferenced-const-fn.rs
@@ -4,6 +4,7 @@
 #![crate_type = "rlib"]
 
 //~ MONO_ITEM fn foo @@ unreferenced_const_fn-cgu.0[External]
+#[inline(never)]
 pub const fn foo(x: u32) -> u32 {
     x + 0xf00
 }