Debian Codegraph @

gcc/testsuite/cobol.dg/group2/Alphanumeric_MOVE_with_truncation.cob

raw
1 *> { dg-do run }
2 *> { dg-options "-Wno-truncate" }
3 *> { dg-output-file "group2/Alphanumeric_MOVE_with_truncation.out" }
4
5 IDENTIFICATION DIVISION.
6 PROGRAM-ID. prog.
7 DATA DIVISION.
8 WORKING-STORAGE SECTION.
9 01 x-left PIC X(03).
10 01 x-right PIC X(03) JUSTIFIED RIGHT.
11 PROCEDURE DIVISION.
12 MOVE '1234' TO x-left, x-right
13 DISPLAY """" x-left """" space """" x-right """"
14 IF x-left not = '123'
15 OR x-right not = '234'
16 DISPLAY 'error with "1234":'
17 END-DISPLAY
18 DISPLAY x-left
19 END-DISPLAY
20 DISPLAY x-right
21 END-DISPLAY
22 END-IF
23 MOVE ' 3' TO x-left, x-right
24 DISPLAY """" x-left """" space """" x-right """"
25 IF x-left not = spaces
26 OR x-right not = ' 3'
27 DISPLAY 'error with " 3":'
28 END-DISPLAY
29 DISPLAY x-left
30 END-DISPLAY
31 DISPLAY x-right
32 END-DISPLAY
33 END-IF
34 MOVE '3 ' TO x-left, x-right
35 DISPLAY """" x-left """" space """" x-right """"
36 IF x-left not = '3'
37 OR x-right not = spaces
38 DISPLAY 'error with "3 ":'
39 END-DISPLAY
40 DISPLAY x-left
41 END-DISPLAY
42 DISPLAY x-right
43 END-DISPLAY
44 END-IF.
45