2018-11-07 09:33:35 +00:00
|
|
|
// min-lldb-version: 310
|
|
|
|
|
|
|
|
// compile-flags:-g
|
|
|
|
|
|
|
|
// === GDB TESTS ===================================================================================
|
|
|
|
|
|
|
|
// gdb-command:run
|
|
|
|
// gdb-command:print a
|
|
|
|
// gdb-check:$1 = 5
|
2019-03-21 21:35:54 +00:00
|
|
|
// gdb-command:print c
|
2018-11-07 21:45:21 +00:00
|
|
|
// gdb-check:$2 = 6
|
2019-03-21 21:35:54 +00:00
|
|
|
// gdb-command:print d
|
|
|
|
// gdb-check:$3 = 7
|
|
|
|
// gdb-command:continue
|
|
|
|
// gdb-command:print a
|
|
|
|
// gdb-check:$4 = 7
|
|
|
|
// gdb-command:print c
|
|
|
|
// gdb-check:$5 = 6
|
|
|
|
// gdb-command:print e
|
|
|
|
// gdb-check:$6 = 8
|
|
|
|
// gdb-command:continue
|
|
|
|
// gdb-command:print a
|
|
|
|
// gdb-check:$7 = 8
|
|
|
|
// gdb-command:print c
|
|
|
|
// gdb-check:$8 = 6
|
2018-11-07 09:33:35 +00:00
|
|
|
|
|
|
|
// === LLDB TESTS ==================================================================================
|
|
|
|
|
|
|
|
// lldb-command:run
|
|
|
|
// lldb-command:print a
|
|
|
|
// lldbg-check:(int) $0 = 5
|
|
|
|
// lldbr-check:(int) a = 5
|
2019-03-21 21:35:54 +00:00
|
|
|
// lldb-command:print c
|
2018-11-07 21:45:21 +00:00
|
|
|
// lldbg-check:(int) $1 = 6
|
2019-03-21 21:35:54 +00:00
|
|
|
// lldbr-check:(int) c = 6
|
|
|
|
// lldb-command:print d
|
|
|
|
// lldbg-check:(int) $2 = 7
|
|
|
|
// lldbr-check:(int) d = 7
|
|
|
|
// lldb-command:continue
|
|
|
|
// lldb-command:print a
|
|
|
|
// lldbg-check:(int) $3 = 7
|
|
|
|
// lldbr-check:(int) a = 7
|
|
|
|
// lldb-command:print c
|
|
|
|
// lldbg-check:(int) $4 = 6
|
|
|
|
// lldbr-check:(int) c = 6
|
|
|
|
// lldb-command:print e
|
|
|
|
// lldbg-check:(int) $5 = 8
|
|
|
|
// lldbr-check:(int) e = 8
|
|
|
|
// lldb-command:continue
|
|
|
|
// lldb-command:print a
|
|
|
|
// lldbg-check:(int) $6 = 8
|
|
|
|
// lldbr-check:(int) a = 8
|
|
|
|
// lldb-command:print c
|
|
|
|
// lldbg-check:(int) $7 = 6
|
|
|
|
// lldbr-check:(int) c = 6
|
2018-11-07 09:33:35 +00:00
|
|
|
|
2018-11-07 21:45:21 +00:00
|
|
|
#![feature(omit_gdb_pretty_printer_section, generators, generator_trait)]
|
2018-11-07 09:33:35 +00:00
|
|
|
#![omit_gdb_pretty_printer_section]
|
|
|
|
|
|
|
|
use std::ops::Generator;
|
|
|
|
use std::pin::Pin;
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let mut a = 5;
|
|
|
|
let mut b = || {
|
2019-03-21 21:35:54 +00:00
|
|
|
let c = 6; // Live across multiple yield points
|
|
|
|
|
|
|
|
let d = 7; // Live across only one yield point
|
2018-11-07 09:33:35 +00:00
|
|
|
yield;
|
|
|
|
_zzz(); // #break
|
2018-11-07 21:45:21 +00:00
|
|
|
a = d;
|
2019-03-21 21:35:54 +00:00
|
|
|
|
|
|
|
let e = 8; // Live across zero yield points
|
|
|
|
_zzz(); // #break
|
|
|
|
a = e;
|
|
|
|
|
|
|
|
yield;
|
|
|
|
_zzz(); // #break
|
|
|
|
a = c;
|
2018-11-07 09:33:35 +00:00
|
|
|
};
|
2020-01-25 19:03:10 +00:00
|
|
|
Pin::new(&mut b).resume(());
|
|
|
|
Pin::new(&mut b).resume(());
|
|
|
|
Pin::new(&mut b).resume(());
|
2018-11-07 09:33:35 +00:00
|
|
|
_zzz(); // #break
|
|
|
|
}
|
|
|
|
|
|
|
|
fn _zzz() {()}
|