summaryrefslogtreecommitdiffstats
path: root/tests/ui/mir/mir-inlining/always-encode-mirs.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/mir/mir-inlining/always-encode-mirs.rs')
-rw-r--r--tests/ui/mir/mir-inlining/always-encode-mirs.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/ui/mir/mir-inlining/always-encode-mirs.rs b/tests/ui/mir/mir-inlining/always-encode-mirs.rs
new file mode 100644
index 000000000..f3731996c
--- /dev/null
+++ b/tests/ui/mir/mir-inlining/always-encode-mirs.rs
@@ -0,0 +1,12 @@
+// Regression test for MIR inlining with -Zalways-encode-mir enabled in the auxiliary crate.
+// Previously we inlined function not eligible for inlining which lead to linking error:
+// undefined reference to `internal::S'
+//
+// aux-build:internal.rs
+// build-pass
+// compile-flags: -O
+extern crate internal;
+
+fn main() {
+ println!("{}", internal::f());
+}