-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathoka.tst
697 lines (586 loc) · 21.4 KB
/
oka.tst
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
#!/bin/sh
#
# Script to testing Oka.
#
# Copyright (C) 1997-2016 Vladimir Makarov.
#
# Written by Vladimir Makarov <vmakarov@gcc.gnu.org>
#
# This file is part of the tool OKA.
#
# This is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This software is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GNU CC; see the file COPYING. If not, write to the Free
# Software Foundation, 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
#
#
#
# Usage: oka.tst
#
# The script requires GPERF.
#
OKA=./oka
SED=sed
script_file=$0
test_oka=_temp.oka
test_cfile=_temp.c
test_hfile=_temp.h
stderr=_stderr.out
ftemp=_temp
if test x$1 = x
then
start_test_number=1
else
if expr $1 + 0 >/dev/null
then
start_test_number=`expr $1 + 0`
else
echo $script_file:invalid argument $1 2>&1
exit 1
fi
fi
result=ok
CMP=cmp
SCMP=cmp
# Test 1.
if test $result = ok -a $start_test_number -le 1; then
echo test 1
cat >$test_oka <<'TEST1'
%automaton integer1 integer2
%unit <integer1> ib0
%unit <integer2> ib1
%instruction LDL
%%
LDL: (ib0 | ib1)
;
TEST1
echo ' ' $OKA $test_oka "2>$stderr"
if $OKA $test_oka 2>$stderr; then
result=fail
else
echo ' ' $CMP $stderr $ftemp
if cat >$ftemp <<'OUTPUT1' && $CMP $stderr $ftemp; then
_temp.oka:2:18: Units `ib0' and `ib1' should be in the same automaton
OUTPUT1
result=ok
else
result=fail
fi
fi
fi
# Test 2.
if test $result = ok -a $start_test_number -le 2; then
echo test 2
cat >$test_oka <<'TEST2'
%automaton integer float
%unit <integer> ib0 ib1 load_store only_load multiplier multiplier_write_back
%unit <float> float_divider divider_write_back
%instruction LDL LDQ LDQ_U LDL_L LDQ_L LDS LDT
STL STQ STQ_U
STL_C STQ_C
LDAH LDA ADDL ADDQ S4ADDL S4ADDQ S8ADDL S8ADDQ S4SUBL S4SUBQ
S8SUBL S8SUBQ SUBL SUBQ CMPEQ CMPLT CMPLE CMPULT CMPULE CMPBGE AND
BIC BIS ORNOT XOR EQV CMOVEQ CMOVNE CMOVLBS CMOVLT CMOVGE
CMOVLBC CMOVLE CMOVGT SLL SRA SRL EXTBL EXTWL EXTLL EXTQL
EXTWH EXTLH EXTQH INSBL INSWL INSLL INSQL INSWH INSLH INSQH
MSKBL MSKWL MSKLL MSKQL MSKWH MSKLH MSKQH ZAP ZAPNOT
STS STT
MB TRAPB RPCC CALL_PAL JMP JSR RET JSR_COROUTINE BR BSR
BLBC BLBS BEQ BNE BLT BLE BGT BGE
FBEQ FBNE FBLT FBLE FBGT FBGE
UMULH MULQ
MULL
ADDS ADDT SUBS SUBT MULS MULT CMPTEQ CMPTLT CMPTLE
CPYS CPYSN CPYSE CVTLQ CVTQL CVTQS CVTQT CVTTQ CVTTS
FCMOVEQ FCMOVNE FCMOVLE FCMOVLT FCMOVGE FCMOVGT
DIVS
DIVT
RESERVED
%%
LDL, LDQ, LDQ_U, LDL_L, LDQ_L, LDS, LDT: (ib0 | ib1) + load_store
;
STL, STQ, STQ_U: ib1 + load_store
;
STL_C, STQ_C: (ib0 | ib1) + load_store %nothing only_load
;
LDAH, LDA, ADDL, ADDQ, S4ADDL, S4ADDQ, S8ADDL, S8ADDQ, S4SUBL, S4SUBQ, S8SUBL,
S8SUBQ, SUBL, SUBQ, CMPEQ, CMPLT, CMPLE, CMPULT, CMPULE, CMPBGE, AND,
BIC, BIS, ORNOT, XOR, EQV, CMOVEQ, CMOVNE, CMOVLBS, CMOVLT, CMOVGE,
CMOVLBC, CMOVLE, CMOVGT, SLL, SRA, SRL, EXTBL, EXTWL, EXTLL, EXTQL,
EXTWH, EXTLH, EXTQH, INSBL, INSWL, INSLL, INSQL, INSWH, INSLH, INSQH,
MSKBL, MSKWL, MSKLL, MSKQL, MSKWH, MSKLH, MSKQH, ZAP, ZAPNOT:
ib0 + multiplier_write_back
;
STS, STT: ib0 + load_store
;
MB, TRAPB, RPCC, CALL_PAL, JMP, JSR, RET, JSR_COROUTINE, BR, BSR, BLBC, BLBS,
BEQ, BNE, BLT, BLE, BGT, BGE: ib1
;
FBEQ, FBNE, FBLT, FBLE, FBGT, FBGE: ib0
;
UMULH, MULQ: ib0 + multiplier*18 multiplier_write_back + multiplier*3
;
MULL: ib0 + multiplier*16 multiplier_write_back + multiplier*3
;
ADDS, ADDT, SUBS, SUBT, MULS, MULT, CMPTEQ, CMPTLT, CMPTLE,
CPYS, CPYSN, CPYSE, CVTLQ, CVTQL, CVTQS, CVTQT, CVTTQ, CVTTS,
FCMOVEQ, FCMOVNE, FCMOVLE, FCMOVLT, FCMOVGE, FCMOVGT:
ib1 + divider_write_back
;
DIVS: ib1 + float_divider*24 (float_divider + divider_write_back)*2
float_divider*2
;
DIVT: ib1 + float_divider*53 (float_divider + divider_write_back)*2
float_divider*4
;
RESERVED: ib1
;
TEST2
echo ' ' $OKA $test_oka "2>&1 |" $SED "/transformation/d |" $SED "/minimization/d |" $SED "/generation/d >$stderr"
if $OKA $test_oka 2>&1|$SED '/transformation/d'|$SED '/minimization/d'|$SED '/generation/d' >$stderr; then
echo ' ' $CMP $stderr $ftemp
if cat >$ftemp <<'OUTPUT2' && $CMP $stderr $ftemp; then
Automaton `integer'
1176 NDFA states, 3544 NDFA arcs
1176 DFA states, 3632 DFA arcs
146 minimal DFA states, 611 minimal DFA arcs
129 all instructions 9 instruction equivalence classes
Automaton `float'
167 NDFA states, 420 NDFA arcs
167 DFA states, 420 DFA arcs
167 minimal DFA states, 420 minimal DFA arcs
129 all instructions 5 instruction equivalence classes
1659 all allocated states, 4062 all allocated arcs
1777 all allocated alternative states
1068 all comb vector elements, 2149 all transition table elements
21 locked states number
OUTPUT2
result=ok
elif cat >$ftemp <<'OUTPUT2b' && $CMP $stderr $ftemp; then
Automaton `integer'
1176 NDFA states, 3544 NDFA arcs
1176 DFA states, 3632 DFA arcs
146 minimal DFA states, 611 minimal DFA arcs
129 all instructions 9 instruction equivalence classes
Automaton `float'
167 NDFA states, 420 NDFA arcs
167 DFA states, 420 DFA arcs
167 minimal DFA states, 420 minimal DFA arcs
129 all instructions 5 instruction equivalence classes
1659 all allocated states, 4062 all allocated arcs
1777 all allocated alternative states
1066 all comb vector elements, 2149 all transition table elements
21 locked states number
OUTPUT2b
result=ok
elif cat >$ftemp <<'OUTPUT2a' && $CMP $stderr $ftemp; then
Automaton `integer'
1176 NDFA states, 3544 NDFA arcs
1176 DFA states, 3632 DFA arcs
146 minimal DFA states, 611 minimal DFA arcs
129 all instructions 9 instruction equivalence classes
Automaton `float'
167 NDFA states, 420 NDFA arcs
167 DFA states, 420 DFA arcs
167 minimal DFA states, 420 minimal DFA arcs
129 all instructions 5 instruction equivalence classes
OUTPUT2a
result=ok
else
result=fail
fi
else
result=fail
fi
fi
# Test 3.
if test $result = ok -a $start_test_number -le 3; then
echo test 3
cat >$test_oka <<'TEST3'
%automaton integer float
%unit <integer> e0 e1 load_store_1 load_store_2 store_reservation
multiplier_write_back multiplier
%unit <float> fa fm float_divider divider_write_back
%instruction LDL LDQ LDQ_U LDS LDT STL STQ STQ_U STS STT
LDL_L LDQ_L MB WMB STL_C STQ_C FETCH
RS RC HW_MFPR HW_MTPR BLBC BLBS BEQ BNE BLT BLE BGT BGE
FBEQ FBNE FBLT FBLE FBGT FBGE
JMP JSR RET JSR_COROUTINE BSR BR HW_REI CALLPAL
LDAH LDA ADDL ADDLV ADDQ ADDQV S4ADDL S4ADDQ S8ADDL S8ADDQ
S4SUBL S4SUBQ S8SUBL S8SUBQ SUBL SUBLV SUBQ SUBQV
AND BIC BIS ORNOT XOR EQV
SLL SRA SRL EXTBL EXTWL EXTLL EXTQL
EXTWH EXTLH EXTQH INSBL INSWL INSLL INSQL INSWH INSLH INSQH
MSKBL MSKWL MSKLL MSKQL MSKWH MSKLH MSKQH ZAP ZAPNOT
CMOVEQ CMOVNE CMOVLBS CMOVLT CMOVGE CMOVLBC CMOVLE CMOVGT
CMPEQ CMPLT CMPLE CMPULT CMPULE CMPBGE
MULL MULLV MULL1 MULLV1 MULL2 MULLV2
MULQ MULQV MULQ1 MULQV1 MULQ2 MULQV2 UMULH UMULH1 UMULH2
ADDS ADDT SUBS SUBT CPYSN CPYSE CVTLQ CVTQL CVTTQ
FCMOVEQ FCMOVNE FCMOVLE FCMOVLT FCMOVGE FCMOVGT
DIVS DIVT MULS MULT CPYS RPCC TRAPB UNOP
%%
/* Class LD:
o An instruction of class LD can not be simulteniously issued with
an instruction of class ST;
o An instruction of class LD can not be issued in the second cycle
after an instruction of class ST is issued. */
LDL, LDQ, LDQ_U, LDS, LDT:
(e0 + multiplier_write_back | e1) + (load_store_1 | load_store_2)
+ store_reservation
;
/* Class ST:
o An instruction of class LD can not be simulteniously issued with
an instruction of class ST;
o An instruction of class LD can not be issued in the second cycle
after an instruction of class ST is issued. */
STL, STQ, STQ_U, STS, STT:
e0 + multiplier_write_back + load_store_1 + load_store_2 %nothing
store_reservation
;
/* Class MBX */
LDL_L, LDQ_L, MB, WMB/*???*/, STL_C, STQ_C, FETCH/*???*/:
e0 + multiplier_write_back
;
/* Class RX */
RS/*???*/, RC/*???*/: e0 + multiplier_write_back
;
/* Class MXPR */
HW_MFPR, HW_MTPR/*???*/: %nothing /*???*/
;
/* Class IBR */
BLBC, BLBS, BEQ, BNE, BLT, BLE, BGT, BGE: e1
;
/* Class FBR */
FBEQ, FBNE, FBLT, FBLE, FBGT, FBGE: fa
;
/* Class JSR */
JMP, JSR, RET, JSR_COROUTINE, BSR, BR, HW_REI/*???*/, CALLPAL: e1
;
/* Class IADD */
LDAH, LDA, ADDL, ADDLV/*???*/, ADDQ, ADDQV, S4ADDL, S4ADDQ, S8ADDL, S8ADDQ,
S4SUBL, S4SUBQ, S8SUBL, S8SUBQ, SUBL, SUBLV/*???*/, SUBQ, SUBQV/*???*/:
e0 + multiplier_write_back
;
/* Class ILOG */
AND, BIC, BIS, ORNOT, XOR, EQV : (e0 + multiplier_write_back | e1)
;
/* Class SHIFT */
SLL, SRA, SRL, EXTBL, EXTWL, EXTLL, EXTQL,
EXTWH, EXTLH, EXTQH, INSBL, INSWL, INSLL, INSQL, INSWH, INSLH, INSQH,
MSKBL, MSKWL, MSKLL, MSKQL, MSKWH, MSKLH, MSKQH, ZAP, ZAPNOT:
e0 + multiplier_write_back
;
/* Class CMOV */
CMOVEQ, CMOVNE, CMOVLBS, CMOVLT, CMOVGE, CMOVLBC, CMOVLE, CMOVGT:
(e0 + multiplier_write_back | e1)
;
/* Class ICMP */
CMPEQ, CMPLT, CMPLE, CMPULT, CMPULE, CMPBGE: (e0 + multiplier_write_back | e1)
;
/* Class IMULL:
o Thirty-two-bit multiplies have an 8-cycle latency, and the
multiplier can start a second multiply after 4 cycles, provided
that the second multiply has no data dependency on the first;
o No instruction can be issued to pipe e0 exactly two cycles before
an integer multiplication complete. */
MULL, MULLV/*???*/: e0 + multiplier_write_back + multiplier*4 %nothing*2
multiplier_write_back
;
/* Class IMULL with 1 cycle delay */
MULL1, MULLV1/*???*/: e0 + multiplier_write_back %nothing + multiplier*4
%nothing*2 multiplier_write_back
;
/* Class IMULL with 2 cycles delay */
MULL2, MULLV2/*???*/: e0 + multiplier_write_back %nothing*2 + multiplier*4
%nothing*2 multiplier_write_back
;
/* Class IMULQ:
o Sixty-for-bit signed multiplies have an 12-cycle latency, and the
multiplier can start a second multiply after 8 cycles, provided
that the second multiply has no data dependency on the first;
o No instruction can be issued to pipe e0 exactly two cycles before
an integer multiplication complete. */
MULQ, MULQV/*???*/: e0 + multiplier_write_back + multiplier*8 %nothing*2
multiplier_write_back
;
/* Class IMULQ with 1 cycle delay */
MULQ1, MULQV1/*???*/: e0 + multiplier_write_back %nothing + multiplier*8
%nothing*2 multiplier_write_back
;
/* Class IMULQ with 2 cycles delay */
MULQ2, MULQV2/*???*/: e0 + multiplier_write_back %nothing*2 + multiplier*8
%nothing*2 multiplier_write_back
;
/* Class IMULH
o Sixty-for-bit unsigend multiplies have an 14-cycle latency, and
the multiplier can start a second multiply after 8 cycles, provided
that the second multiply has no data dependency on the first;
o No instruction can be issued to pipe e0 exactly two cycles before
an integer multiplication complete. */
UMULH: e0 + multiplier_write_back + multiplier*8 %nothing*4
multiplier_write_back
;
/* Class IMULH with 1 cycle delay */
UMULH1: e0 + multiplier_write_back %nothing + multiplier*8 %nothing*4
multiplier_write_back
;
/* Class IMULH with 2 cycles delay */
UMULH2: e0 + multiplier_write_back %nothing*2 + multiplier*8 %nothing*4
multiplier_write_back
;
/* Class FADD */
ADDS, ADDT, SUBS, SUBT, CPYSN, CPYSE, CVTLQ, CVTQL, CVTTQ,
FCMOVEQ, FCMOVNE, FCMOVLE, FCMOVLT, FCMOVGE, FCMOVGT:
fa + divider_write_back
;
/* Class FDIV:
o 2.4 bits per cycle average rate. The next floating divide can be
issued in the same cycle the result of the previous divide's result
is avialable.
o Instruction issue to teh add pipeline continues whaile a divide
is in progress until the result is ready. At that point the issue
stage in the instruction umit stalls one cycle to allow the
quotient to be sent the round adder and then be written into the
register file. */
DIVS: fa + float_divider*18/*???*/ + divider_write_back
;
/* Class FDIV:
o 2.4 bits per cycle average rate. The next floating divide can be
issued in the same cycle the result of the previous divide's result
is avialable.
o Instruction issue to teh add pipeline continues whaile a divide
is in progress until the result is ready. At that point the issue
stage in the instruction umit stalls one cycle to allow the
quotient to be sent the round adder and then be written into the
register file. */
DIVT: fa + float_divider*30/*???*/ + divider_write_back
;
/* Class FMUL */
MULS, MULT: fm
;
/* Class FCPYS */
CPYS: (fa + divider_write_back | fm)
;
/* Class MISC */
RPCC, TRAPB: e0 + multiplier_write_back
;
/* Class UNOP */
UNOP: %nothing
;
TEST3
echo ' ' $OKA $test_oka "2>&1 |" $SED "/transformation/d |" $SED "/minimization/d |" $SED "/generation/d >$stderr"
if $OKA $test_oka 2>&1|$SED '/transformation/d'|$SED '/minimization/d'|$SED '/generation/d' >$stderr; then
echo ' ' $CMP $stderr $ftemp
if cat >$ftemp <<'OUTPUT3' && $CMP $stderr $ftemp; then
Automaton `integer'
3048 NDFA states, 12732 NDFA arcs
2651 DFA states, 11527 DFA arcs
1619 minimal DFA states, 8720 minimal DFA arcs
146 all instructions 16 instruction equivalence classes
Automaton `float'
180 NDFA states, 720 NDFA arcs
209 DFA states, 867 DFA arcs
149 minimal DFA states, 687 minimal DFA arcs
146 all instructions 8 instruction equivalence classes
4520 all allocated states, 15219 all allocated arcs
3640 all allocated alternative states
11706 all comb vector elements, 27096 all transition table elements
0 locked states number
OUTPUT3
result=ok
elif cat >$ftemp <<'OUTPUT3b' && $CMP $stderr $ftemp; then
Automaton `integer'
3048 NDFA states, 12732 NDFA arcs
2651 DFA states, 11527 DFA arcs
1619 minimal DFA states, 8720 minimal DFA arcs
146 all instructions 16 instruction equivalence classes
Automaton `float'
180 NDFA states, 720 NDFA arcs
209 DFA states, 867 DFA arcs
149 minimal DFA states, 687 minimal DFA arcs
146 all instructions 8 instruction equivalence classes
4520 all allocated states, 15219 all allocated arcs
3640 all allocated alternative states
11713 all comb vector elements, 27096 all transition table elements
0 locked states number
OUTPUT3b
result=ok
elif cat >$ftemp <<'OUTPUT3a' && $CMP $stderr $ftemp; then
Automaton `integer'
3048 NDFA states, 12732 NDFA arcs
2651 DFA states, 11527 DFA arcs
1619 minimal DFA states, 8720 minimal DFA arcs
146 all instructions 16 instruction equivalence classes
Automaton `float'
180 NDFA states, 720 NDFA arcs
209 DFA states, 867 DFA arcs
149 minimal DFA states, 687 minimal DFA arcs
146 all instructions 8 instruction equivalence classes
OUTPUT3a
result=ok
else
result=fail
fi
else
result=fail
fi
fi
# Test 4.
if test $result = ok -a $start_test_number -le 4; then
echo test 4
cat >$test_oka <<'TEST4'
%automaton integer1
%unit <integer1> ib0 ib1
%exclusion ib0 : ib0
%instruction LDL
%%
LDL: (ib0 | ib1)
;
TEST4
echo ' ' $OKA $test_oka "2>$stderr"
if $OKA $test_oka 2>$stderr; then
result=fail
else
echo ' ' $CMP $stderr $ftemp
if cat >$ftemp <<'OUTPUT4' && $CMP $stderr $ftemp; then
_temp.oka:3:12: unit `ib0' excludes itself
_temp.oka:3:18: unit `ib0' excludes itself
OUTPUT4
result=ok
else
result=fail
fi
fi
fi
# Test 5.
if test $result = ok -a $start_test_number -le 5; then
echo test 5
cat >$test_oka <<'TEST5'
%automaton integer1 integer2
%unit <integer1> ib0
%unit <integer2> ib1
%exclusion ib0 : ib1
%instruction LDL
%%
LDL: (ib0 | ib1)
;
TEST5
echo ' ' $OKA $test_oka "2>$stderr"
if $OKA $test_oka 2>$stderr; then
result=fail
else
echo ' ' $CMP $stderr $ftemp
if cat >$ftemp <<'OUTPUT5' && $CMP $stderr $ftemp; then
_temp.oka:4:12: units `ib1' and `ib0' in exclusion set belong to different automata
_temp.oka:4:18: units `ib0' and `ib1' in exclusion set belong to different automata
OUTPUT5
result=ok
else
result=fail
fi
fi
fi
# Test 6.
if test $result = ok -a $start_test_number -le 6; then
echo test 6
cat >$test_oka <<'TEST6'
%automaton integer1
%unit <integer1> ib0
%unit <integer1> ib1
%exclusion ib0 : ib1
%instruction LDL
%%
LDL: (ib0 | ib1)
;
TEST6
echo ' ' $OKA $test_oka "2>&1 |" $SED "/transformation/d |" $SED "/minimization/d |" $SED "/generation/d >$stderr"
if $OKA $test_oka 2>&1|$SED '/transformation/d'|$SED '/minimization/d'|$SED '/generation/d' >$stderr; then
echo ' ' $CMP $stderr $ftemp
if cat >$ftemp <<'OUTPUT6' && $CMP $stderr $ftemp; then
Automaton `integer1'
3 NDFA states, 5 NDFA arcs
2 DFA states, 3 DFA arcs
2 minimal DFA states, 3 minimal DFA arcs
2 all instructions 2 instruction equivalence classes
4 all allocated states, 6 all allocated arcs
4 all allocated alternative states
3 all comb vector elements, 4 all transition table elements
1 locked states number
OUTPUT6
result=ok
elif cat >$ftemp <<'OUTPUT6a' && $CMP $stderr $ftemp; then
Automaton `integer1'
3 NDFA states, 5 NDFA arcs
2 DFA states, 3 DFA arcs
2 minimal DFA states, 3 minimal DFA arcs
2 all instructions 2 instruction equivalence classes
OUTPUT6a
result=ok
else
result=fail
fi
else
result=fail
fi
fi
# Test 7.
if test $result = ok -a $start_test_number -le 7; then
echo test 7
cat >$test_oka <<'TEST7'
%unit ib0 ib1
%exclusion ib0 : ib1
%instruction LDL
%%
LDL: (ib0 | ib1)
;
TEST7
echo ' ' $OKA $test_oka "2>&1 |" $SED "/transformation/d |" $SED "/minimization/d |" $SED "/generation/d >$stderr"
if $OKA $test_oka 2>&1|$SED '/transformation/d'|$SED '/minimization/d'|$SED '/generation/d' >$stderr; then
echo ' ' $CMP $stderr $ftemp
if cat >$ftemp <<'OUTPUT7' && $CMP $stderr $ftemp; then
Automaton #0
3 NDFA states, 5 NDFA arcs
2 DFA states, 3 DFA arcs
2 minimal DFA states, 3 minimal DFA arcs
2 all instructions 2 instruction equivalence classes
4 all allocated states, 6 all allocated arcs
4 all allocated alternative states
3 all comb vector elements, 4 all transition table elements
1 locked states number
OUTPUT7
result=ok
elif cat >$ftemp <<'OUTPUT7a' && $CMP $stderr $ftemp; then
Automaton #0
3 NDFA states, 5 NDFA arcs
2 DFA states, 3 DFA arcs
2 minimal DFA states, 3 minimal DFA arcs
2 all instructions 2 instruction equivalence classes
OUTPUT7a
result=ok
else
result=fail
fi
else
result=fail
fi
fi
# Final message
if test $result = ok; then
echo $script_file: it is all ok
rm -f $test_cfile $test_hfile $test_oka $stderr $ftemp
exit 0
else
echo '***' $script_file: test is failed see files $test_oka $stderr $ftemp
exit 1
fi