]> gitweb.factorcode.org Git - factor.git/blob - basis/compiler/cfg/stacks/padding/padding-tests.factor
Rename and add sorting words
[factor.git] / basis / compiler / cfg / stacks / padding / padding-tests.factor
1 USING: accessors arrays assocs compiler.cfg.instructions compiler.cfg.registers
2 compiler.cfg.stacks.padding compiler.cfg.utilities compiler.test kernel
3 sequences sorting vectors tools.test ;
4 IN: compiler.cfg.stacks.padding.tests
5
6 ! classify-read: initialized locations
7 { 0 0 0 } [
8     { 3 { } } 2 classify-read
9     ! Negative locations aren't tracked really.
10     { 0 { } } -1 classify-read
11     { 3 { } } -1 classify-read
12 ] unit-test
13
14 ! classify-read: over locations
15 { 1 1 1 1 1 } [
16     { 1 { 0 } } 1 classify-read
17     { 0 { } } 0 classify-read
18     { 3 { } } 4 classify-read
19     { 0 { } } 4 classify-read
20     { 1 { 0 } } 4 classify-read
21 ] unit-test
22
23 ! classify-read: vacant locations
24 { 2 2 2 } [
25     { 1 { 0 } } 0 classify-read
26     { 2 { 0 1 2 } } 0 classify-read
27     { 0 { 0 1 2 } } 0 classify-read
28 ] unit-test
29
30 ! all-live
31 {
32     { { 0 { } } { 2 { } } }
33     { { 0 { } } { 2 { } } }
34 } [
35     { { 0 { } } { 2 { } } } all-live
36     { { 0 { } } { 2 { 0 } } } all-live
37 ] unit-test
38
39 ! combine-states
40 {
41     { { 4 { } } { 2 { 0 1 } } }
42 } [
43     V{ { { 4 { } } { 2 { 0 1 } } } } combine-states
44 ] unit-test
45
46 {
47     { { 2 { 0 1 } } { 2 { 0 1 } } }
48 } [
49     V{
50         { { 2 { 0 1 } } { 2 { } } }
51         { { 2 { } } { 2 { 0 1 } } }
52     } combine-states
53 ] unit-test
54
55 {
56     { { 0 { } } { 0 { } } }
57 } [
58     V{ } combine-states
59 ] unit-test
60
61 ! visit-insn ##inc
62
63 ! We assume that overinitialized locations are always dead.
64 {
65     { { 0 { } } { 0 { } } }
66 } [
67     { { 3 { 0 } } { 0 { } } } T{ ##inc { loc D: -3 } } visit-insn
68 ] unit-test
69
70 {
71     { { 3 { 0 1 2 } } { 0 { } } }
72 } [
73     { { 0 { } } { 0 { } } } T{ ##inc { loc D: 3 } } visit-insn
74 ] unit-test
75
76 ! visit-insn ##call
77 {
78     { { 0 { } } { 0 { } } }
79 } [
80     initial-state T{ ##call } visit-insn
81 ] unit-test
82
83 ! if any of the stack locations are uninitialized when ##call is
84 ! visisted then something is wrong. ##call might gc and the
85 ! uninitialized locations would cause a crash.
86 [
87     { { 3 { 0 1 2 } } { 0 { } } } T{ ##call } visit-insn
88 ] [ vacant-when-calling? ] must-fail-with
89
90 ! visit-insn ##call-gc
91
92 ! ##call-gc ofcourse fills all uninitialized locations. ##peek still
93 ! shouldn't look at them, but if we gc again we don't need to exept ##them.
94 {
95     { { 4 { } } { 0 { } } }
96 } [
97     { { 4 { 0 1 2 3 } } { 0 { } } } T{ ##call-gc } visit-insn
98 ] unit-test
99
100 ! visit-insn ##peek
101 {
102     { { 3 { 0 } } { 0 { } } }
103 } [
104     { { 3 { 0 } } { 0 { } } } T{ ##peek { dst 1 } { loc D: 1 } } visit-insn
105 ] unit-test
106
107 ! After a ##peek that can cause a stack underflow, it is certain that
108 ! all stack locations are initialized.
109 {
110     { { 0 { } } { 2 { } } }
111     { { 2 { } } { 0 { } } }
112 } [
113     { { 0 { } } { 2 { 0 1 } } } T{ ##peek { dst 1 } { loc R: 2 } } visit-insn
114     { { 2 { 0 1 } } { 0 { } } } T{ ##peek { dst 1 } { loc D: 2 } } visit-insn
115 ] unit-test
116
117 ! If the ##peek can't cause a stack underflow, then we don't have the
118 ! same guarantees.
119 [
120     { { 3 { 0 1 2 } } { 0 { } } } T{ ##peek { dst 1 } { loc D: 0 } } visit-insn
121 ] [ vacant-peek? ] must-fail-with
122
123 : following-stack-state ( insns -- state )
124     T{ ##branch } suffix insns>cfg trace-stack-state
125     >alist [ first ] sort-by last second ;
126
127 ! trace-stack-state
128 {
129     H{
130         {
131             0
132             { { 0 { } } { 0 { } } }
133         }
134         {
135             1
136             { { 2 { 0 1 } } { 0 { } } }
137         }
138         {
139             2
140             { { 2 { } } { 0 { } } }
141         }
142     }
143 } [
144     {
145         T{ ##inc f D: 2 }
146         T{ ##peek f f D: 2 }
147         T{ ##inc f D: 0 }
148     } insns>cfg trace-stack-state
149 ] unit-test
150
151 {
152     H{
153         { 0 { { 0 { } } { 0 { } } } }
154         { 1 { { 0 { } } { 0 { } } } }
155         { 2 { { 0 { } } { 0 { } } } }
156     }
157 } [
158     V{ T{ ##safepoint } T{ ##prologue } T{ ##branch } }
159     insns>cfg trace-stack-state
160 ] unit-test
161
162 ! The peek "causes" the vacant locations to become populated.
163 {
164     H{
165         { 0 { { 0 { } } { 0 { } } } }
166         { 1 { { 3 { 0 1 2 } } { 0 { } } } }
167         { 2 { { 3 { } } { 0 { } } } }
168     }
169 } [
170     V{
171         T{ ##inc f D: 3 }
172         T{ ##peek { loc D: 3 } }
173         T{ ##branch }
174     }
175     insns>cfg trace-stack-state
176 ] unit-test
177
178 : cfg1 ( -- cfg )
179     V{
180         T{ ##inc f D: 1 }
181         T{ ##replace { src 10 } { loc D: 0 } }
182     } 0 insns>block
183     V{
184         T{ ##peek { dst 37 } { loc D: 0 } }
185         T{ ##inc f D: -1 }
186     } 1 insns>block
187     1vector >>successors block>cfg ;
188
189 {
190     H{
191         { 0 { { 0 { } } { 0 { } } } }
192         { 1 { { 1 { 0 } } { 0 { } } } }
193         { 2 { { 1 { } } { 0 { } } } }
194         { 3 { { 1 { } } { 0 { } } } }
195     }
196 } [ cfg1 trace-stack-state ] unit-test
197
198 ! Same cfg structure as the bug1021:run-test word but with
199 ! non-datastack instructions mostly omitted.
200 : bug1021-cfg ( -- cfg )
201     {
202         { 0 V{ T{ ##safepoint } T{ ##prologue } T{ ##branch } } }
203         {
204             1 V{
205                 T{ ##inc f D: 2 }
206                 T{ ##replace { src 0 } { loc D: 1 } }
207                 T{ ##replace { src 0 } { loc D: 0 } }
208             }
209         }
210         {
211             2 V{
212                 T{ ##call { word <array> } }
213             }
214         }
215         {
216             3 V{
217                 T{ ##peek { dst 0 } { loc D: 0 } }
218                 T{ ##peek { dst 0 } { loc D: 1 } }
219                 T{ ##inc f D: 2 }
220                 T{ ##replace { src 0 } { loc D: 2 } }
221                 T{ ##replace { src 0 } { loc D: 3 } }
222                 T{ ##replace { src 0 } { loc D: 1 } }
223             }
224         }
225         {
226             8 V{
227                 T{ ##peek { dst 0 } { loc D: 2 } }
228                 T{ ##peek { dst 0 } { loc D: 1 } }
229                 T{ ##inc f D: 3 }
230                 T{ ##replace { src 0 } { loc D: 0 } }
231                 T{ ##replace { src 0 } { loc D: 1 } }
232                 T{ ##replace { src 0 } { loc D: 2 } }
233                 T{ ##replace { src 0 } { loc D: 3 } }
234             }
235         }
236         {
237             10 V{
238                 T{ ##inc f D: -3 }
239                 T{ ##peek { dst 0 } { loc D: 0 } }
240                 T{ ##alien-invoke { gc-map T{ gc-map } } }
241             }
242         }
243     } [ over insns>block ] assoc-map dup
244     { { 0 1 } { 1 2 } { 2 3 } { 3 8 } { 8 10 } } make-edges 0 of block>cfg ;
245
246 {
247     H{
248         { 0 { { 0 { } } { 0 { } } } }
249         { 1 { { 0 { } } { 0 { } } } }
250         { 2 { { 0 { } } { 0 { } } } }
251         { 3 { { 0 { } } { 0 { } } } }
252         { 4 { { 2 { 0 1 } } { 0 { } } } }
253         { 5 { { 2 { 0 } } { 0 { } } } }
254         { 6 { { 2 { } } { 0 { } } } }
255         { 7 { { 2 { } } { 0 { } } } }
256         { 8 { { 2 { } } { 0 { } } } }
257         { 9 { { 2 { } } { 0 { } } } }
258         { 10 { { 4 { 0 1 } } { 0 { } } } }
259         { 11 { { 4 { 0 1 } } { 0 { } } } }
260         { 12 { { 4 { 0 1 } } { 0 { } } } }
261         { 13 { { 4 { 0 } } { 0 { } } } }
262         { 14 { { 4 { 0 } } { 0 { } } } }
263         { 15 { { 4 { 0 } } { 0 { } } } }
264         { 16 { { 7 { 3 0 1 2 } } { 0 { } } } }
265         { 17 { { 7 { 3 1 2 } } { 0 { } } } }
266         { 18 { { 7 { 3 2 } } { 0 { } } } }
267         { 19 { { 7 { 3 } } { 0 { } } } }
268         { 20 { { 7 { } } { 0 { } } } }
269         { 21 { { 4 { } } { 0 { } } } }
270         ! gc-map here with nothing to scrub
271         { 22 { { 4 { } } { 0 { } } } }
272     }
273 } [
274     bug1021-cfg trace-stack-state
275 ] unit-test
276
277 ! Same cfg structure as the bug1289:run-test word but with
278 ! non-datastack instructions mostly omitted.
279 : bug1289-cfg ( -- cfg )
280     {
281         { 0 V{ } }
282         {
283             1 V{
284                 T{ ##inc f D: 3 }
285                 T{ ##replace { src 0 } { loc D: 2 } }
286                 T{ ##replace { src 0 } { loc D: 0 } }
287                 T{ ##replace { src 0 } { loc D: 1 } }
288             }
289         }
290         {
291             2 V{
292                 T{ ##call { word <array> } }
293             }
294         }
295         {
296             3 V{
297                 T{ ##peek { dst 0 } { loc D: 1 } }
298                 T{ ##peek { dst 0 } { loc D: 0 } }
299                 T{ ##inc f D: 1 }
300                 T{ ##inc f R: 1 }
301                 T{ ##replace { src 0 } { loc R: 0 } }
302             }
303         }
304         {
305             4 V{ }
306         }
307         {
308             5 V{
309                 T{ ##inc f D: -2 }
310                 T{ ##inc f R: 5 }
311                 T{ ##replace { src 0 } { loc R: 3 } }
312                 T{ ##replace { src 0 } { loc D: 0 } }
313                 T{ ##replace { src 0 } { loc R: 4 } }
314                 T{ ##replace { src 0 } { loc R: 2 } }
315                 T{ ##replace { src 0 } { loc R: 1 } }
316                 T{ ##replace { src 0 } { loc R: 0 } }
317             }
318         }
319         {
320             6 V{
321                 T{ ##call { word f } }
322             }
323         }
324         {
325             7 V{
326                 T{ ##peek { dst 0 } { loc D: 0 } }
327                 T{ ##peek { dst 0 } { loc R: 3 } }
328                 T{ ##peek { dst 0 } { loc R: 2 } }
329                 T{ ##peek { dst 0 } { loc R: 1 } }
330                 T{ ##peek { dst 0 } { loc R: 0 } }
331                 T{ ##peek { dst 0 } { loc R: 4 } }
332                 T{ ##inc f D: 2 }
333                 T{ ##inc f R: -5 }
334             }
335         }
336         { 8 V{ } }
337         { 9 V{ } }
338         { 10 V{ } }
339         {
340             11 V{
341                 T{ ##call-gc }
342             }
343         }
344         {
345             12 V{
346                 T{ ##peek { dst 0 } { loc R: 0 } }
347                 T{ ##inc f D: -3 }
348                 T{ ##inc f D: 1 }
349                 T{ ##inc f R: -1 }
350                 T{ ##replace { src 0 } { loc D: 0 } }
351             }
352         }
353         {
354             13 V{ }
355         }
356     } [ over insns>block ] assoc-map dup
357     {
358         { 0 1 }
359         { 1 2 }
360         { 2 3 }
361         { 3 4 }
362         { 4 9 }
363         { 5 6 }
364         { 6 7 }
365         { 7 8 }
366         { 8 9 }
367         { 9 5 }
368         { 9 10 }
369         { 10 12 }
370         { 10 11 }
371         { 11 12 }
372         { 12 13 }
373     } make-edges 0 of block>cfg ;
374
375 {
376     H{
377         { 0 { { 0 { } } { 0 { } } } }
378         { 1 { { 3 { 0 1 2 } } { 0 { } } } }
379         { 2 { { 3 { 0 1 } } { 0 { } } } }
380         { 3 { { 3 { 1 } } { 0 { } } } }
381         { 4 { { 3 { } } { 0 { } } } }
382         { 5 { { 3 { } } { 0 { } } } }
383         { 6 { { 3 { } } { 0 { } } } }
384         { 7 { { 3 { } } { 0 { } } } }
385         { 8 { { 4 { 0 } } { 0 { } } } }
386         { 9 { { 4 { 0 } } { 1 { 0 } } } }
387         { 10 { { 4 { 0 1 } } { 1 { } } } }
388         { 11 { { 2 { } } { 1 { } } } }
389         { 12 { { 2 { } } { 6 { 0 1 2 3 4 } } } }
390         { 13 { { 2 { } } { 6 { 0 1 2 4 } } } }
391         { 14 { { 2 { } } { 6 { 0 1 2 4 } } } }
392         { 15 { { 2 { } } { 6 { 0 1 2 } } } }
393         { 16 { { 2 { } } { 6 { 0 1 } } } }
394         { 17 { { 2 { } } { 6 { 0 } } } }
395         { 18 { { 2 { } } { 6 { } } } }
396         { 19 { { 2 { } } { 6 { } } } }
397         { 20 { { 2 { } } { 6 { } } } }
398         { 21 { { 2 { } } { 6 { } } } }
399         { 22 { { 2 { } } { 6 { } } } }
400         { 23 { { 2 { } } { 6 { } } } }
401         { 24 { { 2 { } } { 6 { } } } }
402         { 25 { { 2 { } } { 6 { } } } }
403         { 26 { { 4 { 0 1 } } { 6 { } } } }
404         { 27 { { 4 { 0 1 } } { 1 { } } } }
405         ! gc-map here scrubbing D: 0 and D: 1
406         { 28 { { 4 { 0 1 } } { 1 { } } } }
407         { 29 { { 4 { 0 1 } } { 1 { } } } }
408         { 30 { { 1 { } } { 1 { } } } }
409         { 31 { { 2 { 0 } } { 1 { } } } }
410         { 32 { { 2 { 0 } } { 0 { } } } }
411     }
412 } [ bug1289-cfg trace-stack-state ] unit-test
413
414 : bug-benchmark-terrain-cfg ( -- cfg )
415     H{
416         { 0 V{ } }
417         {
418             1 V{
419                 T{ ##peek { loc D: 0 } }
420                 T{ ##peek { loc D: 1 } }
421                 T{ ##inc { loc D: -1 } }
422             }
423         }
424         {
425             2 V{
426                 T{ ##inc { loc D: -1 } }
427                 T{ ##replace { loc D: 1 } }
428                 T{ ##replace { loc D: 0 } }
429                 T{ ##inc { loc D: 1 } }
430                 T{ ##replace { loc D: 0 } }
431             }
432         }
433         { 3 V{ T{ ##call } } }
434         { 4 V{ } }
435         { 5 V{ T{ ##call } } }
436         { 6 V{ T{ ##peek { loc D: 0 } } } }
437         { 7 V{ } }
438         {
439             8 V{
440                 T{ ##replace { loc D: 2 } }
441                 T{ ##replace { loc D: 1 } }
442                 T{ ##replace { loc D: 0 } }
443             }
444         }
445         { 9 V{ T{ ##call } } }
446         {
447             10 V{
448                 T{ ##inc { loc D: 1 } }
449                 T{ ##replace { loc D: 0 } }
450             }
451         }
452         { 11 V{ T{ ##call } } }
453         { 12 V{ } }
454         { 13 V{ T{ ##call } } }
455         { 14 V{ T{ ##peek { loc D: 0 } } } }
456         { 15 V{ } }
457         {
458             16 V{
459                 T{ ##inc { loc D: 1 } }
460                 T{ ##replace { loc D: 0 } }
461             }
462         }
463         { 17 V{ T{ ##call } } }
464         {
465             18 V{
466                 T{ ##peek { loc D: 2 } }
467                 T{ ##peek { loc D: 1 } }
468                 T{ ##peek { loc D: 0 } }
469                 T{ ##inc { loc D: 1 } }
470             }
471         }
472         { 19 V{ } }
473         { 20 V{ } }
474         {
475             21 V{
476                 T{ ##inc { loc D: -3 } }
477                 T{ ##replace { loc D: 0 } }
478             }
479         }
480         { 22 V{ T{ ##call } } }
481         { 23 V{ } }
482         { 24 V{ T{ ##call } } }
483         {
484             25 V{
485                 T{ ##peek { loc D: 0 } }
486                 T{ ##inc { loc D: 3 } }
487             }
488         }
489         { 26 V{ } }
490         { 27 V{ } }
491         { 28 V{ } }
492         { 29 V{ } }
493         { 30 V{ T{ ##call-gc } } }
494         { 31 V{ } }
495         {
496             32 V{
497                 T{ ##inc { loc D: -4 } }
498                 T{ ##inc { loc D: 1 } }
499                 T{ ##replace { loc D: 0 } }
500             }
501         }
502         { 33 V{ } }
503     } [ over insns>block ] assoc-map dup
504     {
505         { 0 1 }
506         { 1 2 } { 1 8 }
507         { 2 3 }
508         { 3 4 }
509         { 4 5 }
510         { 5 6 }
511         { 7 16 }
512         { 8 9 }
513         { 9 10 }
514         { 10 11 }
515         { 11 12 }
516         { 12 13 }
517         { 13 14 }
518         { 14 15 }
519         { 15 16 }
520         { 16 17 }
521         { 17 18 }
522         { 18 19 }
523         { 19 20 }
524         { 20 27 }
525         { 21 22 }
526         { 22 23 }
527         { 23 24 }
528         { 24 25 }
529         { 25 26 }
530         { 26 27 }
531         { 27 28 } { 27 32 }
532         { 28 29 } { 28 30 }
533         { 29 21 }
534         { 20 31 }
535         { 31 21 }
536         { 32 33 }
537     } make-edges 0 of block>cfg ;
538
539 {
540     H{
541         { 0 { { 0 { } } { 0 { } } } }
542         { 1 { { 0 { } } { 0 { } } } }
543         { 2 { { 0 { } } { 0 { } } } }
544         { 3 { { -1 { } } { 0 { } } } }
545         { 4 { { -1 { } } { 0 { } } } }
546         { 5 { { -1 { } } { 0 { } } } }
547         { 6 { { -1 { } } { 0 { } } } }
548         { 7 { { -1 { } } { 0 { } } } }
549         { 8 { { 0 { 0 } } { 0 { } } } }
550         { 9 { { 0 { } } { 0 { } } } }
551         { 10 { { 0 { } } { 0 { } } } }
552         { 11 { { 0 { } } { 0 { } } } }
553         { 12 { { 0 { } } { 0 { } } } }
554         { 13 { { 1 { 0 } } { 0 { } } } }
555         { 14 { { 1 { } } { 0 { } } } }
556         { 15 { { 1 { } } { 0 { } } } }
557         { 16 { { 1 { } } { 0 { } } } }
558         { 17 { { 1 { } } { 0 { } } } }
559         { 18 { { 1 { } } { 0 { } } } }
560         { 19 { { 2 { 0 1 2 } } { 0 { } } } }
561         { 20 { { -1 { } } { 0 { } } } }
562         { 21 { { -1 { } } { 0 { } } } }
563         { 22 { { -1 { } } { 0 { } } } }
564         { 23 { { -1 { } } { 0 { } } } }
565         { 24 { { -1 { } } { 0 { } } } }
566         ! gc-map here scrubbing D: 0, D: 1 and D: 2
567         { 25 { { 2 { 0 1 2 } } { 0 { } } } }
568         { 26 { { 2 { 0 1 2 } } { 0 { } } } }
569         { 27 { { -2 { } } { 0 { } } } }
570         { 28 { { -1 { 0 } } { 0 { } } } }
571         { 29 { { -1 { } } { 0 { } } } }
572         { 30 { { -2 { } } { 0 { } } } }
573         { 31 { { -2 { } } { 0 { } } } }
574         { 32 { { -2 { } } { 0 { } } } }
575         { 33 { { -1 { 0 } } { 0 { } } } }
576         { 34 { { -1 { } } { 0 { } } } }
577         { 35 { { -1 { } } { 0 { } } } }
578         { 36 { { -1 { } } { 0 { } } } }
579     }
580 } [
581     bug-benchmark-terrain-cfg trace-stack-state
582 ] unit-test
583
584
585 ! following-stack-state
586 {
587     { { 0 { } } { 0 { } } }
588 } [ V{ } following-stack-state ] unit-test
589
590 {
591     { { 1 { 0 } } { 0 { } } }
592 } [ V{ T{ ##inc f D: 1 } } following-stack-state ] unit-test
593
594 {
595     { { 0 { } } { 1 { 0 } } }
596 } [ V{ T{ ##inc f R: 1 } } following-stack-state ] unit-test
597
598 ! Here the peek refers to a parameter of the word.
599 {
600     { { 0 { } } { 0 { } } }
601 } [
602     V{
603         T{ ##peek { loc D: 25 } }
604     } following-stack-state
605 ] unit-test
606
607 {
608     { { 0 { } } { 0 { } } }
609 } [
610     V{
611         T{ ##replace { src 10 } { loc D: 0 } }
612         T{ ##replace { src 10 } { loc D: 1 } }
613         T{ ##replace { src 10 } { loc D: 2 } }
614     } following-stack-state
615 ] unit-test
616
617 {
618     { { 1 { } } { 0 { } } }
619 } [
620     V{
621         T{ ##replace { src 10 } { loc D: 0 } }
622         T{ ##inc f D: 1 }
623         T{ ##replace { src 10 } { loc D: 0 } }
624     } following-stack-state
625 ] unit-test
626
627 {
628     { { 0 { } } { 0 { } } }
629 } [
630     V{
631         T{ ##replace { src 10 } { loc D: 0 } }
632         T{ ##inc f D: 1 }
633         T{ ##replace { src 10 } { loc D: 0 } }
634         T{ ##inc f D: -1 }
635     } following-stack-state
636 ] unit-test
637
638 {
639     { { 0 { } } { 0 { } } }
640 } [
641     V{
642         T{ ##inc f D: 1 }
643         T{ ##replace { src 10 } { loc D: 0 } }
644         T{ ##inc f D: -1 }
645     } following-stack-state
646 ] unit-test
647
648 ! ##call clears the overinitialized slots.
649 {
650     { { -1 { } } { 0 { } } }
651 } [
652     V{
653         T{ ##replace { src 10 } { loc D: 0 } }
654         T{ ##inc f D: -1 }
655         T{ ##call }
656     } following-stack-state
657 ] unit-test
658
659 ! Should not be ok because the value wasn't initialized when gc ran.
660 [
661     V{
662         T{ ##inc f D: 1 }
663         T{ ##alien-invoke { gc-map T{ gc-map } } }
664         T{ ##peek { loc D: 0 } }
665     } following-stack-state
666 ] [ vacant-peek? ] must-fail-with
667
668 [
669     V{
670         T{ ##inc f D: 1 }
671         T{ ##peek { loc D: 0 } }
672     } following-stack-state
673 ] [ vacant-peek? ] must-fail-with
674
675 [
676     V{
677         T{ ##inc f R: 1 }
678         T{ ##peek { loc R: 0 } }
679     } following-stack-state
680 ] [ vacant-peek? ] must-fail-with