File: data_pointer.at

package info (click to toggle)
gnucobol3 3.2-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 30,032 kB
  • sloc: sh: 201,859; ansic: 99,735; yacc: 18,930; lex: 5,521; cobol: 1,078; makefile: 593; perl: 555; awk: 184; sed: 16
file content (61 lines) | stat: -rw-r--r-- 1,721 bytes parent folder | download | duplicates (6)
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
## Copyright (C) 2003-2012, 2014-2016 Free Software Foundation, Inc.
## Written by Keisuke Nishida, Roger While, Simon Sobisch
## 
## This file is part of GnuCOBOL.
## 
## The GnuCOBOL compiler 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 3 of the
## License, or (at your option) any later version.
## 
## GnuCOBOL 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 GnuCOBOL.  If not, see <https://www.gnu.org/licenses/>.

### GnuCOBOL Test Suite

AT_SETUP([POINTER: display])
AT_KEYWORDS([pointer 64bit])

AT_DATA([prog.cob], [
       IDENTIFICATION   DIVISION.
       PROGRAM-ID.      prog.
       DATA             DIVISION.
       WORKING-STORAGE  SECTION.
       01 PTR           USAGE POINTER VALUE NULL.
       PROCEDURE        DIVISION.
           DISPLAY PTR
           END-DISPLAY.
           SET PTR UP BY 1
           DISPLAY PTR
           SET PTR DOWN BY 1
           DISPLAY PTR
           END-DISPLAY.
           STOP RUN.
])

AT_CHECK([$COMPILE prog.cob], [0], [], [])

AT_CHECK([test "$COB_HAS_64_BIT_POINTER" = "yes"], [0], [], [],

# Previous test "failed" --> 32 bit

[AT_CHECK([$COBCRUN_DIRECT ./prog], [0], [0x00000000
0x00000001
0x00000000
])]

,

# Previous test "passed" --> 64 bit

[AT_CHECK([$COBCRUN_DIRECT ./prog], [0], [0x0000000000000000
0x0000000000000001
0x0000000000000000
])])

AT_CLEANUP