On Tue, Mar 11, 2025 at 10:06:27PM -0500, Robert Dubner wrote: > Earlier in this discussion of a testsuite, the question came up about > generating an error return in COBOL source code. > > In COBOL, "GOBACK ERROR 1." is the equivalent of a C "return 1;". When > executed in the initial "top-level" program-id, it results in the value 1 > being passed back to the _start stub. > > "STOP RUN ERROR 1." is the equivalent of (and is in fact implemented with) > "exit(1)".
Note, in most of the testsuite we try to signal failure from a runtime testcase through calling abort (or e.g. fortran STOP N statement). On Linux at least when not cross-compiling, exit(1) (or this STOP RUN ERROR 1) will work as well, I believe the reason is for some bare metal targets which just don't propagate return value from main or exit back to the dejagnu testing framework. Does COBOL have something that is implemented as call to abort()? Jakub