From 142afae002aa9487f4da48d464b2aa4ad54ad117 Mon Sep 17 00:00:00 2001 From: David Declerck Date: Mon, 16 Oct 2023 16:51:52 +0200 Subject: [PATCH] More tests for decimal constant bug patch --- tests/testsuite.src/run_misc.at | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/tests/testsuite.src/run_misc.at b/tests/testsuite.src/run_misc.at index e356b9e04..3bf50b4a5 100644 --- a/tests/testsuite.src/run_misc.at +++ b/tests/testsuite.src/run_misc.at @@ -14572,14 +14572,14 @@ TST-DECIMAL IS < ZERO-DECIMAL AT_CLEANUP -AT_SETUP([Decimal constants and INITIAL programs in same source]) -AT_KEYWORDS([runmisc]) +AT_SETUP([Decimal constants and programs in same source]) +AT_KEYWORDS([runmisc INITIAL CANCEL CALL]) # this used to cause a SIGSEGV, see bug #917 AT_DATA([prog.cpy], [ IDENTIFICATION DIVISION. - PROGRAM-ID. :PROG-NAME: INITIAL. + PROGRAM-ID. :PROG-NAME: :PROG-KIND:. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC 9(2) VALUE 42. @@ -14607,16 +14607,26 @@ AT_DATA([prog.cob], [ * ensure that cobc cannot optimize the expression away IF FUNCTION CURRENT-DATE = 0 ADD 1 TO Y. - CALL "prog2" - CALL "prog3" + CALL "nested_init" + CALL "nonnested_init" + CALL "nested_noninit" + CANCEL "nested_noninit" + CALL "nonnested_noninit" + CANCEL "nonnested_noninit" IF X + Y + 42.1 <> 0 DISPLAY "OK" WITH NO ADVANCING. STOP RUN. - COPY prog REPLACING ==:PROG-NAME:== BY ==prog2==. + COPY prog REPLACING ==:PROG-NAME:== BY ==nested_init== + ==:PROG-KIND:== BY ==INITIAL==. + COPY prog REPLACING ==:PROG-NAME:== BY ==nested_noninit== + ==:PROG-KIND:== BY ====. END PROGRAM prog. - COPY prog REPLACING ==:PROG-NAME:== BY ==prog3==. + COPY prog REPLACING ==:PROG-NAME:== BY ==nonnested_init== + ==:PROG-KIND:== BY ==INITIAL==. + COPY prog REPLACING ==:PROG-NAME:== BY ==nonnested_noninit== + ==:PROG-KIND:== BY ====. ]) AT_CHECK([$COMPILE_MODULE prog.cob], [0], [], []) -AT_CHECK([$COBCRUN prog], [0], [OKOKOK], []) +AT_CHECK([$COBCRUN prog], [0], [OKOKOKOKOK], []) AT_CLEANUP