Debian Codegraph @

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

raw
1 *> { dg-do run }
2 *> { dg-options "-dialect ibm" }
3 *> { dg-output-file "group2/LENGTH_OF_omnibus.out" }
4
5 program-id. prog.
6 data division.
7 working-storage section.
8 01 desc1.
9 05 desc1-entry pic x(5) occurs 10.
10
11 01 desc2.
12 05 desc2-table occurs 10 times.
13 10 desc2-entry pic x(5).
14
15 01 desc3.
16 05 desc3-outer occurs 1 to 5 times depending on desc3-lim.
17 10 desc3-outer-txt pic x(7).
18 10 desc3-inner occurs 11 times.
19 15 desc3-inner-text pic x(13).
20 77 desc3-lim binary-long.
21
22 77 msg pic x(64).
23 77 should-be pic zzzz9.
24 77 but-is pic zzzz9.
25
26 procedure division.
27
28 display "using LENGTH OF"
29
30 move "Length of desc1" to msg
31 move 50 to should-be
32 move length of desc1 to but-is
33 perform result-is
34
35 move "Length of desc1-entry" to msg
36 move 5 to should-be
37 move length of desc1-entry to but-is
38 perform result-is
39
40 move "Length of desc1-entry(1)" to msg
41 move 5 to should-be
42 move length of desc1-entry(1) to but-is
43 perform result-is
44
45 move "Length of desc2" to msg
46 move 50 to should-be
47 move length of desc2 to but-is
48 perform result-is
49
50 move "Length of desc2-table" to msg
51 move 5 to should-be
52 move length of desc2-table to but-is
53 perform result-is
54
55 move "Length of desc2-entry" to msg
56 move 5 to should-be
57 move length of desc2-entry to but-is
58 perform result-is
59
60 move "Length of desc2-entry(1)" to msg
61 move 5 to should-be
62 move length of desc2-entry(1) to but-is
63 perform result-is
64
65 move 5 to desc3-lim
66
67 move "Length of desc3" to msg
68 move 750 to should-be
69 move length of desc3 to but-is
70 perform result-is
71
72 move "Length of desc3-outer" to msg
73 move 150 to should-be
74 move length of desc3-outer to but-is
75 perform result-is
76
77 move "Length of desc3-outer(1)" to msg
78 move 150 to should-be
79 move length of desc3-outer(1) to but-is
80 perform result-is
81
82 move "Length of desc3-outer-txt" to msg
83 move 7 to should-be
84 move length of desc3-outer-txt to but-is
85 perform result-is
86
87 move "Length of desc3-inner" to msg
88 move 13 to should-be
89 move length of desc3-inner to but-is
90 perform result-is
91
92 move "Length of desc3-inner(1)" to msg
93 move 13 to should-be
94 move length of desc3-inner(1) to but-is
95 perform result-is
96
97 goback.
98 result-is.
99 display function trim(msg) ": " with no advancing
100 if but-is equal to should-be
101 display function trim(but-is)
102 else
103 display "should be " function trim(should-be)
104 " but is " function trim(but-is)
105 end-if.
106 end program prog.
107