diff --git a/tests/testsuite.at b/tests/testsuite.at index 3b8e4c35b..6fea21067 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -27,61 +27,64 @@ AT_INIT([GnuCOBOL Tests]) AT_COLOR_TESTS AT_TESTED([cobc cobcrun]) - -## General tests of used binaries -AT_BANNER([General tests of used binaries]) -m4_include([used_binaries.at]) -m4_include([configuration.at]) - -## Syntax tests -AT_BANNER([Syntax tests]) - -m4_include([syn_copy.at]) -m4_include([syn_definition.at]) -m4_include([syn_subscripts.at]) # 8.4.1.2 Subscripts -m4_include([syn_occurs.at]) # 13.16.36 OCCURS clause -m4_include([syn_redefines.at]) # 13.16.42 REDEFINES clause -m4_include([syn_value.at]) # 13.16.61 VALUE clause -m4_include([syn_file.at]) # Files (SELECT, ASSIGN, ...) without RW -m4_include([syn_reportwriter.at]) # REPORT WRITER -m4_include([syn_refmod.at]) # 8.4.2.3 Reference-modification -m4_include([syn_misc.at]) # Miscellaneous -m4_include([syn_move.at]) # 14.8.24 MOVE statement -m4_include([syn_multiply.at]) # 14.8.25 MULTIPLY statement -m4_include([syn_screen.at]) # 13.9 SCREEN section -m4_include([syn_set.at]) # 14.8.35 SET statement -m4_include([syn_functions.at]) # 15 Intrinsic functions -m4_include([syn_literals.at]) # syntax checks on literals - -## Listings tests -AT_BANNER([Listing tests]) - -m4_include([listings.at]) # Listings - -## Run tests -AT_BANNER([Run tests]) - -m4_include([run_fundamental.at]) -m4_include([run_subscripts.at]) # 8.4.1.2 Subscripts -m4_include([run_refmod.at]) # 8.4.2.3 Reference-modification -m4_include([run_accept.at]) # 14.8.1 ACCEPT statement -m4_include([run_initialize.at]) # 14.8.19 INITIALIZE statement -m4_include([run_misc.at]) # Miscellaneous -m4_include([run_file.at]) # Files (SELECT, ASSIGN, ...) without RW -m4_include([run_reportwriter.at]) # REPORT WRITER -m4_include([run_returncode.at]) -m4_include([run_functions.at]) # 15 Intrinsic Functions / 9.4 User-Defined Functions -m4_include([run_extensions.at]) -m4_include([run_ml.at]) - -## Data Representation -AT_BANNER([Data Representation]) - -m4_include([data_binary.at]) # USAGE BINARY -m4_include([data_display.at]) # USAGE DISPLAY -m4_include([data_packed.at]) # USAGE PACKED-DECIMAL -m4_include([data_pointer.at]) # USAGE POINTER - ## Test for backward compatibility AT_BANNER([Backward compatibility]) m4_include([backcomp.at]) + +## ## General tests of used binaries +## AT_BANNER([General tests of used binaries]) +## m4_include([used_binaries.at]) +## m4_include([configuration.at]) +## +## ## Syntax tests +## AT_BANNER([Syntax tests]) +## +## m4_include([syn_copy.at]) +## m4_include([syn_definition.at]) +## m4_include([syn_subscripts.at]) # 8.4.1.2 Subscripts +## m4_include([syn_occurs.at]) # 13.16.36 OCCURS clause +## m4_include([syn_redefines.at]) # 13.16.42 REDEFINES clause +## m4_include([syn_value.at]) # 13.16.61 VALUE clause +## m4_include([syn_file.at]) # Files (SELECT, ASSIGN, ...) without RW +## m4_include([syn_reportwriter.at]) # REPORT WRITER +## m4_include([syn_refmod.at]) # 8.4.2.3 Reference-modification +## m4_include([syn_misc.at]) # Miscellaneous +## m4_include([syn_move.at]) # 14.8.24 MOVE statement +## m4_include([syn_multiply.at]) # 14.8.25 MULTIPLY statement +## m4_include([syn_screen.at]) # 13.9 SCREEN section +## m4_include([syn_set.at]) # 14.8.35 SET statement +## m4_include([syn_functions.at]) # 15 Intrinsic functions +## m4_include([syn_literals.at]) # syntax checks on literals +## +## ## Listings tests +## AT_BANNER([Listing tests]) +## +## m4_include([listings.at]) # Listings +## +## ## Run tests +## AT_BANNER([Run tests]) +## +## m4_include([run_fundamental.at]) +## m4_include([run_subscripts.at]) # 8.4.1.2 Subscripts +## m4_include([run_refmod.at]) # 8.4.2.3 Reference-modification +## m4_include([run_accept.at]) # 14.8.1 ACCEPT statement +## m4_include([run_initialize.at]) # 14.8.19 INITIALIZE statement +## m4_include([run_misc.at]) # Miscellaneous +## m4_include([run_file.at]) # Files (SELECT, ASSIGN, ...) without RW +## m4_include([run_reportwriter.at]) # REPORT WRITER +## m4_include([run_returncode.at]) +## m4_include([run_functions.at]) # 15 Intrinsic Functions / 9.4 User-Defined Functions +## m4_include([run_extensions.at]) +## m4_include([run_ml.at]) +## +## ## Data Representation +## AT_BANNER([Data Representation]) +## +## m4_include([data_binary.at]) # USAGE BINARY +## m4_include([data_display.at]) # USAGE DISPLAY +## m4_include([data_packed.at]) # USAGE PACKED-DECIMAL +## m4_include([data_pointer.at]) # USAGE POINTER +## +## ## Test for backward compatibility +## AT_BANNER([Backward compatibility]) +## m4_include([backcomp.at]) diff --git a/tests/testsuite.src/backcomp.at b/tests/testsuite.src/backcomp.at index a579cfd7d..2d346c664 100644 --- a/tests/testsuite.src/backcomp.at +++ b/tests/testsuite.src/backcomp.at @@ -1864,16 +1864,16 @@ AT_CHECK([$COBCRUN_DIRECT ./prog2], [0], [], []) AT_CLEANUP -AT_SETUP([Alphanum comparison with default COLLATING SEQUENCE]) -AT_KEYWORDS([runmisc EBCDIC ASCII default-colseq]) +AT_SETUP([COLLATING SEQUENCE alphanum comparison]) +AT_KEYWORDS([runmisc EBCDIC ASCII]) AT_DATA([ascii.c], [[ /* Generated by cobc 2.2.0 */ /* Generated from prog.cob */ -/* Generated at juil. 23 2024 16:42:49 */ +/* Generated at juil. 23 2024 17:37:21 */ /* GnuCOBOL build date Apr 10 2024 16:39:16 */ /* GnuCOBOL package date Sep 06 2017 18:45:29 UTC */ -/* Compile command /opt/gnucobol/gnucobol-2.2/bin/cobc -Cx -fno-computed-goto prog.cob */ +/* Compile command /opt/gnucobol/gnucobol-2.2/bin/cobc -Cx -fno-computed-goto -fno-constant-folding prog.cob */ #include #include @@ -1886,17 +1886,17 @@ AT_DATA([ascii.c], [[ #define COB_SOURCE_FILE "prog.cob" #define COB_PACKAGE_VERSION "2.2" #define COB_PATCH_LEVEL 0 -#define COB_MODULE_FORMATTED_DATE "juil. 23 2024 16:42:49" +#define COB_MODULE_FORMATTED_DATE "juil. 23 2024 17:37:21" #define COB_MODULE_DATE 20240723 -#define COB_MODULE_TIME 164249 +#define COB_MODULE_TIME 173721 /* Global variables */ /* Generated by cobc 2.2.0 */ /* Generated from prog.cob */ -/* Generated at juil. 23 2024 16:42:49 */ +/* Generated at juil. 23 2024 17:37:21 */ /* GnuCOBOL build date Apr 10 2024 16:39:16 */ /* GnuCOBOL package date Sep 06 2017 18:45:29 UTC */ -/* Compile command /opt/gnucobol/gnucobol-2.2/bin/cobc -Cx -fno-computed-goto prog.cob */ +/* Compile command /opt/gnucobol/gnucobol-2.2/bin/cobc -Cx -fno-computed-goto -fno-constant-folding prog.cob */ /* Module path */ @@ -1907,7 +1907,14 @@ static int cob_call_params = 0; /* Attributes */ -static const cob_field_attr a_1 = {0x21, 0, 0, 0x0000, NULL}; +static const cob_field_attr a_1 = {0x21, 0, 0, 0x1000, NULL}; +static const cob_field_attr a_2 = {0x21, 0, 0, 0x0000, NULL}; + + +/* Constants */ +static const cob_field c_1 = {1, (cob_u8_ptr)"1", &a_1}; +static const cob_field c_2 = {1, (cob_u8_ptr)"a", &a_1}; +static const cob_field c_3 = {5, (cob_u8_ptr)"ERROR", &a_1}; /* NATIVE table */ @@ -1946,6 +1953,7 @@ static const unsigned char cob_native[256] = { 248, 249, 250, 251, 252, 253, 254, 255 }; + /* Decimal constants */ /* Function prototypes */ @@ -1979,10 +1987,10 @@ prog_ (const int entry) /* Program local variables */ /* Generated by cobc 2.2.0 */ /* Generated from prog.cob */ - /* Generated at juil. 23 2024 16:42:49 */ + /* Generated at juil. 23 2024 17:37:21 */ /* GnuCOBOL build date Apr 10 2024 16:39:16 */ /* GnuCOBOL package date Sep 06 2017 18:45:29 UTC */ - /* Compile command /opt/gnucobol/gnucobol-2.2/bin/cobc -Cx -fno-computed-goto prog.cob */ + /* Compile command /opt/gnucobol/gnucobol-2.2/bin/cobc -Cx -fno-computed-goto -fno-constant-folding prog.cob */ /* Program local variables for 'prog' */ @@ -2051,7 +2059,12 @@ prog_ (const int entry) l_2:; /* Line: 11 : IF : prog.cob */ - /* IF has code omitted */ + if (((int)cob_cmp ((cob_field *)&c_1, (cob_field *)&c_2) >= 0)) + { + + /* Line: 15 : DISPLAY : prog.cob */ + cob_display (0, 1, 1, &c_3); + } /* Line: 17 : STOP RUN : prog.cob */ cob_stop_run (b_2); @@ -2145,13 +2158,14 @@ prog_ (const int entry) ]]) + AT_DATA([ebcdic.c], [[ /* Generated by cobc 2.2.0 */ /* Generated from prog.cob */ -/* Generated at juil. 23 2024 16:54:31 */ +/* Generated at juil. 23 2024 17:34:27 */ /* GnuCOBOL build date Apr 10 2024 16:39:16 */ /* GnuCOBOL package date Sep 06 2017 18:45:29 UTC */ -/* Compile command /opt/gnucobol/gnucobol-2.2/bin/cobc -Cx -fno-computed-goto prog.cob */ +/* Compile command /opt/gnucobol/gnucobol-2.2/bin/cobc -Cx -fno-computed-goto -fno-constant-folding prog.cob */ #include #include @@ -2164,17 +2178,17 @@ AT_DATA([ebcdic.c], [[ #define COB_SOURCE_FILE "prog.cob" #define COB_PACKAGE_VERSION "2.2" #define COB_PATCH_LEVEL 0 -#define COB_MODULE_FORMATTED_DATE "juil. 23 2024 16:54:31" +#define COB_MODULE_FORMATTED_DATE "juil. 23 2024 17:34:27" #define COB_MODULE_DATE 20240723 -#define COB_MODULE_TIME 165431 +#define COB_MODULE_TIME 173427 /* Global variables */ /* Generated by cobc 2.2.0 */ /* Generated from prog.cob */ -/* Generated at juil. 23 2024 16:54:31 */ +/* Generated at juil. 23 2024 17:34:27 */ /* GnuCOBOL build date Apr 10 2024 16:39:16 */ /* GnuCOBOL package date Sep 06 2017 18:45:29 UTC */ -/* Compile command /opt/gnucobol/gnucobol-2.2/bin/cobc -Cx -fno-computed-goto prog.cob */ +/* Compile command /opt/gnucobol/gnucobol-2.2/bin/cobc -Cx -fno-computed-goto -fno-constant-folding prog.cob */ /* Module path */ @@ -2190,7 +2204,9 @@ static const cob_field_attr a_2 = {0x21, 0, 0, 0x0000, NULL}; /* Constants */ -static const cob_field c_1 = {5, (cob_u8_ptr)"ERROR", &a_1}; +static const cob_field c_1 = {1, (cob_u8_ptr)"a", &a_1}; +static const cob_field c_2 = {1, (cob_u8_ptr)"1", &a_1}; +static const cob_field c_3 = {5, (cob_u8_ptr)"ERROR", &a_1}; /* ASCII to EBCDIC table */ @@ -2263,10 +2279,10 @@ prog_ (const int entry) /* Program local variables */ /* Generated by cobc 2.2.0 */ /* Generated from prog.cob */ - /* Generated at juil. 23 2024 16:54:31 */ + /* Generated at juil. 23 2024 17:34:27 */ /* GnuCOBOL build date Apr 10 2024 16:39:16 */ /* GnuCOBOL package date Sep 06 2017 18:45:29 UTC */ - /* Compile command /opt/gnucobol/gnucobol-2.2/bin/cobc -Cx -fno-computed-goto prog.cob */ + /* Compile command /opt/gnucobol/gnucobol-2.2/bin/cobc -Cx -fno-computed-goto -fno-constant-folding prog.cob */ /* Program local variables for 'prog' */ @@ -2335,11 +2351,11 @@ prog_ (const int entry) l_2:; /* Line: 13 : IF : prog.cob */ - if (1) + if (((int)cob_cmp ((cob_field *)&c_1, (cob_field *)&c_2) >= 0)) { /* Line: 15 : DISPLAY : prog.cob */ - cob_display (0, 1, 1, &c_1); + cob_display (0, 1, 1, &c_3); } /* Line: 17 : STOP RUN : prog.cob */