summaryrefslogtreecommitdiffstats
path: root/tests/codegen/local-generics-in-exe-internalized.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/codegen/local-generics-in-exe-internalized.rs')
-rw-r--r--tests/codegen/local-generics-in-exe-internalized.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/codegen/local-generics-in-exe-internalized.rs b/tests/codegen/local-generics-in-exe-internalized.rs
new file mode 100644
index 000000000..e5430fbf1
--- /dev/null
+++ b/tests/codegen/local-generics-in-exe-internalized.rs
@@ -0,0 +1,14 @@
+// compile-flags: -C no-prepopulate-passes -Zshare-generics=yes
+
+// Check that local generics are internalized if they are in the same CGU
+
+// CHECK-LABEL: ; local_generics_in_exe_internalized::foo
+// CHECK-NEXT: ; Function Attrs:
+// CHECK-NEXT: define internal
+pub fn foo<T>(x: T, y: T) -> (T, T) {
+ (x, y)
+}
+
+fn main() {
+ let _ = foo(0u8, 1u8);
+}