about summary refs log tree commit diff
path: root/tests/mir-opt/inline/inline_coroutine.rs
diff options
context:
space:
mode:
authorOli Scherer <git-spam-no-reply9815368754983@oli-obk.de>2023-10-19 21:46:28 +0000
committerOli Scherer <git-spam-no-reply9815368754983@oli-obk.de>2023-10-20 21:14:01 +0000
commite96ce20b34789d29e925425da6cf138927b80a79 (patch)
tree4032e01ddd5137d1ee98b69277953f2962bbf14b /tests/mir-opt/inline/inline_coroutine.rs
parent60956837cfbf22bd8edd80f57a856e141f7deb8c (diff)
downloadrust-e96ce20b34789d29e925425da6cf138927b80a79.tar.gz
rust-e96ce20b34789d29e925425da6cf138927b80a79.zip
s/generator/coroutine/
Diffstat (limited to 'tests/mir-opt/inline/inline_coroutine.rs')
-rw-r--r--tests/mir-opt/inline/inline_coroutine.rs18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/mir-opt/inline/inline_coroutine.rs b/tests/mir-opt/inline/inline_coroutine.rs
new file mode 100644
index 00000000000..d021cdac28e
--- /dev/null
+++ b/tests/mir-opt/inline/inline_coroutine.rs
@@ -0,0 +1,18 @@
+// skip-filecheck
+// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
+// compile-flags: -Zinline-mir-hint-threshold=1000
+#![feature(coroutines, coroutine_trait)]
+
+use std::ops::Coroutine;
+use std::pin::Pin;
+
+// EMIT_MIR inline_coroutine.main.Inline.diff
+fn main() {
+    let _r = Pin::new(&mut g()).resume(false);
+}
+
+#[inline]
+pub fn g() -> impl Coroutine<bool> {
+    #[inline]
+    |a| { yield if a { 7 } else { 13 } }
+}