summaryrefslogtreecommitdiffstats
path: root/tests/codegen-units/partitioning/auxiliary/cgu_generic_function.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:13 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:13 +0000
commit218caa410aa38c29984be31a5229b9fa717560ee (patch)
treec54bd55eeb6e4c508940a30e94c0032fbd45d677 /tests/codegen-units/partitioning/auxiliary/cgu_generic_function.rs
parentReleasing progress-linux version 1.67.1+dfsg1-1~progress7.99u1. (diff)
downloadrustc-218caa410aa38c29984be31a5229b9fa717560ee.tar.xz
rustc-218caa410aa38c29984be31a5229b9fa717560ee.zip
Merging upstream version 1.68.2+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/codegen-units/partitioning/auxiliary/cgu_generic_function.rs')
-rw-r--r--tests/codegen-units/partitioning/auxiliary/cgu_generic_function.rs26
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/codegen-units/partitioning/auxiliary/cgu_generic_function.rs b/tests/codegen-units/partitioning/auxiliary/cgu_generic_function.rs
new file mode 100644
index 000000000..3926f2957
--- /dev/null
+++ b/tests/codegen-units/partitioning/auxiliary/cgu_generic_function.rs
@@ -0,0 +1,26 @@
+#![crate_type = "lib"]
+
+struct Struct(u32);
+
+#[inline(never)]
+pub fn foo<T>(x: T) -> (T, u32, i8) {
+ let (x, Struct(y)) = bar(x);
+ (x, y, 2)
+}
+
+#[inline(never)]
+fn bar<T>(x: T) -> (T, Struct) {
+ let _ = not_exported_and_not_generic(0);
+ (x, Struct(1))
+}
+
+// These should not contribute to the codegen items of other crates.
+#[inline(never)]
+pub fn exported_but_not_generic(x: i32) -> i64 {
+ x as i64
+}
+
+#[inline(never)]
+fn not_exported_and_not_generic(x: u32) -> u64 {
+ x as u64
+}