about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorWim Looman <wim@nemo157.com>2018-11-07 10:33:35 +0100
committerWim Looman <wim@nemo157.com>2019-01-27 22:58:59 +0100
commite7d66758cfce4dc2c87e3224b6ed47aee1fee257 (patch)
tree5dace82fecd4589422e4c555a1d4b066abd99d6c /src/test
parentbe3989301aea41777bdbc65d5c3537b7036ec407 (diff)
downloadrust-e7d66758cfce4dc2c87e3224b6ed47aee1fee257.tar.gz
rust-e7d66758cfce4dc2c87e3224b6ed47aee1fee257.zip
Update generator upvar debug info
Diffstat (limited to 'src/test')
-rw-r--r--src/test/debuginfo/generators.rs36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/test/debuginfo/generators.rs b/src/test/debuginfo/generators.rs
new file mode 100644
index 00000000000..b56d222e0e0
--- /dev/null
+++ b/src/test/debuginfo/generators.rs
@@ -0,0 +1,36 @@
+// min-lldb-version: 310
+
+// compile-flags:-g
+
+// === GDB TESTS ===================================================================================
+
+// gdb-command:run
+// gdb-command:print a
+// gdb-check:$1 = 5
+
+// === LLDB TESTS ==================================================================================
+
+// lldb-command:run
+// lldb-command:print a
+// lldbg-check:(int) $0 = 5
+// lldbr-check:(int) a = 5
+
+#![feature(omit_gdb_pretty_printer_section, generators, generator_trait, pin)]
+#![omit_gdb_pretty_printer_section]
+
+use std::ops::Generator;
+use std::pin::Pin;
+
+fn main() {
+    let mut a = 5;
+    let mut b = || {
+        yield;
+        _zzz(); // #break
+        a = 6;
+    };
+    Pin::new(&mut b).resume();
+    Pin::new(&mut b).resume();
+    _zzz(); // #break
+}
+
+fn _zzz() {()}