diff --git a/libcob/ChangeLog b/libcob/ChangeLog index b1f554027..24d46086a 100644 --- a/libcob/ChangeLog +++ b/libcob/ChangeLog @@ -79,6 +79,7 @@ changed to use the attributes of the receiving field 2024-07-19 Simon Sobisch + * coblocal.h (COB_TLS): add a new attribute for thread local static. * common.h, common.c (cob_cleanup_thread): add a cleanup function for threads diff --git a/tests/Makefile.am b/tests/Makefile.am index 7a5ef629b..002be9b2c 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -63,9 +63,9 @@ testsuite_sources = \ testsuite.src/data_display.at \ testsuite.src/data_packed.at \ testsuite.src/data_pointer.at \ + testsuite.src/backcomp.at \ testsuite.src/numeric-dump.cob \ - testsuite.src/numeric-display.cob \ - testsuite.src/backcomp.at + testsuite.src/numeric-display.cob testsuite_manual_sources = \ testsuite.src/run_manual_screen.at diff --git a/tests/testsuite.src/backcomp.at b/tests/testsuite.src/backcomp.at index 568593a26..f20f08ba7 100644 --- a/tests/testsuite.src/backcomp.at +++ b/tests/testsuite.src/backcomp.at @@ -41,404 +41,6 @@ ## 4. Although not mandatory, it is wiser to polish the code by removing ## useless headers or portions of code. -AT_SETUP([TRANSFORM statement]) -AT_KEYWORDS([backcomp runmisc CONVERTING ALPHABET]) - -AT_DATA([prog.c], [[ -/* Generated by cobc 3.2.0 */ -/* Generated from prog.cob */ -/* Generated at avril 17 2024 11:48:41 */ -/* GnuCOBOL build date Apr 17 2024 11:34:39 */ -/* GnuCOBOL package date Jul 28 2023 17:02:56 UTC */ -/* Compile command /opt/gnucobol/gnucobol-3.2/bin/cobc -Cx -fno-computed-goto prog.cob */ - -#include /* for memcpy, memcmp and friends */ -#define COB_KEYWORD_INLINE __inline -#include - -#define COB_SOURCE_FILE "prog.cob" -#define COB_PACKAGE_VERSION "3.2" -#define COB_PATCH_LEVEL 0 -#define COB_MODULE_FORMATTED_DATE "avril 17 2024 11:48:41" -#define COB_MODULE_DATE 20240417 -#define COB_MODULE_TIME 114841 - -/* Global variables */ -/* Generated by cobc 3.2.0 */ -/* Generated from prog.cob */ -/* Generated at avril 17 2024 11:48:41 */ -/* GnuCOBOL build date Apr 17 2024 11:34:39 */ -/* GnuCOBOL package date Jul 28 2023 17:02:56 UTC */ -/* Compile command /opt/gnucobol/gnucobol-3.2/bin/cobc -Cx -fno-computed-goto prog.cob */ - - -/* Module path */ -static const char *cob_module_path = NULL; - -/* Number of call parameters */ -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_2 = {0x21, 0, 0, 0x1000, NULL}; - - -/* Constants */ -static const cob_field c_1 = {3, (cob_u8_ptr)"ABC", &a_2}; -static const cob_field c_2 = {3, (cob_u8_ptr)"BCD", &a_2}; -static const cob_field c_3 = {3, (cob_u8_ptr)"CDB", &a_2}; -static const cob_field c_4 = {3, (cob_u8_ptr)"X: ", &a_2}; - - -/* NATIVE table */ -static const unsigned char cob_native[256] = { - 0000, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, - 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, - 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, - 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, - 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, - 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, - 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, - 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, - 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, - 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, - 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, - 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, - 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, - 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, - 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, - 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, - 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, - 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, - 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, - 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, - 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, - 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, - 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, - 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, - 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, - 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, - 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, - 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, - 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, - 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, -}; -static cob_field f_native = { 256, (cob_u8_ptr)cob_native, &a_1 }; - - -/* ASCII to EBCDIC table */ -static const unsigned char cob_ascii_ebcdic[256] = { - 0000, 0x01, 0x02, 0x03, 0x37, 0x2d, 0x2e, 0x2f, - 0x16, 0x05, 0x25, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, - 0x10, 0x11, 0x12, 0x13, 0x3c, 0x3d, 0x32, 0x26, - 0x18, 0x19, 0x3f, 0x27, 0x1c, 0x1d, 0x1e, 0x1f, - 0x40, 0x5a, 0x7f, 0x7b, 0x5b, 0x6c, 0x50, 0x7d, - 0x4d, 0x5d, 0x5c, 0x4e, 0x6b, 0x60, 0x4b, 0x61, - 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, - 0xf8, 0xf9, 0x7a, 0x5e, 0x4c, 0x7e, 0x6e, 0x6f, - 0x7c, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, - 0xc8, 0xc9, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, - 0xd7, 0xd8, 0xd9, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, - 0xe7, 0xe8, 0xe9, 0xad, 0xe0, 0xbd, 0x5f, 0x6d, - 0x79, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, - 0x88, 0x89, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, - 0x97, 0x98, 0x99, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, - 0xa7, 0xa8, 0xa9, 0xc0, 0x6a, 0xd0, 0xa1, 0x07, - 0x68, 0xdc, 0x51, 0x42, 0x43, 0x44, 0x47, 0x48, - 0x52, 0x53, 0x54, 0x57, 0x56, 0x58, 0x63, 0x67, - 0x71, 0x9c, 0x9e, 0xcb, 0xcc, 0xcd, 0xdb, 0xdd, - 0xdf, 0xec, 0xfc, 0xb0, 0xb1, 0xb2, 0x3e, 0xb4, - 0x45, 0x55, 0xce, 0xde, 0x49, 0x69, 0x9a, 0x9b, - 0xab, 0x9f, 0xba, 0xb8, 0xb7, 0xaa, 0x8a, 0x8b, - 0xb6, 0xb5, 0x62, 0x4f, 0x64, 0x65, 0x66, 0x20, - 0x21, 0x22, 0x70, 0x23, 0x72, 0x73, 0x74, 0xbe, - 0x76, 0x77, 0x78, 0x80, 0x24, 0x15, 0x8c, 0x8d, - 0x8e, 0x41, 0x06, 0x17, 0x28, 0x29, 0x9d, 0x2a, - 0x2b, 0x2c, 0x09, 0x0a, 0xac, 0x4a, 0xae, 0xaf, - 0x1b, 0x30, 0x31, 0xfa, 0x1a, 0x33, 0x34, 0x35, - 0x36, 0x59, 0x08, 0x38, 0xbc, 0x39, 0xa0, 0xbf, - 0xca, 0x3a, 0xfe, 0x3b, 0x04, 0xcf, 0xda, 0x14, - 0xe1, 0x8f, 0x46, 0x75, 0xfd, 0xeb, 0xee, 0xed, - 0x90, 0xef, 0xb3, 0xfb, 0xb9, 0xea, 0xbb, 0xff, -}; -static cob_field f_ascii_ebcdic = { 256, (cob_u8_ptr)cob_ascii_ebcdic, &a_1 }; - - - -/* Function prototypes */ - -static int prog (); -static int prog_ (const int); -static void prog_module_init (cob_module *module); - -/* Main function */ -int -main (int argc, char **argv) -{ - cob_init (argc, argv); - cob_stop_run (prog ()); -} - -/* Functions */ - -static void gc_module_so_init () __attribute__ ((constructor)); -static void gc_module_so_init () -{ - cob_check_version (COB_SOURCE_FILE, COB_PACKAGE_VERSION, COB_PATCH_LEVEL); -} - -/* PROGRAM-ID 'prog' */ - -/* ENTRY 'prog' */ - -static int -prog () -{ - return prog_ (0); -} - -static int -prog_ (const int entry) -{ - /* Program local variables */ - /* Generated by cobc 3.2.0 */ - /* Generated from prog.cob */ - /* Generated at avril 17 2024 11:48:41 */ - /* GnuCOBOL build date Apr 17 2024 11:34:39 */ - /* GnuCOBOL package date Jul 28 2023 17:02:56 UTC */ - /* Compile command /opt/gnucobol/gnucobol-3.2/bin/cobc -Cx -fno-computed-goto prog.cob */ - - /* Program local variables for 'prog' */ - - /* Module initialization indicator */ - static unsigned int initialized = 0; - - /* Module structure pointer */ - static cob_module *module = NULL; - - /* Global variable pointer */ - cob_global *cob_glob_ptr; - - - /* LINKAGE SECTION (Items not referenced by USING clause) */ - static unsigned char *b_9 = NULL; /* XML-NAMESPACE */ - static unsigned char *b_10 = NULL; /* XML-NAMESPACE-PREFIX */ - static unsigned char *b_11 = NULL; /* XML-NNAMESPACE */ - static unsigned char *b_12 = NULL; /* XML-NNAMESPACE-PREFIX */ - static unsigned char *b_13 = NULL; /* XML-NTEXT */ - static unsigned char *b_14 = NULL; /* XML-TEXT */ - - - /* Call parameters */ - cob_field *cob_procedure_params[1]; - - /* Perform frame stack */ - struct cob_frame *frame_ptr; - struct cob_frame frame_stack[255]; - - - /* Data storage */ - static int b_2; /* RETURN-CODE */ - static cob_u8_t b_17[3] __attribute__((aligned)); /* X */ - - /* End of local data storage */ - - - /* Fields (local) */ - static cob_field f_17 = {3, b_17, &a_1}; /* X */ - - /* End of fields */ - - - - /* Start of function code */ - - /* CANCEL callback */ - if (unlikely(entry < 0)) { - if (entry == -10) - goto P_dump; - if (entry == -20) - goto P_clear_decimal; - goto P_cancel; - } - - /* Check initialized, check module allocated, */ - /* set global pointer, */ - /* push module stack, save call parameter count */ - if (cob_module_global_enter (&module, &cob_glob_ptr, 0, entry, 0)) - return -1; - - /* Set address of module parameter list */ - module->cob_procedure_params = cob_procedure_params; - - /* Set frame stack pointer */ - frame_ptr = frame_stack; - frame_ptr->perform_through = 0; - - /* Initialize rest of program */ - if (unlikely(initialized == 0)) { - goto P_initialize; - } - P_ret_initialize: - - /* Increment module active */ - module->module_active++; - - /* Entry dispatch */ - goto l_2; - - /* PROCEDURE DIVISION */ - - /* Line: 15 : Entry prog : prog.cob */ - l_2:; - - /* Line: 15 : TRANSFORM : prog.cob */ - cob_inspect_init_converting (&f_17); - cob_inspect_start (); - cob_inspect_converting ((cob_field *)&c_1, (cob_field *)&c_2); - - /* Line: 16 : IF : prog.cob */ - if (((int)cob_cmp (&f_17, (cob_field *)&c_3) != 0)) - { - - /* Line: 17 : DISPLAY : prog.cob */ - cob_display (0, 1, 2, &c_4, &f_17); - } - - /* Line: 19 : TRANSFORM : prog.cob */ - cob_inspect_init_converting (&f_17); - cob_inspect_start (); - cob_inspect_converting (&f_native, &f_ascii_ebcdic); - - /* Line: 21 : STOP RUN : prog.cob */ - cob_stop_run (b_2); - - /* Program exit */ - - /* Decrement module active count */ - if (module->module_active) { - module->module_active--; - } - - /* Pop module stack */ - cob_module_leave (module); - - /* Program return */ - return b_2; - - /* Frame stack jump table */ - P_switch: - P_cgerror: - cob_fatal_error (COB_FERROR_CODEGEN); - - - /* Program initialization */ - P_initialize: - - cob_module_path = cob_glob_ptr->cob_main_argv0; - - prog_module_init (module); - - module->collating_sequence = NULL; - module->crt_status = NULL; - module->cursor_pos = NULL; - module->xml_code = NULL; - module->xml_event = NULL; - module->xml_information = NULL; - module->xml_namespace = NULL; - module->xml_namespace_prefix = NULL; - module->xml_nnamespace = NULL; - module->xml_nnamespace_prefix = NULL; - module->xml_ntext = NULL; - module->xml_text = NULL; - module->json_code = NULL; - module->json_status = NULL; - - /* Initialize cancel callback */ - cob_set_cancel (module); - - /* Initialize WORKING-STORAGE */ - /* initialize field RETURN-CODE */ - b_2 = 0; - - /* initialize field X */ - memcpy (b_17, "BCA", 3); - - - if (0 == 1) goto P_cgerror; - initialized = 1; - goto P_ret_initialize; - - P_dump: - return 0; - - - /* CANCEL callback handling */ - P_cancel: - - if (!initialized) - return 0; - if (module && module->module_active) - cob_fatal_error (COB_FERROR_CANCEL); - - initialized = 0; - - P_clear_decimal: - return 0; - -} - -/* End PROGRAM-ID 'prog' */ - -/* Initialize module structure for prog */ -static void prog_module_init (cob_module *module) -{ - module->module_name = "prog"; - module->module_formatted_date = COB_MODULE_FORMATTED_DATE; - module->module_source = COB_SOURCE_FILE; - module->gc_version = COB_PACKAGE_VERSION; - module->module_entry.funcptr = (void *(*)())prog; - module->module_cancel.funcptr = (void *(*)())prog_; - module->module_ref_count = NULL; - module->module_path = &cob_module_path; - module->module_active = 0; - module->module_date = COB_MODULE_DATE; - module->module_time = COB_MODULE_TIME; - module->module_type = 0; - module->module_param_cnt = 0; - module->ebcdic_sign = 0; - module->decimal_point = '.'; - module->currency_symbol = '$'; - module->numeric_separator = ','; - module->flag_filename_mapping = 1; - module->flag_binary_truncate = 1; - module->flag_pretty_display = 1; - module->flag_host_sign = 0; - module->flag_no_phys_canc = 1; - module->flag_main = 1; - module->flag_fold_call = 0; - module->flag_exit_program = 0; - module->flag_debug_trace = 0; - module->flag_dump_ready = 0; - module->xml_mode = 1; - module->module_stmt = 0; - module->module_sources = NULL; -} - -/* End functions */ - - -]]) - -AT_CHECK([$COMPILE prog.c], [0], [], []) -AT_CHECK([$COBCRUN_DIRECT ./prog], [0], [], []) - -AT_CLEANUP - - AT_SETUP([STRING WITH POINTER ON OVERFLOW with DELIMITER]) AT_KEYWORDS([backcomp runmisc exceptions]) @@ -1595,975 +1197,39 @@ PRM(4) is rolling stone : AT_CLEANUP -# Note: EXAMINE was dropped with COBOL85, but some dialects -# still support that - -AT_SETUP([EXAMINE TALLYING]) -AT_KEYWORDS([backcomp runmisc]) - -AT_DATA([prog.c], [[ -/* Generated by cobc 3.2.0 */ -/* Generated from prog.cob */ -/* Generated at avril 23 2024 11:56:21 */ -/* GnuCOBOL build date Apr 17 2024 11:34:39 */ -/* GnuCOBOL package date Jul 28 2023 17:02:56 UTC */ -/* Compile command /opt/gnucobol/gnucobol-3.2/bin/cobc -Cx -fno-computed-goto prog.cob */ - -#include /* for memcpy, memcmp and friends */ -#define COB_KEYWORD_INLINE __inline -#include - -#define COB_SOURCE_FILE "prog.cob" -#define COB_PACKAGE_VERSION "3.2" -#define COB_PATCH_LEVEL 0 -#define COB_MODULE_FORMATTED_DATE "avril 23 2024 11:56:21" -#define COB_MODULE_DATE 20240423 -#define COB_MODULE_TIME 115621 - -/* Global variables */ -/* Generated by cobc 3.2.0 */ -/* Generated from prog.cob */ -/* Generated at avril 23 2024 11:56:21 */ -/* GnuCOBOL build date Apr 17 2024 11:34:39 */ -/* GnuCOBOL package date Jul 28 2023 17:02:56 UTC */ -/* Compile command /opt/gnucobol/gnucobol-3.2/bin/cobc -Cx -fno-computed-goto prog.cob */ - - -/* Module path */ -static const char *cob_module_path = NULL; - -/* Number of call parameters */ -static int cob_call_params = 0; - -/* Data storage */ - -/* PROGRAM-ID : prog */ -static cob_u8_t b_4[4] __attribute__((aligned)); /* TALLY */ - -/* End of data storage */ - - -/* Attributes */ - -static const cob_field_attr a_1 = {0x21, 0, 0, 0x0000, NULL}; -static const cob_field_attr a_2 = {0x1b, 5, 0, 0x0820, NULL}; -static const cob_field_attr a_3 = {0x21, 0, 0, 0x1000, NULL}; -static const cob_field_attr a_4 = {0x10, 7, 2, 0x0001, NULL}; -static const cob_field_attr a_5 = {0x10, 1, 0, 0x1000, NULL}; -static const cob_field_attr a_6 = {0x10, 7, 2, 0x0007, NULL}; - - -/* Fields */ - -/* PROGRAM-ID : prog */ -static cob_field f_4 = {4, b_4, &a_2}; /* TALLY */ - -/* End of fields */ - - -/* Constants */ -static const cob_field c_1 = {1, (cob_u8_ptr)"A", &a_3}; -static const cob_field c_2 = {19, (cob_u8_ptr)"Should be 4 but is ", &a_3}; -static const cob_field c_3 = {19, (cob_u8_ptr)"Should be 2 but is ", &a_3}; -static const cob_field c_4 = {1, (cob_u8_ptr)"C", &a_3}; -static const cob_field c_5 = {19, (cob_u8_ptr)"Should be 5 but is ", &a_3}; -static const cob_field c_6 = {1, (cob_u8_ptr)"Z", &a_3}; -static const cob_field c_7 = {26, (cob_u8_ptr)"Should be ZZBZBCZB but is ", &a_3}; -static const cob_field c_8 = {26, (cob_u8_ptr)"Should be AABZBCZB but is ", &a_3}; -static const cob_field c_9 = {1, (cob_u8_ptr)"X", &a_3}; -static const cob_field c_10 = {26, (cob_u8_ptr)"Should be XXXXXCZB but is ", &a_3}; -static const cob_field c_11 = {1, (cob_u8_ptr)"Y", &a_3}; -static const cob_field c_12 = {19, (cob_u8_ptr)"Should be 8 but is ", &a_3}; -static const cob_field c_13 = {26, (cob_u8_ptr)"Should be YYYYYYYY but is ", &a_3}; -static const cob_field c_14 = {1, (cob_u8_ptr)"5", &a_5}; -static const cob_field c_15 = {1, (cob_u8_ptr)"8", &a_5}; -static const cob_field c_16 = {8, (cob_u8_ptr)"-8888855", &a_6}; -static const cob_field c_17 = {27, (cob_u8_ptr)"Should be -88888.55 but is ", &a_3}; - - -static COB_INLINE COB_A_INLINE int -cob_cmpswp_u32 (const void *p, const cob_s64_t n) -{ - void *x; - unsigned int val; - if (unlikely(n < 0)) { - return 1; - } - x = &val; - optim_memcpy (x, p, 4); - val = COB_BSWAP_32 (val); - return (val < n) ? -1 : (val > n); -} - - - -/* Function prototypes */ - -static int prog (); -static int prog_ (const int); -static void prog_module_init (cob_module *module); - -/* Main function */ -int -main (int argc, char **argv) -{ - cob_init (argc, argv); - cob_stop_run (prog ()); -} - -/* Functions */ - -static void gc_module_so_init () __attribute__ ((constructor)); -static void gc_module_so_init () -{ - cob_check_version (COB_SOURCE_FILE, COB_PACKAGE_VERSION, COB_PATCH_LEVEL); -} - -/* PROGRAM-ID 'prog' */ - -/* ENTRY 'prog' */ - -static int -prog () -{ - return prog_ (0); -} - -static int -prog_ (const int entry) -{ - /* Program local variables */ - /* Generated by cobc 3.2.0 */ - /* Generated from prog.cob */ - /* Generated at avril 23 2024 11:56:21 */ - /* GnuCOBOL build date Apr 17 2024 11:34:39 */ - /* GnuCOBOL package date Jul 28 2023 17:02:56 UTC */ - /* Compile command /opt/gnucobol/gnucobol-3.2/bin/cobc -Cx -fno-computed-goto prog.cob */ - - /* Program local variables for 'prog' */ - - /* Module initialization indicator */ - static unsigned int initialized = 0; - - /* Module structure pointer */ - static cob_module *module = NULL; - - /* Global variable pointer */ - cob_global *cob_glob_ptr; - - - /* LINKAGE SECTION (Items not referenced by USING clause) */ - static unsigned char *b_9 = NULL; /* XML-NAMESPACE */ - static unsigned char *b_10 = NULL; /* XML-NAMESPACE-PREFIX */ - static unsigned char *b_11 = NULL; /* XML-NNAMESPACE */ - static unsigned char *b_12 = NULL; /* XML-NNAMESPACE-PREFIX */ - static unsigned char *b_13 = NULL; /* XML-NTEXT */ - static unsigned char *b_14 = NULL; /* XML-TEXT */ - - - /* Call parameters */ - cob_field *cob_procedure_params[1]; - - /* Perform frame stack */ - struct cob_frame *frame_ptr; - struct cob_frame frame_stack[255]; - - - /* Data storage */ - static int b_2; /* RETURN-CODE */ - static cob_u8_t b_17[8] __attribute__((aligned)); /* X */ - static cob_u8_t b_18[7] __attribute__((aligned)); /* N */ - static cob_u8_t b_19[10] __attribute__((aligned)); /* T */ - - /* End of local data storage */ - - - /* Fields (local) */ - static cob_field f_17 = {8, b_17, &a_1}; /* X */ - static cob_field f_18 = {7, b_18, &a_4}; /* N */ - - /* End of fields */ - - - - /* Start of function code */ - - /* CANCEL callback */ - if (unlikely(entry < 0)) { - if (entry == -10) - goto P_dump; - if (entry == -20) - goto P_clear_decimal; - goto P_cancel; - } - - /* Check initialized, check module allocated, */ - /* set global pointer, */ - /* push module stack, save call parameter count */ - if (cob_module_global_enter (&module, &cob_glob_ptr, 0, entry, 0)) - return -1; - - /* Set address of module parameter list */ - module->cob_procedure_params = cob_procedure_params; - - /* Set frame stack pointer */ - frame_ptr = frame_stack; - frame_ptr->perform_through = 0; - - /* Initialize rest of program */ - if (unlikely(initialized == 0)) { - goto P_initialize; - } - P_ret_initialize: - - /* Increment module active */ - module->module_active++; - - /* Entry dispatch */ - goto l_2; - - /* PROCEDURE DIVISION */ - - /* Line: 9 : Entry prog : prog.cob */ - l_2:; - - /* Line: 9 : EXAMINE : prog.cob */ - memset (/* TALLY */b_4, 0, (int)f_4.size); - cob_inspect_init (&f_17, 0); - cob_inspect_start (); - cob_inspect_all (&f_4, (cob_field *)&c_1); - cob_inspect_finish (); - - /* Line: 10 : IF : prog.cob */ - if (((int)cob_cmpswp_u32 (b_4, 4LL) != 0)) - { - - /* Line: 11 : DISPLAY : prog.cob */ - cob_display (0, 1, 2, &c_2, &f_4); - } - - /* Line: 12 : EXAMINE : prog.cob */ - memset (/* TALLY */b_4, 0, (int)f_4.size); - cob_inspect_init (&f_17, 0); - cob_inspect_start (); - cob_inspect_leading (&f_4, (cob_field *)&c_1); - cob_inspect_finish (); - - /* Line: 13 : IF : prog.cob */ - if (((int)cob_cmpswp_u32 (b_4, 2LL) != 0)) - { - - /* Line: 14 : DISPLAY : prog.cob */ - cob_display (0, 1, 2, &c_3, &f_4); - } - - /* Line: 15 : EXAMINE : prog.cob */ - memset (/* TALLY */b_4, 0, (int)f_4.size); - cob_inspect_init (&f_17, 0); - cob_inspect_start (); - cob_inspect_before ((cob_field *)&c_4); - cob_inspect_characters (&f_4); - cob_inspect_finish (); - - /* Line: 16 : IF : prog.cob */ - if (((int)cob_cmpswp_u32 (b_4, 5LL) != 0)) - { - - /* Line: 17 : DISPLAY : prog.cob */ - cob_display (0, 1, 2, &c_5, &f_4); - } - - /* Line: 18 : EXAMINE : prog.cob */ - memset (/* TALLY */b_4, 0, (int)f_4.size); - cob_inspect_init (&f_17, 0); - cob_inspect_start (); - cob_inspect_all (&f_4, (cob_field *)&c_1); - cob_inspect_finish (); - cob_inspect_init (&f_17, 1); - cob_inspect_start (); - cob_inspect_all ((cob_field *)&c_6, (cob_field *)&c_1); - cob_inspect_finish (); - - /* Line: 19 : IF : prog.cob */ - if (((int)cob_cmpswp_u32 (b_4, 4LL) != 0)) - { - - /* Line: 20 : DISPLAY : prog.cob */ - cob_display (0, 1, 2, &c_2, &f_4); - } - - /* Line: 21 : IF : prog.cob */ - if (((int)memcmp (b_17, (cob_u8_ptr)"ZZBZBCZB", 8) != 0)) - { - - /* Line: 22 : DISPLAY : prog.cob */ - cob_display (0, 1, 2, &c_7, &f_17); - } - - /* Line: 23 : EXAMINE : prog.cob */ - memset (/* TALLY */b_4, 0, (int)f_4.size); - cob_inspect_init (&f_17, 0); - cob_inspect_start (); - cob_inspect_leading (&f_4, (cob_field *)&c_6); - cob_inspect_finish (); - cob_inspect_init (&f_17, 1); - cob_inspect_start (); - cob_inspect_leading ((cob_field *)&c_1, (cob_field *)&c_6); - cob_inspect_finish (); - - /* Line: 24 : IF : prog.cob */ - if (((int)cob_cmpswp_u32 (b_4, 2LL) != 0)) - { - - /* Line: 25 : DISPLAY : prog.cob */ - cob_display (0, 1, 2, &c_3, &f_4); - } - - /* Line: 26 : IF : prog.cob */ - if (((int)memcmp (b_17, (cob_u8_ptr)"AABZBCZB", 8) != 0)) - { - - /* Line: 27 : DISPLAY : prog.cob */ - cob_display (0, 1, 2, &c_8, &f_17); - } - - /* Line: 28 : EXAMINE : prog.cob */ - memset (/* TALLY */b_4, 0, (int)f_4.size); - cob_inspect_init (&f_17, 0); - cob_inspect_start (); - cob_inspect_before ((cob_field *)&c_4); - cob_inspect_characters (&f_4); - cob_inspect_finish (); - cob_inspect_init (&f_17, 1); - cob_inspect_start (); - cob_inspect_before ((cob_field *)&c_4); - cob_inspect_characters ((cob_field *)&c_9); - cob_inspect_finish (); - - /* Line: 29 : IF : prog.cob */ - if (((int)cob_cmpswp_u32 (b_4, 5LL) != 0)) - { - - /* Line: 30 : DISPLAY : prog.cob */ - cob_display (0, 1, 2, &c_5, &f_4); - } - - /* Line: 31 : IF : prog.cob */ - if (((int)memcmp (b_17, (cob_u8_ptr)"XXXXXCZB", 8) != 0)) - { - - /* Line: 32 : DISPLAY : prog.cob */ - cob_display (0, 1, 2, &c_10, &f_17); - } - - /* Line: 33 : EXAMINE : prog.cob */ - memset (/* TALLY */b_4, 0, (int)f_4.size); - cob_inspect_init (&f_17, 0); - cob_inspect_start (); - cob_inspect_before ((cob_field *)&c_11); - cob_inspect_characters (&f_4); - cob_inspect_finish (); - cob_inspect_init (&f_17, 1); - cob_inspect_start (); - cob_inspect_before ((cob_field *)&c_11); - cob_inspect_characters ((cob_field *)&c_11); - cob_inspect_finish (); - - /* Line: 34 : IF : prog.cob */ - if (((int)cob_cmpswp_u32 (b_4, 8LL) != 0)) - { - - /* Line: 35 : DISPLAY : prog.cob */ - cob_display (0, 1, 2, &c_12, &f_4); - } - - /* Line: 36 : IF : prog.cob */ - if (((int)memcmp (b_17, (cob_u8_ptr)"YYYYYYYY", 8) != 0)) - { - - /* Line: 37 : DISPLAY : prog.cob */ - cob_display (0, 1, 2, &c_13, &f_17); - } - - /* Line: 38 : EXAMINE : prog.cob */ - memset (/* TALLY */b_4, 0, (int)f_4.size); - cob_inspect_init (&f_18, 0); - cob_inspect_start (); - cob_inspect_before ((cob_field *)&c_14); - cob_inspect_characters (&f_4); - cob_inspect_finish (); - cob_inspect_init (&f_18, 1); - cob_inspect_start (); - cob_inspect_before ((cob_field *)&c_14); - cob_inspect_characters ((cob_field *)&c_15); - cob_inspect_finish (); - - /* Line: 39 : IF : prog.cob */ - if (((int)cob_cmp (&f_18, (cob_field *)&c_16) != 0)) - { - - /* Line: 40 : DISPLAY : prog.cob */ - cob_display (0, 1, 2, &c_17, &f_18); - } - - /* Line: 45 : STOP RUN : prog.cob */ - cob_stop_run (b_2); - - /* Program exit */ - - /* Decrement module active count */ - if (module->module_active) { - module->module_active--; - } - - /* Pop module stack */ - cob_module_leave (module); - - /* Program return */ - return b_2; - - /* Frame stack jump table */ - P_switch: - P_cgerror: - cob_fatal_error (COB_FERROR_CODEGEN); - - - /* Program initialization */ - P_initialize: - - cob_module_path = cob_glob_ptr->cob_main_argv0; - - prog_module_init (module); - - module->collating_sequence = NULL; - module->crt_status = NULL; - module->cursor_pos = NULL; - module->xml_code = NULL; - module->xml_event = NULL; - module->xml_information = NULL; - module->xml_namespace = NULL; - module->xml_namespace_prefix = NULL; - module->xml_nnamespace = NULL; - module->xml_nnamespace_prefix = NULL; - module->xml_ntext = NULL; - module->xml_text = NULL; - module->json_code = NULL; - module->json_status = NULL; - - /* Initialize cancel callback */ - cob_set_cancel (module); - - /* Initialize WORKING-STORAGE */ - /* initialize field RETURN-CODE */ - b_2 = 0; - - /* initialize field TALLY */ - memset (b_4, 0, 4); - - /* initialize field X */ - memcpy (b_17, "AABABCAB", 8); - - /* initialize field N */ - memcpy (b_18, "111225u", 7); - - /* initialize field T */ - memcpy (b_19, " 8 ", 10); - - - if (0 == 1) goto P_cgerror; - initialized = 1; - goto P_ret_initialize; - - P_dump: - return 0; - - - /* CANCEL callback handling */ - P_cancel: - - if (!initialized) - return 0; - if (module && module->module_active) - cob_fatal_error (COB_FERROR_CANCEL); - - initialized = 0; - - P_clear_decimal: - return 0; - -} - -/* End PROGRAM-ID 'prog' */ - -/* Initialize module structure for prog */ -static void prog_module_init (cob_module *module) -{ - module->module_name = "prog"; - module->module_formatted_date = COB_MODULE_FORMATTED_DATE; - module->module_source = COB_SOURCE_FILE; - module->gc_version = COB_PACKAGE_VERSION; - module->module_entry.funcptr = (void *(*)())prog; - module->module_cancel.funcptr = (void *(*)())prog_; - module->module_ref_count = NULL; - module->module_path = &cob_module_path; - module->module_active = 0; - module->module_date = COB_MODULE_DATE; - module->module_time = COB_MODULE_TIME; - module->module_type = 0; - module->module_param_cnt = 0; - module->ebcdic_sign = 0; - module->decimal_point = '.'; - module->currency_symbol = '$'; - module->numeric_separator = ','; - module->flag_filename_mapping = 1; - module->flag_binary_truncate = 1; - module->flag_pretty_display = 1; - module->flag_host_sign = 0; - module->flag_no_phys_canc = 1; - module->flag_main = 1; - module->flag_fold_call = 0; - module->flag_exit_program = 0; - module->flag_debug_trace = 0; - module->flag_dump_ready = 0; - module->xml_mode = 1; - module->module_stmt = 0; - module->module_sources = NULL; -} - -/* End functions */ - - -]]) - -AT_CHECK([$COMPILE prog.c], [0], [], []) -AT_CHECK([$COBCRUN_DIRECT ./prog], [0], [], []) - -AT_CLEANUP - -AT_SETUP([EXAMINE REPLACING]) -AT_KEYWORDS([backcomp runmisc]) - -AT_DATA([prog.c], [[ -/* Generated by cobc 3.2.0 */ -/* Generated from prog.cob */ -/* Generated at avril 23 2024 11:57:18 */ -/* GnuCOBOL build date Apr 17 2024 11:34:39 */ -/* GnuCOBOL package date Jul 28 2023 17:02:56 UTC */ -/* Compile command /opt/gnucobol/gnucobol-3.2/bin/cobc -Cx -fno-computed-goto prog.cob */ - -#include /* for memcpy, memcmp and friends */ -#define COB_KEYWORD_INLINE __inline -#include - -#define COB_SOURCE_FILE "prog.cob" -#define COB_PACKAGE_VERSION "3.2" -#define COB_PATCH_LEVEL 0 -#define COB_MODULE_FORMATTED_DATE "avril 23 2024 11:57:18" -#define COB_MODULE_DATE 20240423 -#define COB_MODULE_TIME 115718 - -/* Global variables */ -/* Generated by cobc 3.2.0 */ -/* Generated from prog.cob */ -/* Generated at avril 23 2024 11:57:18 */ -/* GnuCOBOL build date Apr 17 2024 11:34:39 */ -/* GnuCOBOL package date Jul 28 2023 17:02:56 UTC */ -/* Compile command /opt/gnucobol/gnucobol-3.2/bin/cobc -Cx -fno-computed-goto prog.cob */ - - -/* Module path */ -static const char *cob_module_path = NULL; - -/* Number of call parameters */ -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_2 = {0x21, 0, 0, 0x1000, NULL}; -static const cob_field_attr a_3 = {0x10, 5, 0, 0x0001, NULL}; -static const cob_field_attr a_4 = {0x10, 1, 0, 0x1000, NULL}; - - -/* Constants */ -static const cob_field c_1 = {1, (cob_u8_ptr)"X", &a_2}; -static const cob_field c_2 = {1, (cob_u8_ptr)"A", &a_2}; -static const cob_field c_3 = {26, (cob_u8_ptr)"Should be XXBXBCXB but is ", &a_2}; -static const cob_field c_4 = {1, (cob_u8_ptr)"Y", &a_2}; -static const cob_field c_5 = {26, (cob_u8_ptr)"Should be YYBXBCXB but is ", &a_2}; -static const cob_field c_6 = {1, (cob_u8_ptr)"C", &a_2}; -static const cob_field c_7 = {1, (cob_u8_ptr)"B", &a_2}; -static const cob_field c_8 = {26, (cob_u8_ptr)"Should be YYCXBCXB but is ", &a_2}; -static const cob_field c_9 = {1, (cob_u8_ptr)"Z", &a_2}; -static const cob_field c_10 = {26, (cob_u8_ptr)"Should be ZZZZBCXB but is ", &a_2}; -static const cob_field c_11 = {1, (cob_u8_ptr)"3", &a_4}; -static const cob_field c_12 = {1, (cob_u8_ptr)"1", &a_4}; -static const cob_field c_13 = {24, (cob_u8_ptr)"Should be -33322 but is ", &a_2}; - - - -/* Function prototypes */ - -static int prog (); -static int prog_ (const int); -static void prog_module_init (cob_module *module); - -/* Main function */ -int -main (int argc, char **argv) -{ - cob_init (argc, argv); - cob_stop_run (prog ()); -} - -/* Functions */ - -static void gc_module_so_init () __attribute__ ((constructor)); -static void gc_module_so_init () -{ - cob_check_version (COB_SOURCE_FILE, COB_PACKAGE_VERSION, COB_PATCH_LEVEL); -} - -/* PROGRAM-ID 'prog' */ - -/* ENTRY 'prog' */ - -static int -prog () -{ - return prog_ (0); -} - -static int -prog_ (const int entry) -{ - /* Program local variables */ - /* Generated by cobc 3.2.0 */ - /* Generated from prog.cob */ - /* Generated at avril 23 2024 11:57:18 */ - /* GnuCOBOL build date Apr 17 2024 11:34:39 */ - /* GnuCOBOL package date Jul 28 2023 17:02:56 UTC */ - /* Compile command /opt/gnucobol/gnucobol-3.2/bin/cobc -Cx -fno-computed-goto prog.cob */ - - /* Program local variables for 'prog' */ - - /* Module initialization indicator */ - static unsigned int initialized = 0; - - /* Module structure pointer */ - static cob_module *module = NULL; - - /* Global variable pointer */ - cob_global *cob_glob_ptr; - - - /* LINKAGE SECTION (Items not referenced by USING clause) */ - static unsigned char *b_9 = NULL; /* XML-NAMESPACE */ - static unsigned char *b_10 = NULL; /* XML-NAMESPACE-PREFIX */ - static unsigned char *b_11 = NULL; /* XML-NNAMESPACE */ - static unsigned char *b_12 = NULL; /* XML-NNAMESPACE-PREFIX */ - static unsigned char *b_13 = NULL; /* XML-NTEXT */ - static unsigned char *b_14 = NULL; /* XML-TEXT */ - - - /* Call parameters */ - cob_field *cob_procedure_params[1]; - - /* Perform frame stack */ - struct cob_frame *frame_ptr; - struct cob_frame frame_stack[255]; - - - /* Data storage */ - static int b_2; /* RETURN-CODE */ - static cob_u8_t b_17[8] __attribute__((aligned)); /* X */ - static cob_u8_t b_18[1] __attribute__((aligned)); /* Y */ - static cob_u8_t b_19[5] __attribute__((aligned)); /* N */ - - /* End of local data storage */ - - - /* Fields (local) */ - static cob_field f_17 = {8, b_17, &a_1}; /* X */ - static cob_field f_19 = {5, b_19, &a_3}; /* N */ - - /* End of fields */ - - - - /* Start of function code */ - - /* CANCEL callback */ - if (unlikely(entry < 0)) { - if (entry == -10) - goto P_dump; - if (entry == -20) - goto P_clear_decimal; - goto P_cancel; - } - - /* Check initialized, check module allocated, */ - /* set global pointer, */ - /* push module stack, save call parameter count */ - if (cob_module_global_enter (&module, &cob_glob_ptr, 0, entry, 0)) - return -1; - - /* Set address of module parameter list */ - module->cob_procedure_params = cob_procedure_params; - - /* Set frame stack pointer */ - frame_ptr = frame_stack; - frame_ptr->perform_through = 0; - - /* Initialize rest of program */ - if (unlikely(initialized == 0)) { - goto P_initialize; - } - P_ret_initialize: - - /* Increment module active */ - module->module_active++; - - /* Entry dispatch */ - goto l_2; - - /* PROCEDURE DIVISION */ - - /* Line: 9 : Entry prog : prog.cob */ - l_2:; - - /* Line: 9 : EXAMINE : prog.cob */ - cob_inspect_init (&f_17, 1); - cob_inspect_start (); - cob_inspect_all ((cob_field *)&c_1, (cob_field *)&c_2); - cob_inspect_finish (); - - /* Line: 10 : IF : prog.cob */ - if (((int)memcmp (b_17, (cob_u8_ptr)"XXBXBCXB", 8) != 0)) - { - - /* Line: 11 : DISPLAY : prog.cob */ - cob_display (0, 1, 2, &c_3, &f_17); - } - - /* Line: 12 : EXAMINE : prog.cob */ - cob_inspect_init (&f_17, 1); - cob_inspect_start (); - cob_inspect_leading ((cob_field *)&c_4, (cob_field *)&c_1); - cob_inspect_finish (); - - /* Line: 13 : IF : prog.cob */ - if (((int)memcmp (b_17, (cob_u8_ptr)"YYBXBCXB", 8) != 0)) - { - - /* Line: 14 : DISPLAY : prog.cob */ - cob_display (0, 1, 2, &c_5, &f_17); - } - - /* Line: 15 : EXAMINE : prog.cob */ - cob_inspect_init (&f_17, 1); - cob_inspect_start (); - cob_inspect_first ((cob_field *)&c_6, (cob_field *)&c_7); - cob_inspect_finish (); - - /* Line: 16 : IF : prog.cob */ - if (((int)memcmp (b_17, (cob_u8_ptr)"YYCXBCXB", 8) != 0)) - { - - /* Line: 17 : DISPLAY : prog.cob */ - cob_display (0, 1, 2, &c_8, &f_17); - } - - /* Line: 18 : EXAMINE : prog.cob */ - cob_inspect_init (&f_17, 1); - cob_inspect_start (); - cob_inspect_before ((cob_field *)&c_7); - cob_inspect_characters ((cob_field *)&c_9); - cob_inspect_finish (); - - /* Line: 19 : IF : prog.cob */ - if (((int)memcmp (b_17, (cob_u8_ptr)"ZZZZBCXB", 8) != 0)) - { - - /* Line: 20 : DISPLAY : prog.cob */ - cob_display (0, 1, 2, &c_10, &f_17); - } - - /* Line: 21 : EXAMINE : prog.cob */ - cob_inspect_init (&f_19, 1); - cob_inspect_start (); - cob_inspect_all ((cob_field *)&c_11, (cob_field *)&c_12); - cob_inspect_finish (); - - /* Line: 22 : IF : prog.cob */ - if (((int)cob_cmp_numdisp (b_19, 5, -33322LL, 1) != 0)) - { - - /* Line: 23 : DISPLAY : prog.cob */ - cob_display (0, 1, 2, &c_13, &f_19); - } - - /* Line: 24 : STOP RUN : prog.cob */ - cob_stop_run (b_2); - - /* Program exit */ - - /* Decrement module active count */ - if (module->module_active) { - module->module_active--; - } - - /* Pop module stack */ - cob_module_leave (module); - - /* Program return */ - return b_2; - - /* Frame stack jump table */ - P_switch: - P_cgerror: - cob_fatal_error (COB_FERROR_CODEGEN); - - - /* Program initialization */ - P_initialize: - - cob_module_path = cob_glob_ptr->cob_main_argv0; - - prog_module_init (module); - - module->collating_sequence = NULL; - module->crt_status = NULL; - module->cursor_pos = NULL; - module->xml_code = NULL; - module->xml_event = NULL; - module->xml_information = NULL; - module->xml_namespace = NULL; - module->xml_namespace_prefix = NULL; - module->xml_nnamespace = NULL; - module->xml_nnamespace_prefix = NULL; - module->xml_ntext = NULL; - module->xml_text = NULL; - module->json_code = NULL; - module->json_status = NULL; - - /* Initialize cancel callback */ - cob_set_cancel (module); - - /* Initialize WORKING-STORAGE */ - /* initialize field RETURN-CODE */ - b_2 = 0; - - /* initialize field X */ - memcpy (b_17, "AABABCAB", 8); - - /* initialize field Y */ - *(cob_u8_ptr)(b_18) = (unsigned char)'Y'; - - /* initialize field N */ - memcpy (b_19, "1112r", 5); - - - if (0 == 1) goto P_cgerror; - initialized = 1; - goto P_ret_initialize; - - P_dump: - return 0; - - - /* CANCEL callback handling */ - P_cancel: - - if (!initialized) - return 0; - if (module && module->module_active) - cob_fatal_error (COB_FERROR_CANCEL); - - initialized = 0; - - P_clear_decimal: - return 0; - -} - -/* End PROGRAM-ID 'prog' */ - -/* Initialize module structure for prog */ -static void prog_module_init (cob_module *module) -{ - module->module_name = "prog"; - module->module_formatted_date = COB_MODULE_FORMATTED_DATE; - module->module_source = COB_SOURCE_FILE; - module->gc_version = COB_PACKAGE_VERSION; - module->module_entry.funcptr = (void *(*)())prog; - module->module_cancel.funcptr = (void *(*)())prog_; - module->module_ref_count = NULL; - module->module_path = &cob_module_path; - module->module_active = 0; - module->module_date = COB_MODULE_DATE; - module->module_time = COB_MODULE_TIME; - module->module_type = 0; - module->module_param_cnt = 0; - module->ebcdic_sign = 0; - module->decimal_point = '.'; - module->currency_symbol = '$'; - module->numeric_separator = ','; - module->flag_filename_mapping = 1; - module->flag_binary_truncate = 1; - module->flag_pretty_display = 1; - module->flag_host_sign = 0; - module->flag_no_phys_canc = 1; - module->flag_main = 1; - module->flag_fold_call = 0; - module->flag_exit_program = 0; - module->flag_debug_trace = 0; - module->flag_dump_ready = 0; - module->xml_mode = 1; - module->module_stmt = 0; - module->module_sources = NULL; -} - -/* End functions */ - - -]]) - -AT_CHECK([$COMPILE prog.c], [0], [], []) -AT_CHECK([$COBCRUN_DIRECT ./prog], [0], [], []) - -AT_CLEANUP - - -AT_SETUP([SORT: EBCDIC table]) -AT_KEYWORDS([runmisc SORT ALPHABET OBJECT-COMPUTER]) +AT_SETUP([SORT: EBCDIC table]) +AT_KEYWORDS([runmisc SORT ALPHABET OBJECT-COMPUTER]) AT_DATA([prog.c], [[ -/* Generated by cobc 3.2.0 */ +/* Generated by cobc 2.2.0 */ /* Generated from prog.cob */ -/* Generated at juil. 23 2024 13:50:56 */ -/* GnuCOBOL build date Apr 17 2024 11:34:39 */ -/* GnuCOBOL package date Jul 28 2023 17:02:56 UTC */ -/* Compile command /opt/gnucobol/gnucobol-3.2/bin/cobc -Cx -fno-computed-goto prog.cob */ +/* Generated at juil. 23 2024 16:25:46 */ +/* 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 */ -#include /* for memcpy, memcmp and friends */ +#include +#include +#include +#include +#include #define COB_KEYWORD_INLINE __inline #include #define COB_SOURCE_FILE "prog.cob" -#define COB_PACKAGE_VERSION "3.2" +#define COB_PACKAGE_VERSION "2.2" #define COB_PATCH_LEVEL 0 -#define COB_MODULE_FORMATTED_DATE "juil. 23 2024 13:50:56" +#define COB_MODULE_FORMATTED_DATE "juil. 23 2024 16:25:46" #define COB_MODULE_DATE 20240723 -#define COB_MODULE_TIME 135056 +#define COB_MODULE_TIME 162546 /* Global variables */ -/* Generated by cobc 3.2.0 */ +/* Generated by cobc 2.2.0 */ /* Generated from prog.cob */ -/* Generated at juil. 23 2024 13:50:56 */ -/* GnuCOBOL build date Apr 17 2024 11:34:39 */ -/* GnuCOBOL package date Jul 28 2023 17:02:56 UTC */ -/* Compile command /opt/gnucobol/gnucobol-3.2/bin/cobc -Cx -fno-computed-goto prog.cob */ +/* Generated at juil. 23 2024 16:25:46 */ +/* 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 */ /* Module path */ @@ -2585,48 +1251,48 @@ static const cob_field c_2 = {10, (cob_u8_ptr)"54321edcba", &a_3}; /* ASCII to EBCDIC table */ -static const unsigned char cob_ascii_ebcdic[256] = { - 0000, 0x01, 0x02, 0x03, 0x37, 0x2d, 0x2e, 0x2f, - 0x16, 0x05, 0x25, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, - 0x10, 0x11, 0x12, 0x13, 0x3c, 0x3d, 0x32, 0x26, - 0x18, 0x19, 0x3f, 0x27, 0x1c, 0x1d, 0x1e, 0x1f, - 0x40, 0x5a, 0x7f, 0x7b, 0x5b, 0x6c, 0x50, 0x7d, - 0x4d, 0x5d, 0x5c, 0x4e, 0x6b, 0x60, 0x4b, 0x61, - 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, - 0xf8, 0xf9, 0x7a, 0x5e, 0x4c, 0x7e, 0x6e, 0x6f, - 0x7c, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, - 0xc8, 0xc9, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, - 0xd7, 0xd8, 0xd9, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, - 0xe7, 0xe8, 0xe9, 0xad, 0xe0, 0xbd, 0x5f, 0x6d, +static const unsigned char cob_ascii_ebcdic[256] = { + 0x00, 0x01, 0x02, 0x03, 0x37, 0x2D, 0x2E, 0x2F, + 0x16, 0x05, 0x25, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, + 0x10, 0x11, 0x12, 0x13, 0x3C, 0x3D, 0x32, 0x26, + 0x18, 0x19, 0x3F, 0x27, 0x1C, 0x1D, 0x1E, 0x1F, + 0x40, 0x5A, 0x7F, 0x7B, 0x5B, 0x6C, 0x50, 0x7D, + 0x4D, 0x5D, 0x5C, 0x4E, 0x6B, 0x60, 0x4B, 0x61, + 0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7, + 0xF8, 0xF9, 0x7A, 0x5E, 0x4C, 0x7E, 0x6E, 0x6F, + 0x7C, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, + 0xC8, 0xC9, 0xD1, 0xD2, 0xD3, 0xD4, 0xD5, 0xD6, + 0xD7, 0xD8, 0xD9, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, + 0xE7, 0xE8, 0xE9, 0xAD, 0xE0, 0xBD, 0x5F, 0x6D, 0x79, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, - 0x97, 0x98, 0x99, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, - 0xa7, 0xa8, 0xa9, 0xc0, 0x6a, 0xd0, 0xa1, 0x07, - 0x68, 0xdc, 0x51, 0x42, 0x43, 0x44, 0x47, 0x48, + 0x97, 0x98, 0x99, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, + 0xA7, 0xA8, 0xA9, 0xC0, 0x6A, 0xD0, 0xA1, 0x07, + 0x68, 0xDC, 0x51, 0x42, 0x43, 0x44, 0x47, 0x48, 0x52, 0x53, 0x54, 0x57, 0x56, 0x58, 0x63, 0x67, - 0x71, 0x9c, 0x9e, 0xcb, 0xcc, 0xcd, 0xdb, 0xdd, - 0xdf, 0xec, 0xfc, 0xb0, 0xb1, 0xb2, 0x3e, 0xb4, - 0x45, 0x55, 0xce, 0xde, 0x49, 0x69, 0x9a, 0x9b, - 0xab, 0x9f, 0xba, 0xb8, 0xb7, 0xaa, 0x8a, 0x8b, - 0xb6, 0xb5, 0x62, 0x4f, 0x64, 0x65, 0x66, 0x20, - 0x21, 0x22, 0x70, 0x23, 0x72, 0x73, 0x74, 0xbe, - 0x76, 0x77, 0x78, 0x80, 0x24, 0x15, 0x8c, 0x8d, - 0x8e, 0x41, 0x06, 0x17, 0x28, 0x29, 0x9d, 0x2a, - 0x2b, 0x2c, 0x09, 0x0a, 0xac, 0x4a, 0xae, 0xaf, - 0x1b, 0x30, 0x31, 0xfa, 0x1a, 0x33, 0x34, 0x35, - 0x36, 0x59, 0x08, 0x38, 0xbc, 0x39, 0xa0, 0xbf, - 0xca, 0x3a, 0xfe, 0x3b, 0x04, 0xcf, 0xda, 0x14, - 0xe1, 0x8f, 0x46, 0x75, 0xfd, 0xeb, 0xee, 0xed, - 0x90, 0xef, 0xb3, 0xfb, 0xb9, 0xea, 0xbb, 0xff, + 0x71, 0x9C, 0x9E, 0xCB, 0xCC, 0xCD, 0xDB, 0xDD, + 0xDF, 0xEC, 0xFC, 0xB0, 0xB1, 0xB2, 0x3E, 0xB4, + 0x45, 0x55, 0xCE, 0xDE, 0x49, 0x69, 0x9A, 0x9B, + 0xAB, 0x9F, 0xBA, 0xB8, 0xB7, 0xAA, 0x8A, 0x8B, + 0xB6, 0xB5, 0x62, 0x4F, 0x64, 0x65, 0x66, 0x20, + 0x21, 0x22, 0x70, 0x23, 0x72, 0x73, 0x74, 0xBE, + 0x76, 0x77, 0x78, 0x80, 0x24, 0x15, 0x8C, 0x8D, + 0x8E, 0x41, 0x06, 0x17, 0x28, 0x29, 0x9D, 0x2A, + 0x2B, 0x2C, 0x09, 0x0A, 0xAC, 0x4A, 0xAE, 0xAF, + 0x1B, 0x30, 0x31, 0xFA, 0x1A, 0x33, 0x34, 0x35, + 0x36, 0x59, 0x08, 0x38, 0xBC, 0x39, 0xA0, 0xBF, + 0xCA, 0x3A, 0xFE, 0x3B, 0x04, 0xCF, 0xDA, 0x14, + 0xE1, 0x8F, 0x46, 0x75, 0xFD, 0xEB, 0xEE, 0xED, + 0x90, 0xEF, 0xB3, 0xFB, 0xB9, 0xEA, 0xBB, 0xFF }; + /* Decimal constants */ /* Function prototypes */ static int prog (); static int prog_ (const int); -static void prog_module_init (cob_module *module); /* Main function */ int @@ -2638,12 +1304,6 @@ main (int argc, char **argv) /* Functions */ -static void gc_module_so_init () __attribute__ ((constructor)); -static void gc_module_so_init () -{ - cob_check_version (COB_SOURCE_FILE, COB_PACKAGE_VERSION, COB_PATCH_LEVEL); -} - /* PROGRAM-ID 'prog' */ /* ENTRY 'prog' */ @@ -2658,12 +1318,12 @@ static int prog_ (const int entry) { /* Program local variables */ - /* Generated by cobc 3.2.0 */ + /* Generated by cobc 2.2.0 */ /* Generated from prog.cob */ - /* Generated at juil. 23 2024 13:50:56 */ - /* GnuCOBOL build date Apr 17 2024 11:34:39 */ - /* GnuCOBOL package date Jul 28 2023 17:02:56 UTC */ - /* Compile command /opt/gnucobol/gnucobol-3.2/bin/cobc -Cx -fno-computed-goto prog.cob */ + /* Generated at juil. 23 2024 16:25:46 */ + /* 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 */ /* Program local variables for 'prog' */ @@ -2677,15 +1337,6 @@ prog_ (const int entry) cob_global *cob_glob_ptr; - /* LINKAGE SECTION (Items not referenced by USING clause) */ - static unsigned char *b_9 = NULL; /* XML-NAMESPACE */ - static unsigned char *b_10 = NULL; /* XML-NAMESPACE-PREFIX */ - static unsigned char *b_11 = NULL; /* XML-NNAMESPACE */ - static unsigned char *b_12 = NULL; /* XML-NNAMESPACE-PREFIX */ - static unsigned char *b_13 = NULL; /* XML-NTEXT */ - static unsigned char *b_14 = NULL; /* XML-TEXT */ - - /* Local cob_field items */ cob_field f0; @@ -2700,15 +1351,15 @@ prog_ (const int entry) /* Data storage */ static int b_2; /* RETURN-CODE */ - static cob_u8_t b_17[10] __attribute__((aligned)); /* Z */ - static cob_u8_t b_18[10] __attribute__((aligned)); /* G */ + static cob_u8_t b_6[10] __attribute__((aligned)); /* Z */ + static cob_u8_t b_7[10] __attribute__((aligned)); /* G */ - /* End of local data storage */ + /* End of data storage */ - /* Fields (local) */ - static cob_field f_18 = {10, b_18, &a_2}; /* G */ - static cob_field f_20 = {1, b_18, &a_1}; /* X */ + /* Fields */ + static cob_field f_7 = {10, b_7, &a_2}; /* G */ + static cob_field f_9 = {1, b_7, &a_1}; /* X */ /* End of fields */ @@ -2718,8 +1369,6 @@ prog_ (const int entry) /* CANCEL callback */ if (unlikely(entry < 0)) { - if (entry == -10) - goto P_dump; if (entry == -20) goto P_clear_decimal; goto P_cancel; @@ -2752,133 +1401,78 @@ prog_ (const int entry) /* PROCEDURE DIVISION */ - /* Line: 14 : Entry prog : prog.cob */ + /* Line: 15 : Entry prog : prog.cob */ l_2:; - /* Line: 14 : MOVE : prog.cob */ - memcpy (b_18, b_17, 10); + /* Line: 15 : MOVE : prog.cob */ + memcpy (b_7, b_6, 10); - /* Line: 16 : SORT : prog.cob */ + /* Line: 17 : SORT : prog.cob */ cob_table_sort_init (1, cob_ascii_ebcdic); - cob_table_sort_init_key (&f_20, 0, 0); - cob_table_sort (COB_SET_FLD (f0, 1, b_18, &a_2), 10); + cob_table_sort_init_key (&f_9, 0, 0); + cob_table_sort (COB_SET_FLD(f0, 1, b_7 + 0, &a_2), 10); - /* Line: 17 : IF : prog.cob */ - if (((int)cob_cmp (&f_18, (cob_field *)&c_1) != 0)) + /* Line: 18 : IF : prog.cob */ + if (((int)cob_cmp (&f_7, (cob_field *)&c_1) != 0)) { - /* Line: 18 : DISPLAY : prog.cob */ - cob_display (0, 1, 1, &f_18); + /* Line: 19 : DISPLAY : prog.cob */ + cob_display (0, 1, 1, &f_7); } - /* Line: 19 : MOVE : prog.cob */ - memcpy (b_18, b_17, 10); + /* Line: 20 : MOVE : prog.cob */ + memcpy (b_7, b_6, 10); - /* Line: 21 : SORT : prog.cob */ + /* Line: 22 : SORT : prog.cob */ cob_table_sort_init (1, cob_ascii_ebcdic); - cob_table_sort_init_key (&f_20, 1, 0); - cob_table_sort (COB_SET_FLD (f0, 1, b_18, &a_2), 10); + cob_table_sort_init_key (&f_9, 1, 0); + cob_table_sort (COB_SET_FLD(f0, 1, b_7 + 0, &a_2), 10); - /* Line: 22 : IF : prog.cob */ - if (((int)cob_cmp (&f_18, (cob_field *)&c_2) != 0)) + /* Line: 23 : IF : prog.cob */ + if (((int)cob_cmp (&f_7, (cob_field *)&c_2) != 0)) { - /* Line: 23 : DISPLAY : prog.cob */ - cob_display (0, 1, 1, &f_18); - } - - /* Line: 24 : STOP RUN : prog.cob */ - cob_stop_run (b_2); - - /* Program exit */ - - /* Decrement module active count */ - if (module->module_active) { - module->module_active--; - } - - /* Pop module stack */ - cob_module_leave (module); - - /* Program return */ - return b_2; - - /* Frame stack jump table */ - P_switch: - P_cgerror: - cob_fatal_error (COB_FERROR_CODEGEN); - - - /* Program initialization */ - P_initialize: - - cob_module_path = cob_glob_ptr->cob_main_argv0; - - prog_module_init (module); - - module->collating_sequence = NULL; - module->crt_status = NULL; - module->cursor_pos = NULL; - module->xml_code = NULL; - module->xml_event = NULL; - module->xml_information = NULL; - module->xml_namespace = NULL; - module->xml_namespace_prefix = NULL; - module->xml_nnamespace = NULL; - module->xml_nnamespace_prefix = NULL; - module->xml_ntext = NULL; - module->xml_text = NULL; - module->json_code = NULL; - module->json_status = NULL; - - /* Initialize cancel callback */ - cob_set_cancel (module); - - /* Initialize WORKING-STORAGE */ - /* initialize field RETURN-CODE */ - b_2 = 0; - - /* initialize field Z */ - memcpy (b_17, "d4b2e1a3c5", 10); - - /* initialize field G */ - memset (b_18, (unsigned char)' ', 10); + /* Line: 24 : DISPLAY : prog.cob */ + cob_display (0, 1, 1, &f_7); + } + /* Line: 25 : STOP RUN : prog.cob */ + cob_stop_run (b_2); - if (0 == 1) goto P_cgerror; - initialized = 1; - goto P_ret_initialize; + /* Program exit */ - P_dump: - return 0; + /* Decrement module active count */ + if (module->module_active) { + module->module_active--; + } + /* Pop module stack */ + cob_module_leave (module); - /* CANCEL callback handling */ - P_cancel: + /* Program return */ + return b_2; - if (!initialized) - return 0; - if (module && module->module_active) - cob_fatal_error (COB_FERROR_CANCEL); + /* Frame stack jump table */ + P_switch: + cob_fatal_error (COB_FERROR_CODEGEN); - initialized = 0; - P_clear_decimal: - return 0; + /* Program initialization */ + P_initialize: -} + cob_check_version (COB_SOURCE_FILE, COB_PACKAGE_VERSION, COB_PATCH_LEVEL); -/* End PROGRAM-ID 'prog' */ + cob_module_path = cob_glob_ptr->cob_main_argv0; -/* Initialize module structure for prog */ -static void prog_module_init (cob_module *module) -{ + /* Initialize module structure */ module->module_name = "prog"; module->module_formatted_date = COB_MODULE_FORMATTED_DATE; module->module_source = COB_SOURCE_FILE; - module->gc_version = COB_PACKAGE_VERSION; module->module_entry.funcptr = (void *(*)())prog; module->module_cancel.funcptr = (void *(*)())prog_; + module->collating_sequence = NULL; + module->crt_status = NULL; + module->cursor_pos = NULL; module->module_ref_count = NULL; module->module_path = &cob_module_path; module->module_active = 0; @@ -2886,6 +1480,7 @@ static void prog_module_init (cob_module *module) module->module_time = COB_MODULE_TIME; module->module_type = 0; module->module_param_cnt = 0; + module->module_returning = 0; module->ebcdic_sign = 0; module->decimal_point = '.'; module->currency_symbol = '$'; @@ -2898,14 +1493,41 @@ static void prog_module_init (cob_module *module) module->flag_main = 1; module->flag_fold_call = 0; module->flag_exit_program = 0; - module->flag_debug_trace = 0; - module->flag_dump_ready = 0; - module->xml_mode = 1; - module->module_stmt = 0; - module->module_sources = NULL; + + /* Initialize cancel callback */ + cob_set_cancel (module); + + /* Initialize WORKING-STORAGE */ + b_2 = 0; + memcpy (b_6, "d4b2e1a3c5", 10); + memset (b_7, 32, 10); + + initialized = 1; + goto P_ret_initialize; + + /* CANCEL callback handling */ + P_cancel: + + if (!initialized) { + return 0; + } + if (module->module_active) { + cob_fatal_error (COB_FERROR_CANCEL); + } + + initialized = 0; + + P_clear_decimal: + + return 0; + } +/* End PROGRAM-ID 'prog' */ + /* End functions */ + + ]]) AT_DATA([prog2.c], [[ @@ -3242,35 +1864,39 @@ 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 3.2.0 */ +/* Generated by cobc 2.2.0 */ /* Generated from prog.cob */ -/* Generated at juil. 23 2024 14:11:59 */ -/* GnuCOBOL build date Apr 17 2024 11:34:39 */ -/* GnuCOBOL package date Jul 28 2023 17:02:56 UTC */ -/* Compile command /opt/gnucobol/gnucobol-3.2/bin/cobc -fdefault-colseq=ascii -DEXPECT-ORDER=ASCII -Cx -fno-computed-goto prog.cob */ +/* 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 -fno-constant-folding prog.cob */ -#include /* for memcpy, memcmp and friends */ +#include +#include +#include +#include +#include #define COB_KEYWORD_INLINE __inline #include #define COB_SOURCE_FILE "prog.cob" -#define COB_PACKAGE_VERSION "3.2" +#define COB_PACKAGE_VERSION "2.2" #define COB_PATCH_LEVEL 0 -#define COB_MODULE_FORMATTED_DATE "juil. 23 2024 14:11:59" +#define COB_MODULE_FORMATTED_DATE "juil. 23 2024 17:37:21" #define COB_MODULE_DATE 20240723 -#define COB_MODULE_TIME 141159 +#define COB_MODULE_TIME 173721 /* Global variables */ -/* Generated by cobc 3.2.0 */ +/* Generated by cobc 2.2.0 */ /* Generated from prog.cob */ -/* Generated at juil. 23 2024 14:11:59 */ -/* GnuCOBOL build date Apr 17 2024 11:34:39 */ -/* GnuCOBOL package date Jul 28 2023 17:02:56 UTC */ -/* Compile command /opt/gnucobol/gnucobol-3.2/bin/cobc -fdefault-colseq=ascii -DEXPECT-ORDER=ASCII -Cx -fno-computed-goto prog.cob */ +/* 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 -fno-constant-folding prog.cob */ /* Module path */ @@ -3279,12 +1905,61 @@ static const char *cob_module_path = NULL; /* Number of call parameters */ static int cob_call_params = 0; +/* Attributes */ + +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 */ +static const unsigned char cob_native[256] = { + 0, 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, 62, 63, + 64, 65, 66, 67, 68, 69, 70, 71, + 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, + 88, 89, 90, 91, 92, 93, 94, 95, + 96, 97, 98, 99, 100, 101, 102, 103, + 104, 105, 106, 107, 108, 109, 110, 111, + 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 127, + 128, 129, 130, 131, 132, 133, 134, 135, + 136, 137, 138, 139, 140, 141, 142, 143, + 144, 145, 146, 147, 148, 149, 150, 151, + 152, 153, 154, 155, 156, 157, 158, 159, + 160, 161, 162, 163, 164, 165, 166, 167, + 168, 169, 170, 171, 172, 173, 174, 175, + 176, 177, 178, 179, 180, 181, 182, 183, + 184, 185, 186, 187, 188, 189, 190, 191, + 192, 193, 194, 195, 196, 197, 198, 199, + 200, 201, 202, 203, 204, 205, 206, 207, + 208, 209, 210, 211, 212, 213, 214, 215, + 216, 217, 218, 219, 220, 221, 222, 223, + 224, 225, 226, 227, 228, 229, 230, 231, + 232, 233, 234, 235, 236, 237, 238, 239, + 240, 241, 242, 243, 244, 245, 246, 247, + 248, 249, 250, 251, 252, 253, 254, 255 +}; + + /* Decimal constants */ + /* Function prototypes */ static int prog (); static int prog_ (const int); -static void prog_module_init (cob_module *module); /* Main function */ int @@ -3296,12 +1971,6 @@ main (int argc, char **argv) /* Functions */ -static void gc_module_so_init () __attribute__ ((constructor)); -static void gc_module_so_init () -{ - cob_check_version (COB_SOURCE_FILE, COB_PACKAGE_VERSION, COB_PATCH_LEVEL); -} - /* PROGRAM-ID 'prog' */ /* ENTRY 'prog' */ @@ -3316,12 +1985,12 @@ static int prog_ (const int entry) { /* Program local variables */ - /* Generated by cobc 3.2.0 */ + /* Generated by cobc 2.2.0 */ /* Generated from prog.cob */ - /* Generated at juil. 23 2024 14:11:59 */ - /* GnuCOBOL build date Apr 17 2024 11:34:39 */ - /* GnuCOBOL package date Jul 28 2023 17:02:56 UTC */ - /* Compile command /opt/gnucobol/gnucobol-3.2/bin/cobc -fdefault-colseq=ascii -DEXPECT-ORDER=ASCII -Cx -fno-computed-goto prog.cob */ + /* 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 -fno-constant-folding prog.cob */ /* Program local variables for 'prog' */ @@ -3335,15 +2004,6 @@ prog_ (const int entry) cob_global *cob_glob_ptr; - /* LINKAGE SECTION (Items not referenced by USING clause) */ - static unsigned char *b_9 = NULL; /* XML-NAMESPACE */ - static unsigned char *b_10 = NULL; /* XML-NAMESPACE-PREFIX */ - static unsigned char *b_11 = NULL; /* XML-NNAMESPACE */ - static unsigned char *b_12 = NULL; /* XML-NNAMESPACE-PREFIX */ - static unsigned char *b_13 = NULL; /* XML-NTEXT */ - static unsigned char *b_14 = NULL; /* XML-TEXT */ - - /* Call parameters */ cob_field *cob_procedure_params[1]; @@ -3355,7 +2015,7 @@ prog_ (const int entry) /* Data storage */ static int b_2; /* RETURN-CODE */ - /* End of local data storage */ + /* End of data storage */ @@ -3363,8 +2023,6 @@ prog_ (const int entry) /* CANCEL callback */ if (unlikely(entry < 0)) { - if (entry == -10) - goto P_dump; if (entry == -20) goto P_clear_decimal; goto P_cancel; @@ -3397,13 +2055,18 @@ prog_ (const int entry) /* PROCEDURE DIVISION */ - /* Line: 5 : Entry prog : prog.cob */ + /* Line: 11 : Entry prog : prog.cob */ l_2:; - /* Line: 5 : IF : prog.cob */ - /* IF has code omitted */ + /* Line: 11 : IF : prog.cob */ + 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: 11 : STOP RUN : prog.cob */ + /* Line: 17 : STOP RUN : prog.cob */ cob_stop_run (b_2); /* Program exit */ @@ -3421,131 +2084,111 @@ prog_ (const int entry) /* Frame stack jump table */ P_switch: - P_cgerror: - cob_fatal_error (COB_FERROR_CODEGEN); + cob_fatal_error (COB_FERROR_CODEGEN); /* Program initialization */ P_initialize: - cob_module_path = cob_glob_ptr->cob_main_argv0; + cob_check_version (COB_SOURCE_FILE, COB_PACKAGE_VERSION, COB_PATCH_LEVEL); - prog_module_init (module); + cob_module_path = cob_glob_ptr->cob_main_argv0; - module->collating_sequence = NULL; + /* Initialize module structure */ + module->module_name = "prog"; + module->module_formatted_date = COB_MODULE_FORMATTED_DATE; + module->module_source = COB_SOURCE_FILE; + module->module_entry.funcptr = (void *(*)())prog; + module->module_cancel.funcptr = (void *(*)())prog_; + module->collating_sequence = cob_native; module->crt_status = NULL; module->cursor_pos = NULL; - module->xml_code = NULL; - module->xml_event = NULL; - module->xml_information = NULL; - module->xml_namespace = NULL; - module->xml_namespace_prefix = NULL; - module->xml_nnamespace = NULL; - module->xml_nnamespace_prefix = NULL; - module->xml_ntext = NULL; - module->xml_text = NULL; - module->json_code = NULL; - module->json_status = NULL; + module->module_ref_count = NULL; + module->module_path = &cob_module_path; + module->module_active = 0; + module->module_date = COB_MODULE_DATE; + module->module_time = COB_MODULE_TIME; + module->module_type = 0; + module->module_param_cnt = 0; + module->module_returning = 0; + module->ebcdic_sign = 0; + module->decimal_point = '.'; + module->currency_symbol = '$'; + module->numeric_separator = ','; + module->flag_filename_mapping = 1; + module->flag_binary_truncate = 1; + module->flag_pretty_display = 1; + module->flag_host_sign = 0; + module->flag_no_phys_canc = 1; + module->flag_main = 1; + module->flag_fold_call = 0; + module->flag_exit_program = 0; /* Initialize cancel callback */ cob_set_cancel (module); /* Initialize WORKING-STORAGE */ - /* initialize field RETURN-CODE */ b_2 = 0; - - if (0 == 1) goto P_cgerror; initialized = 1; goto P_ret_initialize; - P_dump: - return 0; - - /* CANCEL callback handling */ P_cancel: - if (!initialized) + if (!initialized) { return 0; - if (module && module->module_active) + } + if (module->module_active) { cob_fatal_error (COB_FERROR_CANCEL); + } initialized = 0; P_clear_decimal: + return 0; } /* End PROGRAM-ID 'prog' */ -/* Initialize module structure for prog */ -static void prog_module_init (cob_module *module) -{ - module->module_name = "prog"; - module->module_formatted_date = COB_MODULE_FORMATTED_DATE; - module->module_source = COB_SOURCE_FILE; - module->gc_version = COB_PACKAGE_VERSION; - module->module_entry.funcptr = (void *(*)())prog; - module->module_cancel.funcptr = (void *(*)())prog_; - module->module_ref_count = NULL; - module->module_path = &cob_module_path; - module->module_active = 0; - module->module_date = COB_MODULE_DATE; - module->module_time = COB_MODULE_TIME; - module->module_type = 0; - module->module_param_cnt = 0; - module->ebcdic_sign = 0; - module->decimal_point = '.'; - module->currency_symbol = '$'; - module->numeric_separator = ','; - module->flag_filename_mapping = 1; - module->flag_binary_truncate = 1; - module->flag_pretty_display = 1; - module->flag_host_sign = 0; - module->flag_no_phys_canc = 1; - module->flag_main = 1; - module->flag_fold_call = 0; - module->flag_exit_program = 0; - module->flag_debug_trace = 0; - module->flag_dump_ready = 0; - module->xml_mode = 1; - module->module_stmt = 0; - module->module_sources = NULL; -} - /* End functions */ ]]) + AT_DATA([ebcdic.c], [[ -/* Generated by cobc 3.2.0 */ +/* Generated by cobc 2.2.0 */ /* Generated from prog.cob */ -/* Generated at juil. 23 2024 14:19:15 */ -/* GnuCOBOL build date Apr 17 2024 11:34:39 */ -/* GnuCOBOL package date Jul 28 2023 17:02:56 UTC */ -/* Compile command /opt/gnucobol/gnucobol-3.2/bin/cobc -fdefault-colseq=ebcdic -DEXPECT-ORDER=EBCDIC -Cx -fno-computed-goto prog.cob */ +/* 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 -fno-constant-folding prog.cob */ -#include /* for memcpy, memcmp and friends */ +#include +#include +#include +#include +#include #define COB_KEYWORD_INLINE __inline #include #define COB_SOURCE_FILE "prog.cob" -#define COB_PACKAGE_VERSION "3.2" +#define COB_PACKAGE_VERSION "2.2" #define COB_PATCH_LEVEL 0 -#define COB_MODULE_FORMATTED_DATE "juil. 23 2024 14:19:15" +#define COB_MODULE_FORMATTED_DATE "juil. 23 2024 17:34:27" #define COB_MODULE_DATE 20240723 -#define COB_MODULE_TIME 141915 +#define COB_MODULE_TIME 173427 /* Global variables */ -/* Generated by cobc 3.2.0 */ +/* Generated by cobc 2.2.0 */ /* Generated from prog.cob */ -/* Generated at juil. 23 2024 14:19:15 */ -/* GnuCOBOL build date Apr 17 2024 11:34:39 */ -/* GnuCOBOL package date Jul 28 2023 17:02:56 UTC */ -/* Compile command /opt/gnucobol/gnucobol-3.2/bin/cobc -fdefault-colseq=ebcdic -DEXPECT-ORDER=EBCDIC -Cx -fno-computed-goto prog.cob */ +/* 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 -fno-constant-folding prog.cob */ /* Module path */ @@ -3557,6 +2200,7 @@ static int cob_call_params = 0; /* Attributes */ 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 */ @@ -3567,47 +2211,47 @@ static const cob_field c_3 = {5, (cob_u8_ptr)"ERROR", &a_1}; /* ASCII to EBCDIC table */ static const unsigned char cob_ascii_ebcdic[256] = { - 0000, 0x01, 0x02, 0x03, 0x37, 0x2d, 0x2e, 0x2f, - 0x16, 0x05, 0x25, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, - 0x10, 0x11, 0x12, 0x13, 0x3c, 0x3d, 0x32, 0x26, - 0x18, 0x19, 0x3f, 0x27, 0x1c, 0x1d, 0x1e, 0x1f, - 0x40, 0x5a, 0x7f, 0x7b, 0x5b, 0x6c, 0x50, 0x7d, - 0x4d, 0x5d, 0x5c, 0x4e, 0x6b, 0x60, 0x4b, 0x61, - 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, - 0xf8, 0xf9, 0x7a, 0x5e, 0x4c, 0x7e, 0x6e, 0x6f, - 0x7c, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, - 0xc8, 0xc9, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, - 0xd7, 0xd8, 0xd9, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, - 0xe7, 0xe8, 0xe9, 0xad, 0xe0, 0xbd, 0x5f, 0x6d, + 0x00, 0x01, 0x02, 0x03, 0x37, 0x2D, 0x2E, 0x2F, + 0x16, 0x05, 0x25, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, + 0x10, 0x11, 0x12, 0x13, 0x3C, 0x3D, 0x32, 0x26, + 0x18, 0x19, 0x3F, 0x27, 0x1C, 0x1D, 0x1E, 0x1F, + 0x40, 0x5A, 0x7F, 0x7B, 0x5B, 0x6C, 0x50, 0x7D, + 0x4D, 0x5D, 0x5C, 0x4E, 0x6B, 0x60, 0x4B, 0x61, + 0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7, + 0xF8, 0xF9, 0x7A, 0x5E, 0x4C, 0x7E, 0x6E, 0x6F, + 0x7C, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, + 0xC8, 0xC9, 0xD1, 0xD2, 0xD3, 0xD4, 0xD5, 0xD6, + 0xD7, 0xD8, 0xD9, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, + 0xE7, 0xE8, 0xE9, 0xAD, 0xE0, 0xBD, 0x5F, 0x6D, 0x79, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, - 0x97, 0x98, 0x99, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, - 0xa7, 0xa8, 0xa9, 0xc0, 0x6a, 0xd0, 0xa1, 0x07, - 0x68, 0xdc, 0x51, 0x42, 0x43, 0x44, 0x47, 0x48, + 0x97, 0x98, 0x99, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, + 0xA7, 0xA8, 0xA9, 0xC0, 0x6A, 0xD0, 0xA1, 0x07, + 0x68, 0xDC, 0x51, 0x42, 0x43, 0x44, 0x47, 0x48, 0x52, 0x53, 0x54, 0x57, 0x56, 0x58, 0x63, 0x67, - 0x71, 0x9c, 0x9e, 0xcb, 0xcc, 0xcd, 0xdb, 0xdd, - 0xdf, 0xec, 0xfc, 0xb0, 0xb1, 0xb2, 0x3e, 0xb4, - 0x45, 0x55, 0xce, 0xde, 0x49, 0x69, 0x9a, 0x9b, - 0xab, 0x9f, 0xba, 0xb8, 0xb7, 0xaa, 0x8a, 0x8b, - 0xb6, 0xb5, 0x62, 0x4f, 0x64, 0x65, 0x66, 0x20, - 0x21, 0x22, 0x70, 0x23, 0x72, 0x73, 0x74, 0xbe, - 0x76, 0x77, 0x78, 0x80, 0x24, 0x15, 0x8c, 0x8d, - 0x8e, 0x41, 0x06, 0x17, 0x28, 0x29, 0x9d, 0x2a, - 0x2b, 0x2c, 0x09, 0x0a, 0xac, 0x4a, 0xae, 0xaf, - 0x1b, 0x30, 0x31, 0xfa, 0x1a, 0x33, 0x34, 0x35, - 0x36, 0x59, 0x08, 0x38, 0xbc, 0x39, 0xa0, 0xbf, - 0xca, 0x3a, 0xfe, 0x3b, 0x04, 0xcf, 0xda, 0x14, - 0xe1, 0x8f, 0x46, 0x75, 0xfd, 0xeb, 0xee, 0xed, - 0x90, 0xef, 0xb3, 0xfb, 0xb9, 0xea, 0xbb, 0xff, + 0x71, 0x9C, 0x9E, 0xCB, 0xCC, 0xCD, 0xDB, 0xDD, + 0xDF, 0xEC, 0xFC, 0xB0, 0xB1, 0xB2, 0x3E, 0xB4, + 0x45, 0x55, 0xCE, 0xDE, 0x49, 0x69, 0x9A, 0x9B, + 0xAB, 0x9F, 0xBA, 0xB8, 0xB7, 0xAA, 0x8A, 0x8B, + 0xB6, 0xB5, 0x62, 0x4F, 0x64, 0x65, 0x66, 0x20, + 0x21, 0x22, 0x70, 0x23, 0x72, 0x73, 0x74, 0xBE, + 0x76, 0x77, 0x78, 0x80, 0x24, 0x15, 0x8C, 0x8D, + 0x8E, 0x41, 0x06, 0x17, 0x28, 0x29, 0x9D, 0x2A, + 0x2B, 0x2C, 0x09, 0x0A, 0xAC, 0x4A, 0xAE, 0xAF, + 0x1B, 0x30, 0x31, 0xFA, 0x1A, 0x33, 0x34, 0x35, + 0x36, 0x59, 0x08, 0x38, 0xBC, 0x39, 0xA0, 0xBF, + 0xCA, 0x3A, 0xFE, 0x3B, 0x04, 0xCF, 0xDA, 0x14, + 0xE1, 0x8F, 0x46, 0x75, 0xFD, 0xEB, 0xEE, 0xED, + 0x90, 0xEF, 0xB3, 0xFB, 0xB9, 0xEA, 0xBB, 0xFF }; + /* Decimal constants */ /* Function prototypes */ static int prog (); static int prog_ (const int); -static void prog_module_init (cob_module *module); /* Main function */ int @@ -3619,12 +2263,6 @@ main (int argc, char **argv) /* Functions */ -static void gc_module_so_init () __attribute__ ((constructor)); -static void gc_module_so_init () -{ - cob_check_version (COB_SOURCE_FILE, COB_PACKAGE_VERSION, COB_PATCH_LEVEL); -} - /* PROGRAM-ID 'prog' */ /* ENTRY 'prog' */ @@ -3639,12 +2277,12 @@ static int prog_ (const int entry) { /* Program local variables */ - /* Generated by cobc 3.2.0 */ + /* Generated by cobc 2.2.0 */ /* Generated from prog.cob */ - /* Generated at juil. 23 2024 14:19:15 */ - /* GnuCOBOL build date Apr 17 2024 11:34:39 */ - /* GnuCOBOL package date Jul 28 2023 17:02:56 UTC */ - /* Compile command /opt/gnucobol/gnucobol-3.2/bin/cobc -fdefault-colseq=ebcdic -DEXPECT-ORDER=EBCDIC -Cx -fno-computed-goto prog.cob */ + /* 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 -fno-constant-folding prog.cob */ /* Program local variables for 'prog' */ @@ -3658,15 +2296,6 @@ prog_ (const int entry) cob_global *cob_glob_ptr; - /* LINKAGE SECTION (Items not referenced by USING clause) */ - static unsigned char *b_9 = NULL; /* XML-NAMESPACE */ - static unsigned char *b_10 = NULL; /* XML-NAMESPACE-PREFIX */ - static unsigned char *b_11 = NULL; /* XML-NNAMESPACE */ - static unsigned char *b_12 = NULL; /* XML-NNAMESPACE-PREFIX */ - static unsigned char *b_13 = NULL; /* XML-NTEXT */ - static unsigned char *b_14 = NULL; /* XML-TEXT */ - - /* Call parameters */ cob_field *cob_procedure_params[1]; @@ -3678,7 +2307,7 @@ prog_ (const int entry) /* Data storage */ static int b_2; /* RETURN-CODE */ - /* End of local data storage */ + /* End of data storage */ @@ -3686,8 +2315,6 @@ prog_ (const int entry) /* CANCEL callback */ if (unlikely(entry < 0)) { - if (entry == -10) - goto P_dump; if (entry == -20) goto P_clear_decimal; goto P_cancel; @@ -3720,18 +2347,18 @@ prog_ (const int entry) /* PROCEDURE DIVISION */ - /* Line: 7 : Entry prog : prog.cob */ + /* Line: 13 : Entry prog : prog.cob */ l_2:; - /* Line: 7 : IF : prog.cob */ + /* Line: 13 : IF : prog.cob */ if (((int)cob_cmp ((cob_field *)&c_1, (cob_field *)&c_2) >= 0)) { - /* Line: 9 : DISPLAY : prog.cob */ + /* Line: 15 : DISPLAY : prog.cob */ cob_display (0, 1, 1, &c_3); } - /* Line: 11 : STOP RUN : prog.cob */ + /* Line: 17 : STOP RUN : prog.cob */ cob_stop_run (b_2); /* Program exit */ @@ -3739,84 +2366,35 @@ prog_ (const int entry) /* Decrement module active count */ if (module->module_active) { module->module_active--; - } - - /* Pop module stack */ - cob_module_leave (module); - - /* Program return */ - return b_2; - - /* Frame stack jump table */ - P_switch: - P_cgerror: - cob_fatal_error (COB_FERROR_CODEGEN); - - - /* Program initialization */ - P_initialize: - - cob_module_path = cob_glob_ptr->cob_main_argv0; - - prog_module_init (module); - - module->collating_sequence = cob_ascii_ebcdic; - module->crt_status = NULL; - module->cursor_pos = NULL; - module->xml_code = NULL; - module->xml_event = NULL; - module->xml_information = NULL; - module->xml_namespace = NULL; - module->xml_namespace_prefix = NULL; - module->xml_nnamespace = NULL; - module->xml_nnamespace_prefix = NULL; - module->xml_ntext = NULL; - module->xml_text = NULL; - module->json_code = NULL; - module->json_status = NULL; - - /* Initialize cancel callback */ - cob_set_cancel (module); - - /* Initialize WORKING-STORAGE */ - /* initialize field RETURN-CODE */ - b_2 = 0; - - - if (0 == 1) goto P_cgerror; - initialized = 1; - goto P_ret_initialize; - - P_dump: - return 0; + } + /* Pop module stack */ + cob_module_leave (module); - /* CANCEL callback handling */ - P_cancel: + /* Program return */ + return b_2; - if (!initialized) - return 0; - if (module && module->module_active) - cob_fatal_error (COB_FERROR_CANCEL); + /* Frame stack jump table */ + P_switch: + cob_fatal_error (COB_FERROR_CODEGEN); - initialized = 0; - P_clear_decimal: - return 0; + /* Program initialization */ + P_initialize: -} + cob_check_version (COB_SOURCE_FILE, COB_PACKAGE_VERSION, COB_PATCH_LEVEL); -/* End PROGRAM-ID 'prog' */ + cob_module_path = cob_glob_ptr->cob_main_argv0; -/* Initialize module structure for prog */ -static void prog_module_init (cob_module *module) -{ + /* Initialize module structure */ module->module_name = "prog"; module->module_formatted_date = COB_MODULE_FORMATTED_DATE; module->module_source = COB_SOURCE_FILE; - module->gc_version = COB_PACKAGE_VERSION; module->module_entry.funcptr = (void *(*)())prog; module->module_cancel.funcptr = (void *(*)())prog_; + module->collating_sequence = cob_ascii_ebcdic; + module->crt_status = NULL; + module->cursor_pos = NULL; module->module_ref_count = NULL; module->module_path = &cob_module_path; module->module_active = 0; @@ -3824,6 +2402,7 @@ static void prog_module_init (cob_module *module) module->module_time = COB_MODULE_TIME; module->module_type = 0; module->module_param_cnt = 0; + module->module_returning = 0; module->ebcdic_sign = 0; module->decimal_point = '.'; module->currency_symbol = '$'; @@ -3836,57 +2415,83 @@ static void prog_module_init (cob_module *module) module->flag_main = 1; module->flag_fold_call = 0; module->flag_exit_program = 0; - module->flag_debug_trace = 0; - module->flag_dump_ready = 0; - module->xml_mode = 1; - module->module_stmt = 0; - module->module_sources = NULL; + + /* Initialize cancel callback */ + cob_set_cancel (module); + + /* Initialize WORKING-STORAGE */ + b_2 = 0; + + initialized = 1; + goto P_ret_initialize; + + /* CANCEL callback handling */ + P_cancel: + + if (!initialized) { + return 0; + } + if (module->module_active) { + cob_fatal_error (COB_FERROR_CANCEL); + } + + initialized = 0; + + P_clear_decimal: + + return 0; + } +/* End PROGRAM-ID 'prog' */ + /* End functions */ ]]) - -AT_CHECK([$COMPILE -fdefault-colseq=ascii -DEXPECT-ORDER=ASCII -o ascii ascii.c], [0], [], []) +AT_CHECK([$COMPILE -o ascii ascii.c], [0], [], []) AT_CHECK([$COBCRUN_DIRECT ./ascii], [0], [], []) -AT_CHECK([$COMPILE -fdefault-colseq=ebcdic -DEXPECT-ORDER=EBCDIC -o ebcdic ebcdic.c], [0], [], []) +AT_CHECK([$COMPILE -o ebcdic ebcdic.c], [0], [], []) AT_CHECK([$COBCRUN_DIRECT ./ebcdic], [0], [], []) AT_CLEANUP AT_SETUP([SORT: table with default COLLATING SEQUENCE]) -AT_KEYWORDS([runmisc SORT EBCDIC ASCII default-colseq]) +AT_KEYWORDS([runmisc SORT EBCDIC ASCII]) AT_DATA([ascii.c], [[ -/* Generated by cobc 3.2.0 */ +/* Generated by cobc 2.2.0 */ /* Generated from prog.cob */ -/* Generated at juil. 23 2024 14:24:15 */ -/* GnuCOBOL build date Apr 17 2024 11:34:39 */ -/* GnuCOBOL package date Jul 28 2023 17:02:56 UTC */ -/* Compile command /opt/gnucobol/gnucobol-3.2/bin/cobc -fdefault-colseq=ascii -DEXPECT-ORDER=ASCII -Cx -fno-computed-goto prog.cob */ +/* Generated at juil. 23 2024 17:47:39 */ +/* 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 -fno-constant-folding prog.cob */ -#include /* for memcpy, memcmp and friends */ +#include +#include +#include +#include +#include #define COB_KEYWORD_INLINE __inline #include #define COB_SOURCE_FILE "prog.cob" -#define COB_PACKAGE_VERSION "3.2" +#define COB_PACKAGE_VERSION "2.2" #define COB_PATCH_LEVEL 0 -#define COB_MODULE_FORMATTED_DATE "juil. 23 2024 14:24:15" +#define COB_MODULE_FORMATTED_DATE "juil. 23 2024 17:47:39" #define COB_MODULE_DATE 20240723 -#define COB_MODULE_TIME 142415 +#define COB_MODULE_TIME 174739 /* Global variables */ -/* Generated by cobc 3.2.0 */ +/* Generated by cobc 2.2.0 */ /* Generated from prog.cob */ -/* Generated at juil. 23 2024 14:24:15 */ -/* GnuCOBOL build date Apr 17 2024 11:34:39 */ -/* GnuCOBOL package date Jul 28 2023 17:02:56 UTC */ -/* Compile command /opt/gnucobol/gnucobol-3.2/bin/cobc -fdefault-colseq=ascii -DEXPECT-ORDER=ASCII -Cx -fno-computed-goto prog.cob */ +/* Generated at juil. 23 2024 17:47:39 */ +/* 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 -fno-constant-folding prog.cob */ /* Module path */ @@ -3899,14 +2504,56 @@ static int cob_call_params = 0; static const cob_field_attr a_1 = {0x21, 0, 0, 0x0000, NULL}; static const cob_field_attr a_2 = {0x01, 0, 0, 0x0000, NULL}; +static const cob_field_attr a_3 = {0x21, 0, 0, 0x1000, NULL}; + + +/* Constants */ +static const cob_field c_1 = {10, (cob_u8_ptr)"12345abcde", &a_3}; + + +/* NATIVE table */ +static const unsigned char cob_native[256] = { + 0, 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, 62, 63, + 64, 65, 66, 67, 68, 69, 70, 71, + 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, + 88, 89, 90, 91, 92, 93, 94, 95, + 96, 97, 98, 99, 100, 101, 102, 103, + 104, 105, 106, 107, 108, 109, 110, 111, + 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 127, + 128, 129, 130, 131, 132, 133, 134, 135, + 136, 137, 138, 139, 140, 141, 142, 143, + 144, 145, 146, 147, 148, 149, 150, 151, + 152, 153, 154, 155, 156, 157, 158, 159, + 160, 161, 162, 163, 164, 165, 166, 167, + 168, 169, 170, 171, 172, 173, 174, 175, + 176, 177, 178, 179, 180, 181, 182, 183, + 184, 185, 186, 187, 188, 189, 190, 191, + 192, 193, 194, 195, 196, 197, 198, 199, + 200, 201, 202, 203, 204, 205, 206, 207, + 208, 209, 210, 211, 212, 213, 214, 215, + 216, 217, 218, 219, 220, 221, 222, 223, + 224, 225, 226, 227, 228, 229, 230, 231, + 232, 233, 234, 235, 236, 237, 238, 239, + 240, 241, 242, 243, 244, 245, 246, 247, + 248, 249, 250, 251, 252, 253, 254, 255 +}; + /* Decimal constants */ /* Function prototypes */ static int prog (); static int prog_ (const int); -static void prog_module_init (cob_module *module); /* Main function */ int @@ -3918,12 +2565,6 @@ main (int argc, char **argv) /* Functions */ -static void gc_module_so_init () __attribute__ ((constructor)); -static void gc_module_so_init () -{ - cob_check_version (COB_SOURCE_FILE, COB_PACKAGE_VERSION, COB_PATCH_LEVEL); -} - /* PROGRAM-ID 'prog' */ /* ENTRY 'prog' */ @@ -3938,12 +2579,12 @@ static int prog_ (const int entry) { /* Program local variables */ - /* Generated by cobc 3.2.0 */ + /* Generated by cobc 2.2.0 */ /* Generated from prog.cob */ - /* Generated at juil. 23 2024 14:24:15 */ - /* GnuCOBOL build date Apr 17 2024 11:34:39 */ - /* GnuCOBOL package date Jul 28 2023 17:02:56 UTC */ - /* Compile command /opt/gnucobol/gnucobol-3.2/bin/cobc -fdefault-colseq=ascii -DEXPECT-ORDER=ASCII -Cx -fno-computed-goto prog.cob */ + /* Generated at juil. 23 2024 17:47:39 */ + /* 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 -fno-constant-folding prog.cob */ /* Program local variables for 'prog' */ @@ -3957,15 +2598,6 @@ prog_ (const int entry) cob_global *cob_glob_ptr; - /* LINKAGE SECTION (Items not referenced by USING clause) */ - static unsigned char *b_9 = NULL; /* XML-NAMESPACE */ - static unsigned char *b_10 = NULL; /* XML-NAMESPACE-PREFIX */ - static unsigned char *b_11 = NULL; /* XML-NNAMESPACE */ - static unsigned char *b_12 = NULL; /* XML-NNAMESPACE-PREFIX */ - static unsigned char *b_13 = NULL; /* XML-NTEXT */ - static unsigned char *b_14 = NULL; /* XML-TEXT */ - - /* Local cob_field items */ cob_field f0; @@ -3980,14 +2612,14 @@ prog_ (const int entry) /* Data storage */ static int b_2; /* RETURN-CODE */ - static cob_u8_t b_17[10] __attribute__((aligned)); /* Z */ + static cob_u8_t b_6[10] __attribute__((aligned)); /* Z */ - /* End of local data storage */ + /* End of data storage */ - /* Fields (local) */ - static cob_field f_18 = {10, b_17, &a_2}; /* G */ - static cob_field f_20 = {1, b_17, &a_1}; /* X */ + /* Fields */ + static cob_field f_7 = {10, b_6, &a_2}; /* G */ + static cob_field f_9 = {1, b_6, &a_1}; /* X */ /* End of fields */ @@ -3997,8 +2629,6 @@ prog_ (const int entry) /* CANCEL callback */ if (unlikely(entry < 0)) { - if (entry == -10) - goto P_dump; if (entry == -20) goto P_clear_decimal; goto P_cancel; @@ -4031,23 +2661,23 @@ prog_ (const int entry) /* PROCEDURE DIVISION */ - /* Line: 10 : Entry prog : prog.cob */ + /* Line: 16 : Entry prog : prog.cob */ l_2:; - /* Line: 10 : SORT : prog.cob */ + /* Line: 16 : SORT : prog.cob */ cob_table_sort_init (1, 0); - cob_table_sort_init_key (&f_20, 0, 0); - cob_table_sort (COB_SET_FLD (f0, 1, b_17, &a_2), 10); + cob_table_sort_init_key (&f_9, 0, 0); + cob_table_sort (COB_SET_FLD(f0, 1, b_6 + 0, &a_2), 10); - /* Line: 12 : IF : prog.cob */ - if (((int)memcmp (b_17, (cob_u8_ptr)"12345abcde", 10) != 0)) + /* Line: 18 : IF : prog.cob */ + if (((int)cob_cmp (&f_7, (cob_field *)&c_1) != 0)) { - /* Line: 18 : DISPLAY : prog.cob */ - cob_display (0, 1, 1, &f_18); + /* Line: 24 : DISPLAY : prog.cob */ + cob_display (0, 1, 1, &f_7); } - /* Line: 20 : STOP RUN : prog.cob */ + /* Line: 26 : STOP RUN : prog.cob */ cob_stop_run (b_2); /* Program exit */ @@ -4065,135 +2695,111 @@ prog_ (const int entry) /* Frame stack jump table */ P_switch: - P_cgerror: - cob_fatal_error (COB_FERROR_CODEGEN); + cob_fatal_error (COB_FERROR_CODEGEN); /* Program initialization */ P_initialize: - cob_module_path = cob_glob_ptr->cob_main_argv0; + cob_check_version (COB_SOURCE_FILE, COB_PACKAGE_VERSION, COB_PATCH_LEVEL); - prog_module_init (module); + cob_module_path = cob_glob_ptr->cob_main_argv0; - module->collating_sequence = NULL; + /* Initialize module structure */ + module->module_name = "prog"; + module->module_formatted_date = COB_MODULE_FORMATTED_DATE; + module->module_source = COB_SOURCE_FILE; + module->module_entry.funcptr = (void *(*)())prog; + module->module_cancel.funcptr = (void *(*)())prog_; + module->collating_sequence = cob_native; module->crt_status = NULL; module->cursor_pos = NULL; - module->xml_code = NULL; - module->xml_event = NULL; - module->xml_information = NULL; - module->xml_namespace = NULL; - module->xml_namespace_prefix = NULL; - module->xml_nnamespace = NULL; - module->xml_nnamespace_prefix = NULL; - module->xml_ntext = NULL; - module->xml_text = NULL; - module->json_code = NULL; - module->json_status = NULL; + module->module_ref_count = NULL; + module->module_path = &cob_module_path; + module->module_active = 0; + module->module_date = COB_MODULE_DATE; + module->module_time = COB_MODULE_TIME; + module->module_type = 0; + module->module_param_cnt = 0; + module->module_returning = 0; + module->ebcdic_sign = 0; + module->decimal_point = '.'; + module->currency_symbol = '$'; + module->numeric_separator = ','; + module->flag_filename_mapping = 1; + module->flag_binary_truncate = 1; + module->flag_pretty_display = 1; + module->flag_host_sign = 0; + module->flag_no_phys_canc = 1; + module->flag_main = 1; + module->flag_fold_call = 0; + module->flag_exit_program = 0; /* Initialize cancel callback */ cob_set_cancel (module); /* Initialize WORKING-STORAGE */ - /* initialize field RETURN-CODE */ b_2 = 0; + memcpy (b_6, "d4b2e1a3c5", 10); - /* initialize field Z */ - memcpy (b_17, "d4b2e1a3c5", 10); - - - - if (0 == 1) goto P_cgerror; initialized = 1; goto P_ret_initialize; - P_dump: - return 0; - - /* CANCEL callback handling */ P_cancel: - if (!initialized) + if (!initialized) { return 0; - if (module && module->module_active) + } + if (module->module_active) { cob_fatal_error (COB_FERROR_CANCEL); + } initialized = 0; P_clear_decimal: + return 0; } /* End PROGRAM-ID 'prog' */ -/* Initialize module structure for prog */ -static void prog_module_init (cob_module *module) -{ - module->module_name = "prog"; - module->module_formatted_date = COB_MODULE_FORMATTED_DATE; - module->module_source = COB_SOURCE_FILE; - module->gc_version = COB_PACKAGE_VERSION; - module->module_entry.funcptr = (void *(*)())prog; - module->module_cancel.funcptr = (void *(*)())prog_; - module->module_ref_count = NULL; - module->module_path = &cob_module_path; - module->module_active = 0; - module->module_date = COB_MODULE_DATE; - module->module_time = COB_MODULE_TIME; - module->module_type = 0; - module->module_param_cnt = 0; - module->ebcdic_sign = 0; - module->decimal_point = '.'; - module->currency_symbol = '$'; - module->numeric_separator = ','; - module->flag_filename_mapping = 1; - module->flag_binary_truncate = 1; - module->flag_pretty_display = 1; - module->flag_host_sign = 0; - module->flag_no_phys_canc = 1; - module->flag_main = 1; - module->flag_fold_call = 0; - module->flag_exit_program = 0; - module->flag_debug_trace = 0; - module->flag_dump_ready = 0; - module->xml_mode = 1; - module->module_stmt = 0; - module->module_sources = NULL; -} - /* End functions */ ]]) AT_DATA([ebcdic.c], [[ -/* Generated by cobc 3.2.0 */ +/* Generated by cobc 2.2.0 */ /* Generated from prog.cob */ -/* Generated at juil. 23 2024 14:24:33 */ -/* GnuCOBOL build date Apr 17 2024 11:34:39 */ -/* GnuCOBOL package date Jul 28 2023 17:02:56 UTC */ -/* Compile command /opt/gnucobol/gnucobol-3.2/bin/cobc -fdefault-colseq=ebcdic -DEXPECT-ORDER=EBCDIC -Cx -fno-computed-goto prog.cob */ +/* Generated at juil. 23 2024 17:48:46 */ +/* 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 -fno-constant-folding prog.cob */ -#include /* for memcpy, memcmp and friends */ +#include +#include +#include +#include +#include #define COB_KEYWORD_INLINE __inline #include #define COB_SOURCE_FILE "prog.cob" -#define COB_PACKAGE_VERSION "3.2" +#define COB_PACKAGE_VERSION "2.2" #define COB_PATCH_LEVEL 0 -#define COB_MODULE_FORMATTED_DATE "juil. 23 2024 14:24:33" +#define COB_MODULE_FORMATTED_DATE "juil. 23 2024 17:48:46" #define COB_MODULE_DATE 20240723 -#define COB_MODULE_TIME 142433 +#define COB_MODULE_TIME 174846 /* Global variables */ -/* Generated by cobc 3.2.0 */ +/* Generated by cobc 2.2.0 */ /* Generated from prog.cob */ -/* Generated at juil. 23 2024 14:24:33 */ -/* GnuCOBOL build date Apr 17 2024 11:34:39 */ -/* GnuCOBOL package date Jul 28 2023 17:02:56 UTC */ -/* Compile command /opt/gnucobol/gnucobol-3.2/bin/cobc -fdefault-colseq=ebcdic -DEXPECT-ORDER=EBCDIC -Cx -fno-computed-goto prog.cob */ +/* Generated at juil. 23 2024 17:48:46 */ +/* 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 -fno-constant-folding prog.cob */ /* Module path */ @@ -4215,47 +2821,47 @@ static const cob_field c_1 = {10, (cob_u8_ptr)"abcde12345", &a_3}; /* ASCII to EBCDIC table */ static const unsigned char cob_ascii_ebcdic[256] = { - 0000, 0x01, 0x02, 0x03, 0x37, 0x2d, 0x2e, 0x2f, - 0x16, 0x05, 0x25, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, - 0x10, 0x11, 0x12, 0x13, 0x3c, 0x3d, 0x32, 0x26, - 0x18, 0x19, 0x3f, 0x27, 0x1c, 0x1d, 0x1e, 0x1f, - 0x40, 0x5a, 0x7f, 0x7b, 0x5b, 0x6c, 0x50, 0x7d, - 0x4d, 0x5d, 0x5c, 0x4e, 0x6b, 0x60, 0x4b, 0x61, - 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, - 0xf8, 0xf9, 0x7a, 0x5e, 0x4c, 0x7e, 0x6e, 0x6f, - 0x7c, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, - 0xc8, 0xc9, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, - 0xd7, 0xd8, 0xd9, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, - 0xe7, 0xe8, 0xe9, 0xad, 0xe0, 0xbd, 0x5f, 0x6d, + 0x00, 0x01, 0x02, 0x03, 0x37, 0x2D, 0x2E, 0x2F, + 0x16, 0x05, 0x25, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, + 0x10, 0x11, 0x12, 0x13, 0x3C, 0x3D, 0x32, 0x26, + 0x18, 0x19, 0x3F, 0x27, 0x1C, 0x1D, 0x1E, 0x1F, + 0x40, 0x5A, 0x7F, 0x7B, 0x5B, 0x6C, 0x50, 0x7D, + 0x4D, 0x5D, 0x5C, 0x4E, 0x6B, 0x60, 0x4B, 0x61, + 0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7, + 0xF8, 0xF9, 0x7A, 0x5E, 0x4C, 0x7E, 0x6E, 0x6F, + 0x7C, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, + 0xC8, 0xC9, 0xD1, 0xD2, 0xD3, 0xD4, 0xD5, 0xD6, + 0xD7, 0xD8, 0xD9, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, + 0xE7, 0xE8, 0xE9, 0xAD, 0xE0, 0xBD, 0x5F, 0x6D, 0x79, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, - 0x97, 0x98, 0x99, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, - 0xa7, 0xa8, 0xa9, 0xc0, 0x6a, 0xd0, 0xa1, 0x07, - 0x68, 0xdc, 0x51, 0x42, 0x43, 0x44, 0x47, 0x48, + 0x97, 0x98, 0x99, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, + 0xA7, 0xA8, 0xA9, 0xC0, 0x6A, 0xD0, 0xA1, 0x07, + 0x68, 0xDC, 0x51, 0x42, 0x43, 0x44, 0x47, 0x48, 0x52, 0x53, 0x54, 0x57, 0x56, 0x58, 0x63, 0x67, - 0x71, 0x9c, 0x9e, 0xcb, 0xcc, 0xcd, 0xdb, 0xdd, - 0xdf, 0xec, 0xfc, 0xb0, 0xb1, 0xb2, 0x3e, 0xb4, - 0x45, 0x55, 0xce, 0xde, 0x49, 0x69, 0x9a, 0x9b, - 0xab, 0x9f, 0xba, 0xb8, 0xb7, 0xaa, 0x8a, 0x8b, - 0xb6, 0xb5, 0x62, 0x4f, 0x64, 0x65, 0x66, 0x20, - 0x21, 0x22, 0x70, 0x23, 0x72, 0x73, 0x74, 0xbe, - 0x76, 0x77, 0x78, 0x80, 0x24, 0x15, 0x8c, 0x8d, - 0x8e, 0x41, 0x06, 0x17, 0x28, 0x29, 0x9d, 0x2a, - 0x2b, 0x2c, 0x09, 0x0a, 0xac, 0x4a, 0xae, 0xaf, - 0x1b, 0x30, 0x31, 0xfa, 0x1a, 0x33, 0x34, 0x35, - 0x36, 0x59, 0x08, 0x38, 0xbc, 0x39, 0xa0, 0xbf, - 0xca, 0x3a, 0xfe, 0x3b, 0x04, 0xcf, 0xda, 0x14, - 0xe1, 0x8f, 0x46, 0x75, 0xfd, 0xeb, 0xee, 0xed, - 0x90, 0xef, 0xb3, 0xfb, 0xb9, 0xea, 0xbb, 0xff, + 0x71, 0x9C, 0x9E, 0xCB, 0xCC, 0xCD, 0xDB, 0xDD, + 0xDF, 0xEC, 0xFC, 0xB0, 0xB1, 0xB2, 0x3E, 0xB4, + 0x45, 0x55, 0xCE, 0xDE, 0x49, 0x69, 0x9A, 0x9B, + 0xAB, 0x9F, 0xBA, 0xB8, 0xB7, 0xAA, 0x8A, 0x8B, + 0xB6, 0xB5, 0x62, 0x4F, 0x64, 0x65, 0x66, 0x20, + 0x21, 0x22, 0x70, 0x23, 0x72, 0x73, 0x74, 0xBE, + 0x76, 0x77, 0x78, 0x80, 0x24, 0x15, 0x8C, 0x8D, + 0x8E, 0x41, 0x06, 0x17, 0x28, 0x29, 0x9D, 0x2A, + 0x2B, 0x2C, 0x09, 0x0A, 0xAC, 0x4A, 0xAE, 0xAF, + 0x1B, 0x30, 0x31, 0xFA, 0x1A, 0x33, 0x34, 0x35, + 0x36, 0x59, 0x08, 0x38, 0xBC, 0x39, 0xA0, 0xBF, + 0xCA, 0x3A, 0xFE, 0x3B, 0x04, 0xCF, 0xDA, 0x14, + 0xE1, 0x8F, 0x46, 0x75, 0xFD, 0xEB, 0xEE, 0xED, + 0x90, 0xEF, 0xB3, 0xFB, 0xB9, 0xEA, 0xBB, 0xFF }; + /* Decimal constants */ /* Function prototypes */ static int prog (); static int prog_ (const int); -static void prog_module_init (cob_module *module); /* Main function */ int @@ -4267,12 +2873,6 @@ main (int argc, char **argv) /* Functions */ -static void gc_module_so_init () __attribute__ ((constructor)); -static void gc_module_so_init () -{ - cob_check_version (COB_SOURCE_FILE, COB_PACKAGE_VERSION, COB_PATCH_LEVEL); -} - /* PROGRAM-ID 'prog' */ /* ENTRY 'prog' */ @@ -4287,12 +2887,12 @@ static int prog_ (const int entry) { /* Program local variables */ - /* Generated by cobc 3.2.0 */ + /* Generated by cobc 2.2.0 */ /* Generated from prog.cob */ - /* Generated at juil. 23 2024 14:24:33 */ - /* GnuCOBOL build date Apr 17 2024 11:34:39 */ - /* GnuCOBOL package date Jul 28 2023 17:02:56 UTC */ - /* Compile command /opt/gnucobol/gnucobol-3.2/bin/cobc -fdefault-colseq=ebcdic -DEXPECT-ORDER=EBCDIC -Cx -fno-computed-goto prog.cob */ + /* Generated at juil. 23 2024 17:48:46 */ + /* 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 -fno-constant-folding prog.cob */ /* Program local variables for 'prog' */ @@ -4306,15 +2906,6 @@ prog_ (const int entry) cob_global *cob_glob_ptr; - /* LINKAGE SECTION (Items not referenced by USING clause) */ - static unsigned char *b_9 = NULL; /* XML-NAMESPACE */ - static unsigned char *b_10 = NULL; /* XML-NAMESPACE-PREFIX */ - static unsigned char *b_11 = NULL; /* XML-NNAMESPACE */ - static unsigned char *b_12 = NULL; /* XML-NNAMESPACE-PREFIX */ - static unsigned char *b_13 = NULL; /* XML-NTEXT */ - static unsigned char *b_14 = NULL; /* XML-TEXT */ - - /* Local cob_field items */ cob_field f0; @@ -4329,14 +2920,14 @@ prog_ (const int entry) /* Data storage */ static int b_2; /* RETURN-CODE */ - static cob_u8_t b_17[10] __attribute__((aligned)); /* Z */ + static cob_u8_t b_6[10] __attribute__((aligned)); /* Z */ - /* End of local data storage */ + /* End of data storage */ - /* Fields (local) */ - static cob_field f_18 = {10, b_17, &a_2}; /* G */ - static cob_field f_20 = {1, b_17, &a_1}; /* X */ + /* Fields */ + static cob_field f_7 = {10, b_6, &a_2}; /* G */ + static cob_field f_9 = {1, b_6, &a_1}; /* X */ /* End of fields */ @@ -4346,8 +2937,6 @@ prog_ (const int entry) /* CANCEL callback */ if (unlikely(entry < 0)) { - if (entry == -10) - goto P_dump; if (entry == -20) goto P_clear_decimal; goto P_cancel; @@ -4380,112 +2969,59 @@ prog_ (const int entry) /* PROCEDURE DIVISION */ - /* Line: 10 : Entry prog : prog.cob */ + /* Line: 16 : Entry prog : prog.cob */ l_2:; - /* Line: 10 : SORT : prog.cob */ - cob_table_sort_init (1, cob_ascii_ebcdic); - cob_table_sort_init_key (&f_20, 0, 0); - cob_table_sort (COB_SET_FLD (f0, 1, b_17, &a_2), 10); + /* Line: 16 : SORT : prog.cob */ + cob_table_sort_init (1, 0); + cob_table_sort_init_key (&f_9, 0, 0); + cob_table_sort (COB_SET_FLD(f0, 1, b_6 + 0, &a_2), 10); - /* Line: 14 : IF : prog.cob */ - if (((int)cob_cmp (&f_18, (cob_field *)&c_1) != 0)) + /* Line: 20 : IF : prog.cob */ + if (((int)cob_cmp (&f_7, (cob_field *)&c_1) != 0)) { - /* Line: 18 : DISPLAY : prog.cob */ - cob_display (0, 1, 1, &f_18); + /* Line: 24 : DISPLAY : prog.cob */ + cob_display (0, 1, 1, &f_7); } - /* Line: 20 : STOP RUN : prog.cob */ + /* Line: 26 : STOP RUN : prog.cob */ cob_stop_run (b_2); - /* Program exit */ - - /* Decrement module active count */ - if (module->module_active) { - module->module_active--; - } - - /* Pop module stack */ - cob_module_leave (module); - - /* Program return */ - return b_2; - - /* Frame stack jump table */ - P_switch: - P_cgerror: - cob_fatal_error (COB_FERROR_CODEGEN); - - - /* Program initialization */ - P_initialize: - - cob_module_path = cob_glob_ptr->cob_main_argv0; - - prog_module_init (module); - - module->collating_sequence = cob_ascii_ebcdic; - module->crt_status = NULL; - module->cursor_pos = NULL; - module->xml_code = NULL; - module->xml_event = NULL; - module->xml_information = NULL; - module->xml_namespace = NULL; - module->xml_namespace_prefix = NULL; - module->xml_nnamespace = NULL; - module->xml_nnamespace_prefix = NULL; - module->xml_ntext = NULL; - module->xml_text = NULL; - module->json_code = NULL; - module->json_status = NULL; - - /* Initialize cancel callback */ - cob_set_cancel (module); - - /* Initialize WORKING-STORAGE */ - /* initialize field RETURN-CODE */ - b_2 = 0; - - /* initialize field Z */ - memcpy (b_17, "d4b2e1a3c5", 10); - - - - if (0 == 1) goto P_cgerror; - initialized = 1; - goto P_ret_initialize; + /* Program exit */ - P_dump: - return 0; + /* Decrement module active count */ + if (module->module_active) { + module->module_active--; + } + /* Pop module stack */ + cob_module_leave (module); - /* CANCEL callback handling */ - P_cancel: + /* Program return */ + return b_2; - if (!initialized) - return 0; - if (module && module->module_active) - cob_fatal_error (COB_FERROR_CANCEL); + /* Frame stack jump table */ + P_switch: + cob_fatal_error (COB_FERROR_CODEGEN); - initialized = 0; - P_clear_decimal: - return 0; + /* Program initialization */ + P_initialize: -} + cob_check_version (COB_SOURCE_FILE, COB_PACKAGE_VERSION, COB_PATCH_LEVEL); -/* End PROGRAM-ID 'prog' */ + cob_module_path = cob_glob_ptr->cob_main_argv0; -/* Initialize module structure for prog */ -static void prog_module_init (cob_module *module) -{ + /* Initialize module structure */ module->module_name = "prog"; module->module_formatted_date = COB_MODULE_FORMATTED_DATE; module->module_source = COB_SOURCE_FILE; - module->gc_version = COB_PACKAGE_VERSION; module->module_entry.funcptr = (void *(*)())prog; module->module_cancel.funcptr = (void *(*)())prog_; + module->collating_sequence = cob_ascii_ebcdic; + module->crt_status = NULL; + module->cursor_pos = NULL; module->module_ref_count = NULL; module->module_path = &cob_module_path; module->module_active = 0; @@ -4493,6 +3029,7 @@ static void prog_module_init (cob_module *module) module->module_time = COB_MODULE_TIME; module->module_type = 0; module->module_param_cnt = 0; + module->module_returning = 0; module->ebcdic_sign = 0; module->decimal_point = '.'; module->currency_symbol = '$'; @@ -4505,44 +3042,72 @@ static void prog_module_init (cob_module *module) module->flag_main = 1; module->flag_fold_call = 0; module->flag_exit_program = 0; - module->flag_debug_trace = 0; - module->flag_dump_ready = 0; - module->xml_mode = 1; - module->module_stmt = 0; - module->module_sources = NULL; + + /* Initialize cancel callback */ + cob_set_cancel (module); + + /* Initialize WORKING-STORAGE */ + b_2 = 0; + memcpy (b_6, "d4b2e1a3c5", 10); + + initialized = 1; + goto P_ret_initialize; + + /* CANCEL callback handling */ + P_cancel: + + if (!initialized) { + return 0; + } + if (module->module_active) { + cob_fatal_error (COB_FERROR_CANCEL); + } + + initialized = 0; + + P_clear_decimal: + + return 0; + } +/* End PROGRAM-ID 'prog' */ + /* End functions */ ]]) AT_DATA([native.c], [[ -/* Generated by cobc 3.2.0 */ +/* Generated by cobc 2.2.0 */ /* Generated from prog.cob */ -/* Generated at juil. 23 2024 14:25:06 */ -/* GnuCOBOL build date Apr 17 2024 11:34:39 */ -/* GnuCOBOL package date Jul 28 2023 17:02:56 UTC */ -/* Compile command /opt/gnucobol/gnucobol-3.2/bin/cobc -fdefault-colseq=native -DEXPECT-ORDER=NATIVE -Cx -fno-computed-goto prog.cob */ +/* Generated at juil. 23 2024 17:49:26 */ +/* 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 -fno-constant-folding prog.cob */ -#include /* for memcpy, memcmp and friends */ +#include +#include +#include +#include +#include #define COB_KEYWORD_INLINE __inline #include #define COB_SOURCE_FILE "prog.cob" -#define COB_PACKAGE_VERSION "3.2" +#define COB_PACKAGE_VERSION "2.2" #define COB_PATCH_LEVEL 0 -#define COB_MODULE_FORMATTED_DATE "juil. 23 2024 14:25:06" +#define COB_MODULE_FORMATTED_DATE "juil. 23 2024 17:49:26" #define COB_MODULE_DATE 20240723 -#define COB_MODULE_TIME 142506 +#define COB_MODULE_TIME 174926 /* Global variables */ -/* Generated by cobc 3.2.0 */ +/* Generated by cobc 2.2.0 */ /* Generated from prog.cob */ -/* Generated at juil. 23 2024 14:25:06 */ -/* GnuCOBOL build date Apr 17 2024 11:34:39 */ -/* GnuCOBOL package date Jul 28 2023 17:02:56 UTC */ -/* Compile command /opt/gnucobol/gnucobol-3.2/bin/cobc -fdefault-colseq=native -DEXPECT-ORDER=NATIVE -Cx -fno-computed-goto prog.cob */ +/* Generated at juil. 23 2024 17:49:26 */ +/* 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 -fno-constant-folding prog.cob */ /* Module path */ @@ -4555,14 +3120,57 @@ static int cob_call_params = 0; static const cob_field_attr a_1 = {0x21, 0, 0, 0x0000, NULL}; static const cob_field_attr a_2 = {0x01, 0, 0, 0x0000, NULL}; +static const cob_field_attr a_3 = {0x21, 0, 0, 0x1000, NULL}; + +/* Constants */ +static const cob_field c_1 = {10, (cob_u8_ptr)"12345abcde", &a_3}; +static const cob_field c_2 = {10, (cob_u8_ptr)"abcde12345", &a_3}; + + +/* NATIVE table */ +static const unsigned char cob_native[256] = { + 0, 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, 62, 63, + 64, 65, 66, 67, 68, 69, 70, 71, + 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, + 88, 89, 90, 91, 92, 93, 94, 95, + 96, 97, 98, 99, 100, 101, 102, 103, + 104, 105, 106, 107, 108, 109, 110, 111, + 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 127, + 128, 129, 130, 131, 132, 133, 134, 135, + 136, 137, 138, 139, 140, 141, 142, 143, + 144, 145, 146, 147, 148, 149, 150, 151, + 152, 153, 154, 155, 156, 157, 158, 159, + 160, 161, 162, 163, 164, 165, 166, 167, + 168, 169, 170, 171, 172, 173, 174, 175, + 176, 177, 178, 179, 180, 181, 182, 183, + 184, 185, 186, 187, 188, 189, 190, 191, + 192, 193, 194, 195, 196, 197, 198, 199, + 200, 201, 202, 203, 204, 205, 206, 207, + 208, 209, 210, 211, 212, 213, 214, 215, + 216, 217, 218, 219, 220, 221, 222, 223, + 224, 225, 226, 227, 228, 229, 230, 231, + 232, 233, 234, 235, 236, 237, 238, 239, + 240, 241, 242, 243, 244, 245, 246, 247, + 248, 249, 250, 251, 252, 253, 254, 255 +}; + + /* Decimal constants */ /* Function prototypes */ static int prog (); static int prog_ (const int); -static void prog_module_init (cob_module *module); /* Main function */ int @@ -4574,12 +3182,6 @@ main (int argc, char **argv) /* Functions */ -static void gc_module_so_init () __attribute__ ((constructor)); -static void gc_module_so_init () -{ - cob_check_version (COB_SOURCE_FILE, COB_PACKAGE_VERSION, COB_PATCH_LEVEL); -} - /* PROGRAM-ID 'prog' */ /* ENTRY 'prog' */ @@ -4594,12 +3196,12 @@ static int prog_ (const int entry) { /* Program local variables */ - /* Generated by cobc 3.2.0 */ + /* Generated by cobc 2.2.0 */ /* Generated from prog.cob */ - /* Generated at juil. 23 2024 14:25:06 */ - /* GnuCOBOL build date Apr 17 2024 11:34:39 */ - /* GnuCOBOL package date Jul 28 2023 17:02:56 UTC */ - /* Compile command /opt/gnucobol/gnucobol-3.2/bin/cobc -fdefault-colseq=native -DEXPECT-ORDER=NATIVE -Cx -fno-computed-goto prog.cob */ + /* Generated at juil. 23 2024 17:49:26 */ + /* 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 -fno-constant-folding prog.cob */ /* Program local variables for 'prog' */ @@ -4613,15 +3215,6 @@ prog_ (const int entry) cob_global *cob_glob_ptr; - /* LINKAGE SECTION (Items not referenced by USING clause) */ - static unsigned char *b_9 = NULL; /* XML-NAMESPACE */ - static unsigned char *b_10 = NULL; /* XML-NAMESPACE-PREFIX */ - static unsigned char *b_11 = NULL; /* XML-NNAMESPACE */ - static unsigned char *b_12 = NULL; /* XML-NNAMESPACE-PREFIX */ - static unsigned char *b_13 = NULL; /* XML-NTEXT */ - static unsigned char *b_14 = NULL; /* XML-TEXT */ - - /* Local cob_field items */ cob_field f0; @@ -4636,14 +3229,14 @@ prog_ (const int entry) /* Data storage */ static int b_2; /* RETURN-CODE */ - static cob_u8_t b_17[10] __attribute__((aligned)); /* Z */ + static cob_u8_t b_6[10] __attribute__((aligned)); /* Z */ - /* End of local data storage */ + /* End of data storage */ - /* Fields (local) */ - static cob_field f_18 = {10, b_17, &a_2}; /* G */ - static cob_field f_20 = {1, b_17, &a_1}; /* X */ + /* Fields */ + static cob_field f_7 = {10, b_6, &a_2}; /* G */ + static cob_field f_9 = {1, b_6, &a_1}; /* X */ /* End of fields */ @@ -4653,8 +3246,6 @@ prog_ (const int entry) /* CANCEL callback */ if (unlikely(entry < 0)) { - if (entry == -10) - goto P_dump; if (entry == -20) goto P_clear_decimal; goto P_cancel; @@ -4687,24 +3278,24 @@ prog_ (const int entry) /* PROCEDURE DIVISION */ - /* Line: 10 : Entry prog : prog.cob */ + /* Line: 16 : Entry prog : prog.cob */ l_2:; - /* Line: 10 : SORT : prog.cob */ + /* Line: 16 : SORT : prog.cob */ cob_table_sort_init (1, 0); - cob_table_sort_init_key (&f_20, 0, 0); - cob_table_sort (COB_SET_FLD (f0, 1, b_17, &a_2), 10); + cob_table_sort_init_key (&f_9, 0, 0); + cob_table_sort (COB_SET_FLD(f0, 1, b_6 + 0, &a_2), 10); - /* Line: 16 : IF : prog.cob */ - if ((!((int)memcmp (b_17, (cob_u8_ptr)"12345abcde", 10) == 0) || - ((int)memcmp (b_17, (cob_u8_ptr)"abcde12345", 10) == 0))) + /* Line: 22 : IF : prog.cob */ + if ((!((int)cob_cmp (&f_7, (cob_field *)&c_1) == 0) || + ((int)cob_cmp (&f_7, (cob_field *)&c_2) == 0))) { - /* Line: 18 : DISPLAY : prog.cob */ - cob_display (0, 1, 1, &f_18); + /* Line: 24 : DISPLAY : prog.cob */ + cob_display (0, 1, 1, &f_7); } - /* Line: 20 : STOP RUN : prog.cob */ + /* Line: 26 : STOP RUN : prog.cob */ cob_stop_run (b_2); /* Program exit */ @@ -4722,114 +3313,86 @@ prog_ (const int entry) /* Frame stack jump table */ P_switch: - P_cgerror: - cob_fatal_error (COB_FERROR_CODEGEN); + cob_fatal_error (COB_FERROR_CODEGEN); /* Program initialization */ P_initialize: - cob_module_path = cob_glob_ptr->cob_main_argv0; + cob_check_version (COB_SOURCE_FILE, COB_PACKAGE_VERSION, COB_PATCH_LEVEL); - prog_module_init (module); + cob_module_path = cob_glob_ptr->cob_main_argv0; - module->collating_sequence = NULL; + /* Initialize module structure */ + module->module_name = "prog"; + module->module_formatted_date = COB_MODULE_FORMATTED_DATE; + module->module_source = COB_SOURCE_FILE; + module->module_entry.funcptr = (void *(*)())prog; + module->module_cancel.funcptr = (void *(*)())prog_; + module->collating_sequence = cob_native; module->crt_status = NULL; module->cursor_pos = NULL; - module->xml_code = NULL; - module->xml_event = NULL; - module->xml_information = NULL; - module->xml_namespace = NULL; - module->xml_namespace_prefix = NULL; - module->xml_nnamespace = NULL; - module->xml_nnamespace_prefix = NULL; - module->xml_ntext = NULL; - module->xml_text = NULL; - module->json_code = NULL; - module->json_status = NULL; + module->module_ref_count = NULL; + module->module_path = &cob_module_path; + module->module_active = 0; + module->module_date = COB_MODULE_DATE; + module->module_time = COB_MODULE_TIME; + module->module_type = 0; + module->module_param_cnt = 0; + module->module_returning = 0; + module->ebcdic_sign = 0; + module->decimal_point = '.'; + module->currency_symbol = '$'; + module->numeric_separator = ','; + module->flag_filename_mapping = 1; + module->flag_binary_truncate = 1; + module->flag_pretty_display = 1; + module->flag_host_sign = 0; + module->flag_no_phys_canc = 1; + module->flag_main = 1; + module->flag_fold_call = 0; + module->flag_exit_program = 0; /* Initialize cancel callback */ cob_set_cancel (module); /* Initialize WORKING-STORAGE */ - /* initialize field RETURN-CODE */ b_2 = 0; + memcpy (b_6, "d4b2e1a3c5", 10); - /* initialize field Z */ - memcpy (b_17, "d4b2e1a3c5", 10); - - - - if (0 == 1) goto P_cgerror; initialized = 1; goto P_ret_initialize; - P_dump: - return 0; - - /* CANCEL callback handling */ P_cancel: - if (!initialized) + if (!initialized) { return 0; - if (module && module->module_active) + } + if (module->module_active) { cob_fatal_error (COB_FERROR_CANCEL); + } initialized = 0; P_clear_decimal: + return 0; } /* End PROGRAM-ID 'prog' */ -/* Initialize module structure for prog */ -static void prog_module_init (cob_module *module) -{ - module->module_name = "prog"; - module->module_formatted_date = COB_MODULE_FORMATTED_DATE; - module->module_source = COB_SOURCE_FILE; - module->gc_version = COB_PACKAGE_VERSION; - module->module_entry.funcptr = (void *(*)())prog; - module->module_cancel.funcptr = (void *(*)())prog_; - module->module_ref_count = NULL; - module->module_path = &cob_module_path; - module->module_active = 0; - module->module_date = COB_MODULE_DATE; - module->module_time = COB_MODULE_TIME; - module->module_type = 0; - module->module_param_cnt = 0; - module->ebcdic_sign = 0; - module->decimal_point = '.'; - module->currency_symbol = '$'; - module->numeric_separator = ','; - module->flag_filename_mapping = 1; - module->flag_binary_truncate = 1; - module->flag_pretty_display = 1; - module->flag_host_sign = 0; - module->flag_no_phys_canc = 1; - module->flag_main = 1; - module->flag_fold_call = 0; - module->flag_exit_program = 0; - module->flag_debug_trace = 0; - module->flag_dump_ready = 0; - module->xml_mode = 1; - module->module_stmt = 0; - module->module_sources = NULL; -} - /* End functions */ ]]) -AT_CHECK([$COMPILE -fdefault-colseq=ascii -DEXPECT-ORDER=ASCII -o ascii ascii.c], [0], [], []) +AT_CHECK([$COMPILE -o ascii ascii.c], [0], [], []) AT_CHECK([$COBCRUN_DIRECT ./ascii], [0], [], []) -AT_CHECK([$COMPILE -fdefault-colseq=ebcdic -DEXPECT-ORDER=EBCDIC -o ebcdic ebcdic.c], [0], [], []) +AT_CHECK([$COMPILE -o ebcdic ebcdic.c], [0], [], []) AT_CHECK([$COBCRUN_DIRECT ./ebcdic], [0], [], []) -AT_CHECK([$COMPILE -fdefault-colseq=native -DEXPECT-ORDER=NATIVE -o native native.c], [0], [], []) +AT_CHECK([$COMPILE -o native native.c], [0], [], []) AT_CHECK([$COBCRUN_DIRECT ./native], [0], [], []) AT_CLEANUP @@ -4839,31 +3402,35 @@ AT_SETUP([INSPECT/STRING/UNSTRING statements]) AT_KEYWORDS([backcomp INSPECT STRING UNSTRING]) AT_DATA([prog.c], [[ -/* Generated by cobc 3.1.2.0 */ +/* Generated by cobc 2.2.0 */ /* Generated from prog.cob */ -/* Generated at juil. 23 2024 15:35:29 */ -/* GnuCOBOL build date Apr 17 2024 11:33:59 */ -/* GnuCOBOL package date Dec 23 2020 12:04:58 UTC */ -/* Compile command /opt/gnucobol/gnucobol-3.1/bin/cobc -Cx -fno-computed-goto prog.cob */ +/* Generated at juil. 23 2024 16:22:10 */ +/* 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 */ +#include +#include +#include #include +#include #define COB_KEYWORD_INLINE __inline #include #define COB_SOURCE_FILE "prog.cob" -#define COB_PACKAGE_VERSION "3.1.2" +#define COB_PACKAGE_VERSION "2.2" #define COB_PATCH_LEVEL 0 -#define COB_MODULE_FORMATTED_DATE "juil. 23 2024 15:35:29" +#define COB_MODULE_FORMATTED_DATE "juil. 23 2024 16:22:10" #define COB_MODULE_DATE 20240723 -#define COB_MODULE_TIME 153529 +#define COB_MODULE_TIME 162210 /* Global variables */ -/* Generated by cobc 3.1.2.0 */ +/* Generated by cobc 2.2.0 */ /* Generated from prog.cob */ -/* Generated at juil. 23 2024 15:35:29 */ -/* GnuCOBOL build date Apr 17 2024 11:33:59 */ -/* GnuCOBOL package date Dec 23 2020 12:04:58 UTC */ -/* Compile command /opt/gnucobol/gnucobol-3.1/bin/cobc -Cx -fno-computed-goto prog.cob */ +/* Generated at juil. 23 2024 16:22:10 */ +/* 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 */ /* Module path */ @@ -4882,35 +3449,34 @@ static const cob_field_attr cob_all_attr = {0x22, 0, 0, 0, NULL}; /* Constants */ -static const cob_field c_1 = {1, (cob_u8_ptr)"1", &a_3}; -static const cob_field c_2 = {1, (cob_u8_ptr)"u", &a_3}; -static const cob_field c_3 = {1, (cob_u8_ptr)"2", &a_3}; -static const cob_field c_4 = {1, (cob_u8_ptr)"S", &a_3}; -static const cob_field c_5 = {1, (cob_u8_ptr)"3", &a_3}; -static const cob_field c_6 = {1, (cob_u8_ptr)"4", &a_3}; -static const cob_field c_7 = {1, (cob_u8_ptr)"5", &a_3}; -static const cob_field c_8 = {1, (cob_u8_ptr)"6", &a_3}; -static const cob_field c_9 = {1, (cob_u8_ptr)"s", &a_3}; -static const cob_field c_10 = {1, (cob_u8_ptr)"7", &a_3}; -static const cob_field c_11 = {1, (cob_u8_ptr)"U", &a_3}; -static const cob_field c_12 = {1, (cob_u8_ptr)"8", &a_3}; -static const cob_field c_13 = {1, (cob_u8_ptr)"a", &a_3}; -static const cob_field c_14 = {1, (cob_u8_ptr)"9", &a_3}; -static const cob_field c_15 = {2, (cob_u8_ptr)"aa", &a_3}; -static const cob_field c_16 = {2, (cob_u8_ptr)"AA", &a_3}; -static const cob_field c_17 = {2, (cob_u8_ptr)"10", &a_3}; -static const cob_field c_18 = {2, (cob_u8_ptr)"11", &a_3}; -static const cob_field c_19 = {2, (cob_u8_ptr)"12", &a_3}; +static const cob_field c_1 = {1, (cob_u8_ptr)"u", &a_3}; +static const cob_field c_2 = {1, (cob_u8_ptr)"2", &a_3}; +static const cob_field c_3 = {1, (cob_u8_ptr)"S", &a_3}; +static const cob_field c_4 = {1, (cob_u8_ptr)"3", &a_3}; +static const cob_field c_5 = {1, (cob_u8_ptr)"4", &a_3}; +static const cob_field c_6 = {1, (cob_u8_ptr)"5", &a_3}; +static const cob_field c_7 = {1, (cob_u8_ptr)"6", &a_3}; +static const cob_field c_8 = {1, (cob_u8_ptr)"s", &a_3}; +static const cob_field c_9 = {1, (cob_u8_ptr)"7", &a_3}; +static const cob_field c_10 = {1, (cob_u8_ptr)"U", &a_3}; +static const cob_field c_11 = {1, (cob_u8_ptr)"8", &a_3}; +static const cob_field c_12 = {1, (cob_u8_ptr)"a", &a_3}; +static const cob_field c_13 = {1, (cob_u8_ptr)"9", &a_3}; +static const cob_field c_14 = {2, (cob_u8_ptr)"aa", &a_3}; +static const cob_field c_15 = {2, (cob_u8_ptr)"AA", &a_3}; +static const cob_field c_16 = {2, (cob_u8_ptr)"10", &a_3}; +static const cob_field c_17 = {2, (cob_u8_ptr)"11", &a_3}; +static const cob_field c_18 = {2, (cob_u8_ptr)"12", &a_3}; static cob_field cob_all_space = {1, (cob_u8_ptr)" ", &cob_all_attr}; + /* Decimal constants */ /* Function prototypes */ static int strings__stmt (); static int strings__stmt_ (const int); -static void strings__stmt_module_init (cob_module *module); /* Main function */ int @@ -4936,12 +3502,12 @@ static int strings__stmt_ (const int entry) { /* Program local variables */ - /* Generated by cobc 3.1.2.0 */ + /* Generated by cobc 2.2.0 */ /* Generated from prog.cob */ - /* Generated at juil. 23 2024 15:35:29 */ - /* GnuCOBOL build date Apr 17 2024 11:33:59 */ - /* GnuCOBOL package date Dec 23 2020 12:04:58 UTC */ - /* Compile command /opt/gnucobol/gnucobol-3.1/bin/cobc -Cx -fno-computed-goto prog.cob */ + /* Generated at juil. 23 2024 16:22:10 */ + /* 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 */ /* Program local variables for 'strings-stmt' */ @@ -4965,23 +3531,23 @@ strings__stmt_ (const int entry) /* Data storage */ static int b_2; /* RETURN-CODE */ - static cob_u8_t b_8[30] __attribute__((aligned)); /* ws-0 */ - static cob_u8_t b_9[10] __attribute__((aligned)); /* ws-1 */ - static cob_u8_t b_10[40] __attribute__((aligned)); /* ws-2 */ - static cob_u8_t b_11[28] __attribute__((aligned)); /* ws-words */ - static cob_u8_t b_15[2] __attribute__((aligned)); /* ws-count */ + static cob_u8_t b_6[30] __attribute__((aligned)); /* ws-0 */ + static cob_u8_t b_7[10] __attribute__((aligned)); /* ws-1 */ + static cob_u8_t b_8[40] __attribute__((aligned)); /* ws-2 */ + static cob_u8_t b_9[28] __attribute__((aligned)); /* ws-words */ + static cob_u8_t b_13[2] __attribute__((aligned)); /* ws-count */ - /* End of local data storage */ + /* End of data storage */ - /* Fields (local) */ - static cob_field f_8 = {30, b_8, &a_1}; /* ws-0 */ - static cob_field f_9 = {10, b_9, &a_1}; /* ws-1 */ - static cob_field f_10 = {40, b_10, &a_1}; /* ws-2 */ - static cob_field f_12 = {10, b_11, &a_1}; /* ws-words1 */ - static cob_field f_13 = {12, b_11 + 10, &a_1}; /* ws-words2 */ - static cob_field f_14 = {6, b_11 + 22, &a_1}; /* ws-words3 */ - static cob_field f_15 = {2, b_15, &a_2}; /* ws-count */ + /* Fields */ + static cob_field f_6 = {30, b_6, &a_1}; /* ws-0 */ + static cob_field f_7 = {10, b_7, &a_1}; /* ws-1 */ + static cob_field f_8 = {40, b_8, &a_1}; /* ws-2 */ + static cob_field f_10 = {10, b_9, &a_1}; /* ws-words1 */ + static cob_field f_11 = {12, b_9 + 10, &a_1}; /* ws-words2 */ + static cob_field f_12 = {6, b_9 + 22, &a_1}; /* ws-words3 */ + static cob_field f_13 = {2, b_13, &a_2}; /* ws-count */ /* End of fields */ @@ -4991,8 +3557,6 @@ strings__stmt_ (const int entry) /* CANCEL callback */ if (unlikely(entry < 0)) { - if (entry == -10) - goto P_dump; if (entry == -20) goto P_clear_decimal; goto P_cancel; @@ -5025,195 +3589,178 @@ strings__stmt_ (const int entry) /* PROCEDURE DIVISION */ - /* Line: 15 : Entry strings-stmt : prog.cob */ + /* Line: 16 : Entry strings-stmt : prog.cob */ l_2:; /* Line: 16 : Paragraph main-section : prog.cob */ /* Line: 17 : INSPECT : prog.cob */ - cob_inspect_init (&f_8, 0); + cob_inspect_init (&f_6, 0); cob_inspect_start (); - cob_inspect_characters (&f_15); + cob_inspect_all (&f_13, (cob_field *)&c_1); cob_inspect_finish (); /* Line: 18 : IF : prog.cob */ - if (((int)cob_cmp_numdisp (b_15, 2, 30LL, 0) != 0)) + if (((int)cob_cmp_numdisp (b_13, 2, 2LL, 0) != 0)) { /* Line: 18 : DISPLAY : prog.cob */ - cob_display (0, 1, 1, &c_1); + cob_display (0, 1, 1, &c_2); /* Line: 19 : INITIALIZE : prog.cob */ - memset (b_15, 48, 2); + memset (b_13, 48, 2); /* Line: 21 : INSPECT : prog.cob */ - cob_inspect_init (&f_8, 0); + cob_inspect_init (&f_6, 0); cob_inspect_start (); - cob_inspect_all (&f_15, (cob_field *)&c_2); + cob_inspect_leading (&f_13, (cob_field *)&c_3); cob_inspect_finish (); /* Line: 22 : IF : prog.cob */ - if (((int)cob_cmp_numdisp (b_15, 2, 2LL, 0) != 0)) + if (((int)cob_cmp_numdisp (b_13, 2, 2LL, 0) != 0)) { /* Line: 22 : DISPLAY : prog.cob */ - cob_display (0, 1, 1, &c_3); + cob_display (0, 1, 1, &c_4); /* Line: 23 : INITIALIZE : prog.cob */ - memset (b_15, 48, 2); + memset (b_13, 48, 2); /* Line: 25 : INSPECT : prog.cob */ - cob_inspect_init (&f_8, 0); + cob_inspect_init (&f_6, 0); cob_inspect_start (); - cob_inspect_leading (&f_15, (cob_field *)&c_4); + cob_inspect_before (&cob_all_space); + cob_inspect_characters (&f_13); cob_inspect_finish (); - /* Line: 26 : IF : prog.cob */ - if (((int)cob_cmp_numdisp (b_15, 2, 2LL, 0) != 0)) + /* Line: 27 : IF : prog.cob */ + if (((int)cob_cmp_numdisp (b_13, 2, 10LL, 0) != 0)) { - /* Line: 26 : DISPLAY : prog.cob */ + /* Line: 27 : DISPLAY : prog.cob */ cob_display (0, 1, 1, &c_5); - /* Line: 27 : INITIALIZE : prog.cob */ - memset (b_15, 48, 2); + /* Line: 28 : INITIALIZE : prog.cob */ + memset (b_13, 48, 2); - /* Line: 29 : INSPECT : prog.cob */ - cob_inspect_init (&f_8, 0); + /* Line: 30 : INSPECT : prog.cob */ + cob_inspect_init (&f_6, 0); cob_inspect_start (); cob_inspect_before (&cob_all_space); - cob_inspect_characters (&f_15); + cob_inspect_all (&f_13, (cob_field *)&c_3); cob_inspect_finish (); - /* Line: 31 : IF : prog.cob */ - if (((int)cob_cmp_numdisp (b_15, 2, 10LL, 0) != 0)) + /* Line: 32 : IF : prog.cob */ + if (((int)cob_cmp_numdisp (b_13, 2, 4LL, 0) != 0)) { - /* Line: 31 : DISPLAY : prog.cob */ + /* Line: 32 : DISPLAY : prog.cob */ cob_display (0, 1, 1, &c_6); - /* Line: 32 : INITIALIZE : prog.cob */ - memset (b_15, 48, 2); + /* Line: 33 : INITIALIZE : prog.cob */ + memset (b_13, 48, 2); - /* Line: 34 : INSPECT : prog.cob */ - cob_inspect_init (&f_8, 0); + /* Line: 35 : INSPECT : prog.cob */ + cob_inspect_init (&f_6, 0); cob_inspect_start (); - cob_inspect_before (&cob_all_space); - cob_inspect_all (&f_15, (cob_field *)&c_4); + cob_inspect_after (&cob_all_space); + cob_inspect_all (&f_13, (cob_field *)&c_3); cob_inspect_finish (); - /* Line: 36 : IF : prog.cob */ - if (((int)cob_cmp_numdisp (b_15, 2, 4LL, 0) != 0)) + /* Line: 37 : IF : prog.cob */ + if (((int)cob_cmp_numdisp (b_13, 2, 1LL, 0) != 0)) { - /* Line: 36 : DISPLAY : prog.cob */ + /* Line: 37 : DISPLAY : prog.cob */ cob_display (0, 1, 1, &c_7); - /* Line: 37 : INITIALIZE : prog.cob */ - memset (b_15, 48, 2); - /* Line: 39 : INSPECT : prog.cob */ - cob_inspect_init (&f_8, 0); + cob_inspect_init (&f_6, 1); cob_inspect_start (); - cob_inspect_after (&cob_all_space); - cob_inspect_all (&f_15, (cob_field *)&c_4); + cob_inspect_leading ((cob_field *)&c_8, (cob_field *)&c_3); cob_inspect_finish (); - /* Line: 41 : IF : prog.cob */ - if (((int)cob_cmp_numdisp (b_15, 2, 1LL, 0) != 0)) + /* Line: 40 : IF : prog.cob */ + if (((int)memcmp (b_6, (cob_u8_ptr)"ssYNSSWuAK 06fLGvxwYRgr BjVuSk", 30) != 0)) { /* Line: 41 : DISPLAY : prog.cob */ - cob_display (0, 1, 1, &c_8); + cob_display (0, 1, 1, &c_9); /* Line: 43 : INSPECT : prog.cob */ - cob_inspect_init (&f_8, 1); + cob_inspect_init (&f_6, 1); + cob_inspect_start (); + cob_inspect_all ((cob_field *)&c_8, (cob_field *)&c_3); cob_inspect_start (); - cob_inspect_leading ((cob_field *)&c_9, (cob_field *)&c_4); + cob_inspect_all ((cob_field *)&c_10, (cob_field *)&c_1); cob_inspect_finish (); - /* Line: 44 : IF : prog.cob */ - if (((int)memcmp (b_8, (cob_u8_ptr)"ssYNSSWuAK 06fLGvxwYRgr BjVuSk", 30) != 0)) + /* Line: 45 : IF : prog.cob */ + if (((int)memcmp (b_6, (cob_u8_ptr)"ssYNssWUAK 06fLGvxwYRgr BjVUsk", 30) != 0)) { - /* Line: 45 : DISPLAY : prog.cob */ - cob_display (0, 1, 1, &c_10); + /* Line: 46 : DISPLAY : prog.cob */ + cob_display (0, 1, 1, &c_11); - /* Line: 47 : INSPECT : prog.cob */ - cob_inspect_init (&f_8, 1); + /* Line: 48 : INSPECT : prog.cob */ + cob_inspect_init (&f_6, 1); cob_inspect_start (); - cob_inspect_all ((cob_field *)&c_9, (cob_field *)&c_4); - cob_inspect_start (); - cob_inspect_all ((cob_field *)&c_11, (cob_field *)&c_2); + cob_inspect_before (&cob_all_space); + cob_inspect_all ((cob_field *)&c_12, (cob_field *)&c_8); cob_inspect_finish (); - /* Line: 49 : IF : prog.cob */ - if (((int)memcmp (b_8, (cob_u8_ptr)"ssYNssWUAK 06fLGvxwYRgr BjVUsk", 30) != 0)) + /* Line: 51 : IF : prog.cob */ + if (((int)memcmp (b_6, (cob_u8_ptr)"aaYNaaWUAK 06fLGvxwYRgr BjVUsk", 30) != 0)) { - /* Line: 50 : DISPLAY : prog.cob */ - cob_display (0, 1, 1, &c_12); + /* Line: 52 : DISPLAY : prog.cob */ + cob_display (0, 1, 1, &c_13); - /* Line: 52 : INSPECT : prog.cob */ - cob_inspect_init (&f_8, 1); + /* Line: 54 : INSPECT : prog.cob */ + cob_inspect_init (&f_6, 0); cob_inspect_start (); - cob_inspect_before (&cob_all_space); - cob_inspect_all ((cob_field *)&c_13, (cob_field *)&c_9); + cob_inspect_converting ((cob_field *)&c_14, (cob_field *)&c_15); cob_inspect_finish (); /* Line: 55 : IF : prog.cob */ - if (((int)memcmp (b_8, (cob_u8_ptr)"aaYNaaWUAK 06fLGvxwYRgr BjVUsk", 30) != 0)) + if (((int)memcmp (b_6, (cob_u8_ptr)"AAYNAAWUAK 06fLGvxwYRgr BjVUsk", 30) != 0)) { /* Line: 56 : DISPLAY : prog.cob */ - cob_display (0, 1, 1, &c_14); - - /* Line: 58 : INSPECT : prog.cob */ - cob_inspect_init (&f_8, 0); - cob_inspect_start (); - cob_inspect_converting ((cob_field *)&c_15, (cob_field *)&c_16); - cob_inspect_finish (); - - /* Line: 59 : IF : prog.cob */ - if (((int)memcmp (b_8, (cob_u8_ptr)"AAYNAAWUAK 06fLGvxwYRgr BjVUsk", 30) != 0)) + cob_display (0, 1, 1, &c_16); + + /* Line: 58 : STRING : prog.cob */ + cob_string_init (&f_8, NULL); + cob_string_delimited (NULL); + cob_string_append (&f_6); + cob_string_delimited (NULL); + cob_string_append (&f_7); + cob_string_finish (); + + /* Line: 61 : IF : prog.cob */ + if (((int)memcmp (b_8, (cob_u8_ptr)"AAYNAAWUAK 06fLGvxwYRgr BjVUskoNDT8a9awk", 40) != 0)) { - /* Line: 60 : DISPLAY : prog.cob */ + /* Line: 62 : DISPLAY : prog.cob */ cob_display (0, 1, 1, &c_17); - /* Line: 62 : STRING : prog.cob */ - cob_string_init (&f_10, NULL); - cob_string_delimited (NULL); - cob_string_append (&f_8); - cob_string_delimited (NULL); - cob_string_append (&f_9); - cob_string_finish (); + /* Line: 64 : UNSTRING : prog.cob */ + cob_unstring_init (&f_6, NULL, 1); + cob_unstring_delimited (&cob_all_space, 1); + cob_unstring_into (&f_10, 0, 0); + cob_unstring_into (&f_11, 0, 0); + cob_unstring_into (&f_12, 0, 0); + cob_unstring_finish (); - /* Line: 65 : IF : prog.cob */ - if (((int)memcmp (b_10, (cob_u8_ptr)"AAYNAAWUAK 06fLGvxwYRgr BjVUskoNDT8a9awk", 40) != 0)) + /* Line: 68 : IF : prog.cob */ + if (((int)memcmp (b_9, (cob_u8_ptr)"AAYNAAWUAK06fLGvxwYRgrBjVUsk", 28) != 0)) { - /* Line: 66 : DISPLAY : prog.cob */ + /* Line: 69 : DISPLAY : prog.cob */ cob_display (0, 1, 1, &c_18); - /* Line: 68 : UNSTRING : prog.cob */ - cob_unstring_init (&f_8, NULL, 1); - cob_unstring_delimited (&cob_all_space, 1); - cob_unstring_into (&f_12, 0, 0); - cob_unstring_into (&f_13, 0, 0); - cob_unstring_into (&f_14, 0, 0); - cob_unstring_finish (); - - /* Line: 72 : IF : prog.cob */ - if (((int)memcmp (b_11, (cob_u8_ptr)"AAYNAAWUAK06fLGvxwYRgrBjVUsk", 28) != 0)) - { - - /* Line: 73 : DISPLAY : prog.cob */ - cob_display (0, 1, 1, &c_19); - - /* Line: 75 : STOP RUN : prog.cob */ - cob_stop_run (b_2); - } + /* Line: 71 : STOP RUN : prog.cob */ + cob_stop_run (b_2); } } } @@ -5241,8 +3788,7 @@ strings__stmt_ (const int entry) /* Frame stack jump table */ P_switch: - P_cgerror: - cob_fatal_error (COB_FERROR_CODEGEN); + cob_fatal_error (COB_FERROR_CODEGEN); /* Program initialization */ @@ -5252,54 +3798,15 @@ strings__stmt_ (const int entry) cob_module_path = cob_glob_ptr->cob_main_argv0; - strings__stmt_module_init (module); - - module->crt_status = NULL; - - /* Initialize cancel callback */ - cob_set_cancel (module); - - /* Initialize WORKING-STORAGE */ - b_2 = 0; - memcpy (b_8, "SSYNSSWuAK 06fLGvxwYRgr BjVuSk", 30); - memcpy (b_9, "oNDT8a9awk", 10); - memset (b_10, 32, 40); - memset (b_11, 32, 28); - memset (b_15, 48, 2); - - if (0 == 1) goto P_cgerror; - initialized = 1; - goto P_ret_initialize; - - P_dump: - return 0; - - - /* CANCEL callback handling */ - P_cancel: - - if (!initialized) - return 0; - if (module && module->module_active) - cob_fatal_error (COB_FERROR_CANCEL); - - initialized = 0; - - P_clear_decimal: - return 0; - -} - -/* End PROGRAM-ID 'strings-stmt' */ - -/* Initialize module structure for strings-stmt */ -static void strings__stmt_module_init (cob_module *module) -{ + /* Initialize module structure */ module->module_name = "strings-stmt"; module->module_formatted_date = COB_MODULE_FORMATTED_DATE; module->module_source = COB_SOURCE_FILE; module->module_entry.funcptr = (void *(*)())strings__stmt; module->module_cancel.funcptr = (void *(*)())strings__stmt_; + module->collating_sequence = NULL; + module->crt_status = NULL; + module->cursor_pos = NULL; module->module_ref_count = NULL; module->module_path = &cob_module_path; module->module_active = 0; @@ -5307,6 +3814,7 @@ static void strings__stmt_module_init (cob_module *module) module->module_time = COB_MODULE_TIME; module->module_type = 0; module->module_param_cnt = 0; + module->module_returning = 0; module->ebcdic_sign = 0; module->decimal_point = '.'; module->currency_symbol = '$'; @@ -5319,12 +3827,41 @@ static void strings__stmt_module_init (cob_module *module) module->flag_main = 1; module->flag_fold_call = 0; module->flag_exit_program = 0; - module->flag_debug_trace = 0; - module->flag_dump_ready = 0; - module->module_stmt = 0; - module->module_sources = NULL; + + /* Initialize cancel callback */ + cob_set_cancel (module); + + /* Initialize WORKING-STORAGE */ + b_2 = 0; + memcpy (b_6, "SSYNSSWuAK 06fLGvxwYRgr BjVuSk", 30); + memcpy (b_7, "oNDT8a9awk", 10); + memset (b_8, 32, 40); + memset (b_9, 32, 28); + memset (b_13, 48, 2); + + initialized = 1; + goto P_ret_initialize; + + /* CANCEL callback handling */ + P_cancel: + + if (!initialized) { + return 0; + } + if (module->module_active) { + cob_fatal_error (COB_FERROR_CANCEL); + } + + initialized = 0; + + P_clear_decimal: + + return 0; + } +/* End PROGRAM-ID 'strings-stmt' */ + /* End functions */