7
7
// gdb-command:run
8
8
// gdb-command:print a
9
9
// gdb-check:$1 = 5
10
- // gdb-command:print d
10
+ // gdb-command:print c
11
11
// gdb-check:$2 = 6
12
+ // gdb-command:print d
13
+ // gdb-check:$3 = 7
14
+ // gdb-command:continue
15
+ // gdb-command:print a
16
+ // gdb-check:$4 = 7
17
+ // gdb-command:print c
18
+ // gdb-check:$5 = 6
19
+ // gdb-command:print e
20
+ // gdb-check:$6 = 8
21
+ // gdb-command:continue
22
+ // gdb-command:print a
23
+ // gdb-check:$7 = 8
24
+ // gdb-command:print c
25
+ // gdb-check:$8 = 6
12
26
13
27
// === LLDB TESTS ==================================================================================
14
28
15
29
// lldb-command:run
16
30
// lldb-command:print a
17
31
// lldbg-check:(int) $0 = 5
18
32
// lldbr-check:(int) a = 5
19
- // lldb-command:print d
33
+ // lldb-command:print c
20
34
// lldbg-check:(int) $1 = 6
21
- // lldbr-check:(int) d = 6
35
+ // lldbr-check:(int) c = 6
36
+ // lldb-command:print d
37
+ // lldbg-check:(int) $2 = 7
38
+ // lldbr-check:(int) d = 7
39
+ // lldb-command:continue
40
+ // lldb-command:print a
41
+ // lldbg-check:(int) $3 = 7
42
+ // lldbr-check:(int) a = 7
43
+ // lldb-command:print c
44
+ // lldbg-check:(int) $4 = 6
45
+ // lldbr-check:(int) c = 6
46
+ // lldb-command:print e
47
+ // lldbg-check:(int) $5 = 8
48
+ // lldbr-check:(int) e = 8
49
+ // lldb-command:continue
50
+ // lldb-command:print a
51
+ // lldbg-check:(int) $6 = 8
52
+ // lldbr-check:(int) a = 8
53
+ // lldb-command:print c
54
+ // lldbg-check:(int) $7 = 6
55
+ // lldbr-check:(int) c = 6
22
56
23
57
#![ feature( omit_gdb_pretty_printer_section, generators, generator_trait) ]
24
58
#![ omit_gdb_pretty_printer_section]
@@ -29,13 +63,24 @@ use std::pin::Pin;
29
63
fn main ( ) {
30
64
let mut a = 5 ;
31
65
let mut b = || {
32
- let d = 6 ;
66
+ let c = 6 ; // Live across multiple yield points
67
+
68
+ let d = 7 ; // Live across only one yield point
33
69
yield ;
34
70
_zzz ( ) ; // #break
35
71
a = d;
72
+
73
+ let e = 8 ; // Live across zero yield points
74
+ _zzz ( ) ; // #break
75
+ a = e;
76
+
77
+ yield ;
78
+ _zzz ( ) ; // #break
79
+ a = c;
36
80
} ;
37
81
Pin :: new ( & mut b) . resume ( ) ;
38
82
Pin :: new ( & mut b) . resume ( ) ;
83
+ Pin :: new ( & mut b) . resume ( ) ;
39
84
_zzz ( ) ; // #break
40
85
}
41
86
0 commit comments