diff --git a/bin/ChangeLog b/bin/ChangeLog index a5847f33a..05453ed37 100644 --- a/bin/ChangeLog +++ b/bin/ChangeLog @@ -11,6 +11,11 @@ * cobcrun.c: use libcob's cob_getenv_direct instead of getenv +2023-07-01 Fabrice Le Fessant + + * cob-config: echo in same order as arguments. Add missing + arguments (--bindir,--libdir,--datadir,--mandir,--includedir) + 2022-10-18 Simon Sobisch * cobcrun.c: minor validation - check for empty parameters diff --git a/bin/cob-config.in b/bin/cob-config.in index 6c07e7de1..03931f313 100644 --- a/bin/cob-config.in +++ b/bin/cob-config.in @@ -26,6 +26,10 @@ exec_prefix=${prefix} exec_prefix_set=no libdir=@libdir@ includedir=@includedir@ +bindir=@bindir@ +datadir=@datadir@ +includedir=@includedir@ +mandir=@mandir@ version="@VERSION@.@COB_PATCH_LEVEL@" cflags="@COB_CFLAGS@" @@ -76,24 +80,39 @@ while test $# -gt 0; do exec_prefix=$optarg fi ;; - --prefix) - echo_prefix=yes - ;; --exec-prefix=*) exec_prefix=$optarg exec_prefix_set=yes ;; + --prefix) + echo ${prefix} + ;; --exec-prefix) - echo_exec_prefix=yes + echo ${exec_prefix} ;; --version) - echo $version + echo ${version} ;; --cflags) - echo_cflags=yes + echo ${cflags} ;; --libs) - echo_libs=yes + echo ${libs} + ;; + --bindir) + echo ${bindir} + ;; + --datadir) + echo ${datadir} + ;; + --includedir) + echo ${includedir} + ;; + --libdir) + echo ${libdir} + ;; + --mandir) + echo ${mandir} ;; --help) cat < + + * config.h.in: updated for OrangeC 6.0.70.2 + 2023-05-27 Simon Sobisch * makedist.cmd: first addition for CI output diff --git a/build_windows/config.h.in b/build_windows/config.h.in index f61d8a546..bae1a2791 100644 --- a/build_windows/config.h.in +++ b/build_windows/config.h.in @@ -1,6 +1,6 @@ /* config.h, tested with x86/x64 VS2008-2022 - and OrangeC 6.0.50 (which ignores the lib comments) */ + and OrangeC 6.0.70.2 (which ignores the lib comments) */ #define NOISAM 0 #define VISAM 1 @@ -284,7 +284,11 @@ #undef COB_CFLAGS /* Compilation of computed gotos works */ +#if defined(__ORANGEC__) +#define COB_COMPUTED_GOTO +#else /* #undef COB_COMPUTED_GOTO */ +#endif /* default search path for copybooks */ #define COB_CONFIG_DIR COB_MAIN_DIR "\\config" @@ -296,7 +300,7 @@ #if defined(__ORANGEC__) #define COB_DEBUG_FLAGS "-g" #else -#undef COB_DEBUG_FLAGS +/* #undef COB_DEBUG_FLAGS */ #endif /* Enable internal logging (Developers only!) */ @@ -312,7 +316,7 @@ #if defined(__ORANGEC__) #define COB_EXPORT_DYN "" /* needs to be specified for all but MSVC */ #else -#undef COB_EXPORT_DYN +/* #undef COB_EXPORT_DYN */ #endif /* Keyword for inline */ @@ -358,7 +362,7 @@ #if defined(__ORANGEC__) #define COB_PIC_FLAGS "" /* needs to be specified for all but MSVC */ #else -#undef COB_PIC_FLAGS +/* #undef COB_PIC_FLAGS */ #endif /* default search path for indexed schema definitions */ @@ -368,7 +372,7 @@ #if defined(__ORANGEC__) #define COB_SHARED_OPT "/Wd" #else -#undef COB_SHARED_OPT +/* #undef COB_SHARED_OPT */ #endif /* Strip command */ @@ -378,7 +382,7 @@ #ifdef _DEBUG #define COB_TREE_DEBUG #else -#undef COB_TREE_DEBUG +/* #undef COB_TREE_DEBUG */ #endif /* Define to 1 if translation of program messages to the user's native @@ -484,10 +488,11 @@ /* #undef HAVE_DEFINE_KEY */ /* Has designated initializers */ -/* #undef HAVE_DESIGNATED_INITS */ #if defined(_MSC_VER) && _MSC_VER >= 1800 /* = COB_USE_VC2013_OR_GREATER [which is defined later] */ \ || defined(__ORANGEC__) #define HAVE_DESIGNATED_INITS 1 +#else +/* #undef HAVE_DESIGNATED_INITS */ #endif diff --git a/cobc/ChangeLog b/cobc/ChangeLog index e3765d343..2e14f6350 100644 --- a/cobc/ChangeLog +++ b/cobc/ChangeLog @@ -37,6 +37,50 @@ * error.c, cobc.c (print_program_trailer), flag.def: implemented -fmax-errors=0 as unlimited +2023-07-05 Fabrice Le Fessant + + * flag.def/cobc.c: new flags -fno-ttimestamp to suppress timestamp + in listing headers, and -fttitle=, so that listings can be + compared accross different versions and dates. This patch partially + implements feature-request #294. + Replace numeric constants in flags and switch by a constant macro + CB_FLAG_GETOPT_. Remove unused 'case 6:' for -fdefaultbyte that is + now handled in config.c + +2023-07-04 Simon Sobisch <simonsobisch@gnu.org> + + * codegen.c (output_char): extracted usage of disabled code for + char generation as char into this new inline function + * codegen.c (output_char): fixed previously disabled code and enable it + by default, old code may still be used with defining GEN_CHAR_AS_UINT + * codegen.c (output_initialize_to_value): handle zero-length VALUE + * codegen.c (output_initialize_to_value): fix cb_initial_justify + * codegen.c (output_initialize_to_value): disable setting from a + possibly huge internal buffer with a single generated memcpy from + a generated string, instead use a local buffer of max. 128 bytes + and set padding spaces with memset for bigger fields, old code may + still be used with defining GEN_SINGLE_MEMCPY + +2023-07-03 Simon Sobisch <simonsobisch@gnu.org> + + * pplex.l (check_listing): rewrite of change 2022-07-04: + do not output sequence number of short lines, + but keep its line break and the general output + * pplex.l: drop unused "requires_new_line" (added without use in OC2.0) + +2023-07-01 Simon Sobisch <simonsobisch@gnu.org> + + * scanner.l: add check for reserved word FUNCTION, add missing + word value for not reserved SUPPRESS and SEND + * parser.y (at_line_column): fixed bad cast when conflicting clauses + were used, fixing bug #601 + +2023-06-30 Simon Sobisch <simonsobisch@gnu.org> + + * codegen.c (output_function_prototypes): generate plain "extern" + instead of "COB_EXT_IMPORT" again, as the second only works with + libraries, not with object files / sources + 2023-06-25 Chuck Haatvedt <chuck.haatvedt+cobol@gmail.com> FR #439: dialect option to support justify for IBM compatibility @@ -47,10 +91,10 @@ 2023-06-23 Fabrice Le Fessant <fabrice.le_fessant@ocamlpro.com> * pplex.l (get_word): fix an overflow with words exceeding the - maximal size COB_MAX_WORDLEN - * pplex.l (is_condition_directive_clause) - (next_word_is_comment_paragraph_name): decrease stack storage - and optimize string comparisons + maximal size COB_MAX_WORDLEN + * pplex.l (is_condition_directive_clause, + next_word_is_comment_paragraph_name): decrease stack storage + and optimize string comparisons 2023-06-22 Nicolas Berthier <nicolas.berthier@ocamlpro.com> @@ -61,17 +105,17 @@ -ffast-compare and -fconstant-folding for programs with a non-native collating sequence -2023-06-20 Fabrice Le Fessant <fabrice.le_fessant@ocamlpro.com> - - * typeck.c (cb_build_expr): fix bug #875 "V IS ZERO AND - ... generate 'invalid conditional expression' error", - fix bug #880 error compiling abbreviated conditions in GC3.2 RC2 - (NOT comparison should be translated to inversed comparison) - 2023-06-20 Fabrice Le Fessant <fabrice.le_fessant@ocamlpro.com> * typeck.c (cb_build_expr): remove cb_ prefix from static functions - and comment algorithm + and comment algorithm + + Bugs #875 V IS ZERO AND, #880 error compiling abbreviated conditions + and #887 error compiling parenthesized relation + * typeck.c (cb_build_expr): additional generate 'invalid conditional + expression' error", translate NOT comparison to inversed comparison + * typeck.c (cb_build_expr), tree.c (cb_build_binary_op): give more + details on invalid expressions 2023-06-13 Fabrice Le Fessant <fabrice.le_fessant@ocamlpro.com> @@ -451,7 +495,7 @@ REPORT and SCREEN section only expecting the possibly USAGEs instead all removing the need to check for bad USAGE later * parser.y (display_erase, display_pos_specifier): pass display attributes - to codegen + to codegen, fixing bug #737 2023-01-28 Simon Sobisch <simonsobisch@gnu.org> diff --git a/cobc/cobc.c b/cobc/cobc.c index d304cc619..1a19d4ac9 100644 --- a/cobc/cobc.c +++ b/cobc/cobc.c @@ -91,6 +91,24 @@ enum compile_level { CB_LEVEL_EXECUTABLE = 7 }; +#define CB_FLAG_GETOPT_STACK_SIZE 1 +#define CB_FLAG_GETOPT_SIGN 3 +#define CB_FLAG_GETOPT_FOLD_COPY 4 +#define CB_FLAG_GETOPT_FOLD_CALL 5 +#define CB_FLAG_GETOPT_TTITLE 6 +#define CB_FLAG_GETOPT_MAX_ERRORS 7 +#define CB_FLAG_GETOPT_DUMP 8 +#define CB_FLAG_GETOPT_CALLFH 9 +#define CB_FLAG_GETOPT_INTRINSICS 10 +#define CB_FLAG_GETOPT_EC 11 +#define CB_FLAG_GETOPT_NO_EC 12 +#define CB_FLAG_GETOPT_NO_DUMP 13 +#define CB_FLAG_GETOPT_EBCDIC_TABLE 14 +#define CB_FLAG_GETOPT_DEFAULT_COLSEQ 15 +#define CB_FLAG_GETOPT_SQLSCHEMA 16 +#define CB_FLAG_GETOPT_FILE_FORMAT 17 + + /* Info display limits */ #define CB_IMSG_SIZE 24 #define CB_IVAL_SIZE (74 - CB_IMSG_SIZE - 4) @@ -125,6 +143,9 @@ FILE *cb_listing_file = NULL; FILE *cb_depend_file = NULL; const char *cb_ebcdic_table = NULL; +/* set by option -fttitle=<title> */ +char *cb_listing_with_title = NULL; + /* Listing structures and externals */ #define CB_LINE_LENGTH 1024 /* hint: we only read PPLEX_BUF_LEN bytes */ @@ -333,7 +354,8 @@ static unsigned int cb_listing_linecount; static int cb_listing_eject = 0; static char cb_listing_filename[FILENAME_MAX]; static char *cb_listing_outputfile = NULL; -static char cb_listing_title[81]; /* Listing title (defaults to PACKAGE_NAME + Version */ +#define CB_LISTING_TITLE_MAX_LEN 80 +static char cb_listing_title[CB_LISTING_TITLE_MAX_LEN+1]; /* Listing title (defaults to PACKAGE_NAME + Version */ static char cb_listing_header[133]; /* Listing header */ static struct list_files *cb_listing_file_struct = NULL; static struct list_error *cb_listing_error_head = NULL; @@ -2152,7 +2174,7 @@ set_listing_date (void) #define LISTING_TIMESTAMP_FORMAT "%a %b %d %Y %H:%M:%S" #endif strftime (cb_listing_date, (size_t)CB_LISTING_DATE_MAX, - LISTING_TIMESTAMP_FORMAT, ¤t_compile_tm); + LISTING_TIMESTAMP_FORMAT, ¤t_compile_tm); } @@ -3711,7 +3733,7 @@ process_command_line (const int argc, char **argv) CB_TEXT_LIST_ADD (cb_early_exit_list, cob_optarg); break; - case 1: + case CB_FLAG_GETOPT_STACK_SIZE: /* 1 */ /* -fstack-size=<xx> : Specify stack (perform) size */ n = cobc_deciph_optarg (cob_optarg, 0); if (n < 16 || n > 512) { @@ -3720,7 +3742,7 @@ process_command_line (const int argc, char **argv) cb_stack_size = n; break; - case 3: + case CB_FLAG_GETOPT_SIGN: /* 3 */ /* -fsign=<ASCII/EBCDIC> : Specify display sign */ if (!cb_strcasecmp (cob_optarg, "EBCDIC")) { cb_ebcdic_sign = 1; @@ -3731,19 +3753,19 @@ process_command_line (const int argc, char **argv) } break; - case 16: + case CB_FLAG_GETOPT_EBCDIC_TABLE: /* 14 */ /* -febcdic-table=<cconv-table> */ cb_ebcdic_table = cobc_main_strdup (cob_optarg); break; - case 15: + case CB_FLAG_GETOPT_DEFAULT_COLSEQ: /* 15 */ /* -fdefault-colseq=<ASCII/EBCDIC/NATIVE> */ if (cb_deciph_default_colseq_name (cob_optarg)) { cobc_err_exit (COBC_INV_PAR, "-fdefault-colseq"); } break; - case 4: + case CB_FLAG_GETOPT_FOLD_COPY: /* 4 */ /* -ffold-copy=<UPPER/LOWER> : COPY fold case */ if (!cb_strcasecmp (cob_optarg, "UPPER")) { cb_fold_copy = COB_FOLD_UPPER; @@ -3754,7 +3776,7 @@ process_command_line (const int argc, char **argv) } break; - case 5: + case CB_FLAG_GETOPT_FOLD_CALL: /* 5 */ /* -ffold-call=<UPPER/LOWER> : CALL/PROG-ID fold case */ if (!cb_strcasecmp (cob_optarg, "UPPER")) { cb_fold_call = COB_FOLD_UPPER; @@ -3765,38 +3787,45 @@ process_command_line (const int argc, char **argv) } break; - case 6: - /* -fdefaultbyte=<xx> : Default initialization byte */ - n = cobc_deciph_optarg (cob_optarg, 1); - if (n < 0 || n > 255) { - cobc_err_exit (COBC_INV_PAR, "-fdefaultbyte"); + case CB_FLAG_GETOPT_TTITLE: /* 6 */ + /* -fttitle=<title> : Title for listing */ + { + size_t i, len; + + if (cb_listing_with_title) + cobc_main_free (cb_listing_with_title); + cb_listing_with_title = cobc_main_strdup (cob_optarg); + len = strlen (cb_listing_with_title); + for (i=0; i<len; i++){ + if( cb_listing_with_title[i]=='_' ) + cb_listing_with_title[i]=' '; + } } - cb_default_byte = n; break; - case 7: + case CB_FLAG_GETOPT_MAX_ERRORS: /* 7 */ /* -fmax-errors=<xx> : Maximum errors until abort */ /* This option was processed in the first getopt-run */ break; - case 8: + case CB_FLAG_GETOPT_DUMP: /* 8 */ /* -fdump=<scope> : Add sections for dump code generation */ - case 13: + case CB_FLAG_GETOPT_NO_DUMP: /* 13 */ /* -fno-dump=<scope> : Suppress sections in dump code generation */ /* These options were all processed in the first getopt-run */ break; - case 9: + case CB_FLAG_GETOPT_CALLFH: /* 9 */ /* -fcallfh=<func> : Function-name for EXTFH */ cb_call_extfh = cobc_main_strdup (cob_optarg); break; - case 10: + case CB_FLAG_GETOPT_INTRINSICS: /* 10 */ /* -fintrinsics=<xx> : Intrinsic name or ALL */ cobc_deciph_funcs (cob_optarg); break; - case 11: + case CB_FLAG_GETOPT_SQLSCHEMA: /* 16 */ /* -fsqlschema=<name> : Database schema name for XFD */ cb_sqldb_schema = cobc_main_strdup (cob_optarg); cb_flag_sql_xfd = 1; @@ -3819,7 +3848,7 @@ process_command_line (const int argc, char **argv) #endif break; - case 12: + case CB_FLAG_GETOPT_FILE_FORMAT: /* 17 */ /* -ffile-format=<name> : Default file format */ if (cb_strcasecmp (cob_optarg, "mf") == 0) { cb_mf_files = 1; @@ -3831,7 +3860,7 @@ process_command_line (const int argc, char **argv) } break; - case 14: + case CB_FLAG_GETOPT_EC: /* 11 */ /* -fec=<xx> : COBOL exception-name, e.g. EC-BOUND-OVERFLOW, also allows to skip the prefix e.g. BOUND-OVERFLOW */ if (cobc_deciph_ec (cob_optarg, 1U)) { @@ -3839,7 +3868,7 @@ process_command_line (const int argc, char **argv) }; break; - case 17: + case CB_FLAG_GETOPT_NO_EC: /* 12 */ /* -fno-ec=<xx> : COBOL exception-name, e.g. EC-BOUND-OVERFLOW */ if (cobc_deciph_ec (cob_optarg, 0)) { cobc_err_exit (COBC_INV_PAR, "-fno-ec"); @@ -5314,16 +5343,21 @@ set_listing_header_none (void) cb_listing_header[0] = 0; } -/* standard title for listing - (TODO: option to set by directive and/or command line option) */ +/* standard title for listing */ static void set_standard_title (void) { char version[30]; - snprintf (version, sizeof (version), "%s.%d", PACKAGE_VERSION, PATCH_LEVEL); - snprintf (cb_listing_title, 80, "%s %s", - PACKAGE_NAME, - version); + + if (cb_listing_with_title){ + snprintf (cb_listing_title, CB_LISTING_TITLE_MAX_LEN, "%s", + cb_listing_with_title); + } else { + snprintf (version, sizeof (version), "%s.%d", PACKAGE_VERSION, PATCH_LEVEL); + snprintf (cb_listing_title, CB_LISTING_TITLE_MAX_LEN, "%s %s", + PACKAGE_NAME, + version); + } } /* print header */ @@ -5345,17 +5379,30 @@ print_program_header (void) fputc ('\n', cb_src_list_file); return; } - if (cb_listing_wide) { - format_str = "%-23.23s %-61.61s %s Page %04d\n"; + if (!cb_listing_with_timestamp){ + if (cb_listing_wide) { + format_str = "%-23.23s %-87.87s Page %04d\n"; + } else { + format_str = "%-23.23s %-46.46s Page %04d\n"; + } + fprintf (cb_src_list_file, + format_str, + cb_listing_title, + cb_listing_filename, + ++cb_listing_page); } else { - format_str = "%-23.23s %-20.20s %s Page %04d\n"; + if (cb_listing_wide) { + format_str = "%-23.23s %-61.61s %s Page %04d\n"; + } else { + format_str = "%-23.23s %-20.20s %s Page %04d\n"; + } + fprintf (cb_src_list_file, + format_str, + cb_listing_title, + cb_listing_filename, + cb_listing_date, + ++cb_listing_page); } - fprintf (cb_src_list_file, - format_str, - cb_listing_title, - cb_listing_filename, - cb_listing_date, - ++cb_listing_page); /* header for listing without page breaks: --tlines=0 */ } else { @@ -5366,16 +5413,28 @@ print_program_header (void) if (cb_listing_page == 0) { cb_listing_page = 1; - if (cb_listing_wide) { - format_str = "%-28.28s %-66.66s %s\n"; + if (!cb_listing_with_timestamp){ + if (cb_listing_wide) { + format_str = "%-28.28s %.92s\n"; + } else { + format_str = "%-28.28s %.52s\n"; + } + fprintf (cb_src_list_file, + format_str, + cb_listing_title, + cb_listing_filename); } else { - format_str = "%-28.28s %-26.26s %s\n"; + if (cb_listing_wide) { + format_str = "%-28.28s %-66.66s %s\n"; + } else { + format_str = "%-28.28s %-26.26s %s\n"; + } + fprintf (cb_src_list_file, + format_str, + cb_listing_title, + cb_listing_filename, + cb_listing_date); } - fprintf (cb_src_list_file, - format_str, - cb_listing_title, - cb_listing_filename, - cb_listing_date); } } fputc ('\n', cb_src_list_file); diff --git a/cobc/codegen.c b/cobc/codegen.c index dd6cf3a53..9a491dd59 100644 --- a/cobc/codegen.c +++ b/cobc/codegen.c @@ -168,8 +168,10 @@ static struct cb_program *current_prog = NULL; /* program in codegen (only) * static struct cb_program *recent_prog = NULL; static const struct cb_label *last_section = NULL; +#ifdef GEN_SINGLE_MEMCPY static unsigned char *litbuff = NULL; static int litsize = 0; +#endif static unsigned int has_global_file = 0; static unsigned int needs_exit_prog = 0; @@ -4674,11 +4676,35 @@ output_funcall_typed_report (struct cb_funcall *p, const char type) } -/* -TODO: fix strange errors in "Simple Expressions with figurative constants", - seen if the following is defined -#define GEN_CHAR_AS_CHAR -*/ +/* output a single char with optional (then empty) + leading and trailing string */ +static void COB_INLINE COB_A_INLINE +output_char (const char *lead, const unsigned char c, const char *trail) +{ + if (lead) { + output ("%s", lead); + } +#ifdef GEN_CHAR_AS_UINT /* old "simple" version */ + output ("%u", c); +#else /* "complex" one that we use everywhere else, like in output_string() */ + if (!isprint (c)) { +#if 0 /* octal */ + /* output ("(unsigned char)'\\%03o'", c); */ + output ("%03o", c); +#else /* hex */ + /* output ("(unsigned char)'\\x%X'", c); */ + output ("0x%X", c); +#endif + } else if (c == '\'' || c == '\\') { + output ("(unsigned char)'\\%c'", c); + } else { + output ("(unsigned char)'%c'", c); + } +#endif + if (trail) { + output ("%s", trail); + } +} static void output_funcall_typed (struct cb_funcall *p, const char type) @@ -4713,18 +4739,7 @@ output_funcall_typed (struct cb_funcall *p, const char type) } else if (p->argv[1] == cb_high) { output (") - 255)"); } else if (CB_LITERAL_P (p->argv[1])) { - const unsigned char c = CB_LITERAL (p->argv[1])->data[0]; -#if !defined (GEN_CHAR_AS_CHAR) /* old "simple" version */ - output (") - %u)", c); -#else /* "complex" one that we use everywhere else */ - if (!isprint (c)) { - output (") - '\\%03o')", c); - } else if (c == '\'' || c == '\\') { - output (") - '\\%c')", c); - } else { - output (") - '%c')", c); - } -#endif + output_char (") - ", CB_LITERAL (p->argv[1])->data[0], ")"); } else { output (") - *("); output_data (p->argv[1]); @@ -5468,31 +5483,11 @@ output_initialize_uniform (cb_tree x, struct cb_field *f, if (size == 1) { output ("*(cob_u8_ptr)("); output_data (x); -#if !defined (GEN_CHAR_AS_CHAR) /* old "simple" version */ - output (") = %u;", cc); -#else /* "complex" one that we use everywhere else */ - if (!isprint (cc)) { - output (") = '\\%03o';", cc); - } else if (cc == '\'' || cc == '\\') { - output (") = '\\%c';", cc); - } else { - output (") = '%c';", cc); - } -#endif + output_char (") = ", cc, ";"); } else { output ("memset ("); output_data (x); -#if !defined (GEN_CHAR_AS_CHAR) /* old "simple" version */ - output (", %u, ", cc); -#else /* "complex" one that we use everywhere else */ - if (!isprint (cc)) { - output (", '\\%03o', ", cc); - } else if (cc == '\'' || cc == '\\') { - output (", '\\%c', ", cc); - } else { - output (", '%c', ", cc); - } -#endif + output_char (", ", cc, ", "); if (size <= 0 || (CB_REFERENCE_P(x) && CB_REFERENCE(x)->length)) { output_size (x); @@ -5533,13 +5528,13 @@ output_initialize_to_value (struct cb_field *f, cb_tree x, { cb_tree value; struct cb_literal *l; - size_t lsize; - cob_u32_t inci; - int i; - int n; - int size; - int offset; - int init_occurs; + int i; + int size; + int init_occurs; +#if defined (GEN_SINGLE_MEMCPY) + int offset; + int n; +#endif unsigned char buffchar; if (!CB_LIST_P (f->values)) { @@ -5640,170 +5635,185 @@ output_initialize_to_value (struct cb_field *f, cb_tree x, return; } + /* zero-length literal -> generate MOVE SPACES and return */ + if (l->size == 0) { + output_move (cb_space, x); + return; + } + size = f->size; + /* only single-byte to set, generate assignment and return */ if (size == 1) { const unsigned char c = l->data[0]; output_prefix (); output ("*(cob_u8_ptr)("); output_data (x); -#if !defined (GEN_CHAR_AS_CHAR) /* old "simple" version */ - output (") = %u;", c); -#else /* "complex" one that we use everywhere else */ - if (!isprint (c)) { - output (") = '\\%03o';", c); - } else if (c == '\'' || c == '\\') { - output (") = '\\%c';", c); - } else { - output (") = '%c';", c); - } -#endif + output_char (") = ", c, ";"); output_newline (); return; } - /* check if the literal only consist of the same character... */ - buffchar = l->data[0]; - for (lsize = 0; lsize < l->size; lsize++) { - if (l->data[lsize] != buffchar) { - break; - } - } - if (lsize == l->size) { - /*... yes it does, so init by memset */ - const unsigned char c = buffchar; - if (lsize > size) { - lsize = size; - } - output_prefix (); - output ("memset ("); - output_data (x); -#if !defined (GEN_CHAR_AS_CHAR) /* old "simple" version */ - output (", %u", c); -#else /* "complex" one that we use everywhere else */ - if (!isprint (c)) { - output (", '\\%03o'", c); - } else if (c == '\'' || c == '\\') { - output (", '\\%c", c); - } else { - output (", '%c'", c); + /* if the literal is at least as long as the target, we can use + either a single memset or a single memcpy; check if the former + is possible because it only consists of the same character */ + if (l->size >= size) { + size_t first_pos = 0; + size_t last_pos = size; + /* we only care about the part that will be set in the target + so use the target's size; if right-justified then adjust */ + if (l->size > size + && f->flag_justified && cb_initial_justify) { + first_pos = l->size - size; + last_pos = l->size; + } + buffchar = l->data[first_pos]; + for (i = last_pos; i != first_pos; i--) { + if (l->data[i] != buffchar) { + break; + } } -#endif - output (", %u);", (unsigned int)lsize); - output_newline (); - /* REPORT lines are cleared to SPACES */ - if (f->storage == CB_STORAGE_REPORT) { - return; - } - if (lsize < size) { + if (i == first_pos) { + /*... yes it does, so init by memset */ output_prefix (); output ("memset ("); output_data (x); - output (" + %u, ' ', %u);", - (unsigned int)lsize, (unsigned int)(size - lsize)); + output_char (", ", buffchar, ", "); + output ("%u);", size); + output_newline (); + } else { + /* no single value, so init by memcpy */ + output_prefix (); + output ("memcpy ("); + output_data (x); + output (", "); + output_string (l->data + first_pos, size, l->llit); + output (", %d);", size); output_newline (); } return; } - if (size > litsize) { - litsize = size + 128; - if (litbuff) { - litbuff = cobc_main_realloc (litbuff, (size_t)litsize); + /* literal is smaller than target, so space-padding is needed */ + { + const unsigned int padlen = size - l->size; + const unsigned int padstart = + f->flag_justified && cb_initial_justify ? 0 : l->size; + const unsigned int litstart = + f->flag_justified && cb_initial_justify ? padlen : 0; +#if !defined (GEN_SINGLE_MEMCPY) + if (size < 128) { + /* for "common" small fields - generate a single memcpy + from a string - we use a local buffer to set that up */ + unsigned char litbuff[128]; + memcpy (litbuff + litstart, l->data, l->size); + memset (litbuff + padstart, ' ', padlen); + output_prefix (); + output ("memcpy ("); + output_data (x); + output (", "); + output_string (litbuff, size, l->llit); + output (", %d);", size); + output_newline (); } else { - litbuff = cobc_main_malloc ((size_t)litsize); + /* otherwise: memcpy for the data, memset for padding */ + output_prefix (); + output ("memcpy ("); + output_data (x); + if (litstart) { + output (" + %u", litstart); + } + output (", "); + output_string (l->data, l->size, l->llit); + output (", %d);", l->size); + output_newline (); + output_prefix (); + output ("memset ("); + output_data (x); + if (padstart) { + output (" + %u", padstart); + } + output (", ' ', %u);", padlen); + output_newline (); } - } - - if ((int)l->size >= (int)size) { - memcpy (litbuff, l->data, (size_t)size); - if (f->flag_justified && cb_initial_justify) { - memcpy (litbuff, l->data + (size_t)l->size - (size_t)size, (size_t)size); - } else { - memcpy (litbuff, l->data, (size_t)size); +#else /* GEN_SINGLE_MEMCPY follows */ + /* construct buffer with full content including space-padding, + allowing us to generate a single memcpy */ + if (size > litsize) { + litsize = size + 128; + if (litbuff) { + litbuff = cobc_main_realloc (litbuff, litsize); + } else { + litbuff = cobc_main_malloc (litsize); + } } - } else if (f->flag_justified && cb_initial_justify) { - memset (litbuff, ' ', (size_t)size - l->size); - memcpy (litbuff + l->size, l->data, (size_t)l->size); - } else { - memcpy (litbuff, l->data, (size_t)l->size); - memset (litbuff + l->size, ' ', (size_t)size - l->size); - } - buffchar = *(litbuff + size - 1); - n = 0; - for (i = size - 1; i >= 0; i--, n++) { - if (*(litbuff + i) != buffchar) { - break; - } - } - if (i < 0) { - const unsigned char c = buffchar; - output_prefix (); - output ("memset ("); - output_data (x); -#if !defined (GEN_CHAR_AS_CHAR) /* old "simple" version */ - output (", %u", c); -#else /* "complex" one that we use everywhere else */ - if (!isprint (c)) { - output (", '\\%03o'", c); - } else if (c == '\'' || c == '\\') { - output (", '\\%c", c); - } else { - output (", '%c'", c); - } -#endif - output (", %u);", (unsigned int)size); - output_newline (); - return; - } + memcpy (litbuff + litstart, l->data, l->size); + memset (litbuff + padstart, ' ', padlen); - if (n > 8) { - offset = size - n; - size -= n; - } else { - offset = 0; - } + buffchar = *(litbuff + size - 1); + n = 0; + for (i = size - 1; i >= 0; i--, n++) { + if (litbuff[i] != buffchar) { + break; + } + } - inci = 0; - for (; size > 509; size -= 509, inci += 509) { - output_prefix (); - output ("memcpy ("); - output_data (x); - if (!inci) { - output (", "); + if (n > 8) { + offset = size - n; + size -= n; } else { - output (" + %u, ", inci); + offset = 0; } - output_string (litbuff + inci, 509, l->llit); - output (", 509);"); - output_newline (); - } - output_prefix (); - output ("memcpy ("); - output_data (x); - if (!inci) { - output (", "); - } else { - output (" + %u, ", inci); - } - output_string (litbuff + inci, size, l->llit); - output (", %d);", size); - output_newline (); + /* undocumented optimization (?) or taking care + for some old compiler's limits (?); + note: if this is about readability / max line length, + then splitting only the output of litbuff to multiple + lines would be enough */ + { + cob_u32_t inci = 0; + for (; size > 509; size -= 509, inci += 509) { + output_prefix (); + output ("memcpy ("); + output_data (x); + if (!inci) { + output (", "); + } else { + output (" + %u, ", inci); + } + output_string (litbuff + inci, 509, l->llit); + output (", 509);"); + output_newline (); + } + output_prefix (); + output ("memcpy ("); + output_data (x); + if (!inci) { + output (", "); + } else { + output (" + %u, ", inci); + } + output_string (litbuff + inci, size, l->llit); + output (", %d);", size); + output_newline (); + } - if (offset - && n > 0) { - if (f->storage == CB_STORAGE_REPORT /* REPORT lines are cleared to SPACES */ - && buffchar == ' ') - return; - output_prefix (); - output ("memset ("); - output_data (x); - output (" + %d, %u, %d);", - offset, (unsigned int)buffchar, n); - output_newline (); + if (offset + && n > 0) { + if (f->storage == CB_STORAGE_REPORT /* REPORT lines are cleared to SPACES */ + && buffchar == ' ') { + return; + } + output_prefix (); + output ("memset ("); + output_data (x); + output (" + %d, %u, %d);", + offset, (unsigned int)buffchar, n); + output_newline (); + } +#endif /* GEN_SINGLE_MEMCPY */ } } @@ -14290,7 +14300,10 @@ output_function_prototypes (struct cb_program *prog) may use the same but not-default function */ if (strcmp (prog->extfh, extfh_value) != 0 && strcmp ("EXTFH", extfh_value) != 0) { - output_line ("COB_EXT_IMPORT int %s (unsigned char *opcode, FCD3 *fcd);", + /* note: we may not use COB_EXT_IMPORT here as that only works with + entry points in libraries, not with direct provided object files + which we at least expect in our testsuite */ + output_line ("extern int %s (unsigned char *opcode, FCD3 *fcd);", extfh_value); } } @@ -14311,7 +14324,10 @@ output_function_prototypes (struct cb_program *prog) /* prototype for general EXTFH function */ if (prog->file_list && prog->extfh && strcmp ("EXTFH", prog->extfh) != 0) { - output ("COB_EXT_IMPORT int %s (unsigned char *opcode, FCD3 *fcd);", prog->extfh); + /* note: we may not use COB_EXT_IMPORT here as that only works with + entry points in libraries, not with direct provided object files + which we at least expect in our testsuite */ + output ("extern int %s (unsigned char *opcode, FCD3 *fcd);", prog->extfh); output_newline (); } diff --git a/cobc/flag.def b/cobc/flag.def index d48a66a36..294e55ab7 100644 --- a/cobc/flag.def +++ b/cobc/flag.def @@ -40,23 +40,23 @@ /* Flags with required parameter */ -CB_FLAG_RQ (cb_stack_size, 0, "stack-size", 255, 1, +CB_FLAG_RQ (cb_stack_size, 0, "stack-size", 255, CB_FLAG_GETOPT_STACK_SIZE, _(" -fstack-size=<number>\tdefine PERFORM stack size\n" " * default: 255")) -CB_FLAG_RQ (cb_ebcdic_sign, 1, "sign", 0, 3, +CB_FLAG_RQ (cb_ebcdic_sign, 1, "sign", 0, CB_FLAG_GETOPT_SIGN, _(" -fsign=[ASCII|EBCDIC]\tdefine display sign representation\n" " * default: machine native")) -CB_FLAG_RQ (cb_fold_copy, 1, "fold-copy", 0, 4, +CB_FLAG_RQ (cb_fold_copy, 1, "fold-copy", 0, CB_FLAG_GETOPT_FOLD_COPY, _(" -ffold-copy=[UPPER|LOWER]\tfold COPY subject to value\n" " * default: no transformation")) -CB_FLAG_RQ (cb_fold_call, 1, "fold-call", 0, 5, +CB_FLAG_RQ (cb_fold_call, 1, "fold-call", 0, CB_FLAG_GETOPT_FOLD_CALL, _(" -ffold-call=[UPPER|LOWER]\tfold PROGRAM-ID, CALL, CANCEL subject to value\n" " * default: no transformation")) -CB_FLAG_RQ (cb_max_errors, 1, "max-errors", 128, 7, +CB_FLAG_RQ (cb_max_errors, 1, "max-errors", 128, CB_FLAG_GETOPT_MAX_ERRORS, _(" -fmax-errors=<number>\tmaximum number of errors to report before\n" " compilation is aborted\n" " * default: 128\n" @@ -64,38 +64,38 @@ CB_FLAG_RQ (cb_max_errors, 1, "max-errors", 128, 7, /* Flags with required parameter and no associated variable */ -CB_FLAG_NQ (1, "intrinsics", 10, /* added to cb_intrinsic_list */ +CB_FLAG_NQ (1, "intrinsics", CB_FLAG_GETOPT_INTRINSICS, /* added to cb_intrinsic_list */ _(" -fintrinsics=[ALL|intrinsic function name(,name,...)]\n" " intrinsics to be used without FUNCTION keyword")) -CB_FLAG_NQ (1, "dump", 8, +/* note: suppressed help and no translation here to have it local to --debug + FIXME: find a better way to handle that */ +CB_FLAG_NQ (0, "ec", CB_FLAG_GETOPT_EC, + " -fec=<exception-name>\tenable code generation for <exception-name>,\n" + " sets -fsource-location") +CB_FLAG_NQ (0, "no-ec", CB_FLAG_GETOPT_NO_EC, + " -fno-ec=<exception-name>\tdisable code generation for <exception-name>") + +CB_FLAG_NQ (1, "dump", CB_FLAG_GETOPT_DUMP, _(" -fdump=<scope> dump data fields on abort, <scope> may be\n" " a combination of: ALL, WS, LS, RD, FD, SC, LO")) -CB_FLAG_OP (0, "no-dump", 13, +CB_FLAG_OP (0, "no-dump", CB_FLAG_GETOPT_NO_DUMP, _(" -fno-dump=<scope> exclude data fields from dumping on abort, <scope> may\n" " be a combination of: ALL, WS, LS, RD, FD, SC, LO")) -CB_FLAG_NQ (1, "callfh", 9, +CB_FLAG_NQ (1, "callfh", CB_FLAG_GETOPT_CALLFH, _(" -fcallfh=<name> specifies <name> to be used for I/O\n" " as external provided EXTFH interface module")) -CB_FLAG_NQ (1, "sqlschema", 11, /* stored in cb_sqldb_schema */ +CB_FLAG_NQ (1, "sqlschema", CB_FLAG_GETOPT_SQLSCHEMA, /* stored in cb_sqldb_schema */ _(" -fsqlschema=<name> define database schema name")) -/* note: suppressed help and no translation here to have it local to --debug - FIXME: find a better way to handle that */ -CB_FLAG_NQ (0, "ec", 14, - " -fec=<exception-name>\tenable code generation for <exception-name>,\n" - " sets -fsource-location") -CB_FLAG_NQ (0, "no-ec", 17, - " -fno-ec=<exception-name>\tdisable code generation for <exception-name>") - -CB_FLAG_NQ (1, "ebcdic-table", 16, +CB_FLAG_NQ (1, "ebcdic-table", CB_FLAG_GETOPT_EBCDIC_TABLE, _(" -febcdic-table=<cconv-table>/<file>\tEBCDIC/ASCII translation table\n" " * e.g. default, ebcdic500_latin1...")) -CB_FLAG_NQ (1, "default-colseq", 15, +CB_FLAG_NQ (1, "default-colseq", CB_FLAG_GETOPT_DEFAULT_COLSEQ, _(" -fdefault-colseq=[ASCII|EBCDIC|NATIVE]\tdefine default collating sequence\n" " * default: NATIVE")) @@ -229,13 +229,13 @@ CB_FLAG (cb_flag_c_labels, 1, "gen-c-labels", CB_FLAG (cb_mf_files, 1, "mf-files", _(" -fmf-files Sequential & Relative files will match Micro Focus format")) -CB_FLAG_RQ (cb_file_format, 1, "file-format", 0, 12, +CB_FLAG_RQ (cb_file_format, 1, "file-format", 0, CB_FLAG_GETOPT_FILE_FORMAT, _(" -ffile-format=[MF|GC]\tdefine default format for Sequential/Relative files\n" " * default: GC")) CB_FLAG_ON (cb_listing_with_header, 1, "theaders", - _(" -fno-theaders suppress all headers and output of compilation\n" - " options from listing while keeping page breaks")) + _(" -fno-theaders suppress all headers from listing while keeping\n" + " page breaks")) CB_FLAG_ON (cb_listing_with_source, 1, "tsource", _(" -fno-tsource suppress source from listing")) @@ -252,6 +252,13 @@ CB_FLAG (cb_listing_cmd, 1, "tcmd", CB_FLAG (cb_list_datamap, 1, "datamap", _(" -fdatamap specify symbols DATA MAP in listing")) +CB_FLAG_ON (cb_listing_with_timestamp, 1, "ttimestamp", + _(" -fno-ttimestamp suppress timestamp in listing headers")) + +CB_FLAG_NQ (1, "ttitle", CB_FLAG_GETOPT_TTITLE, + _(" -fttitle=<title> set listing title with '_' replaced by spaces;\n" + " defaults to package name and version")) + CB_FLAG_ON (cb_diagnostics_show_option, 1, "diagnostics-show-option", _(" -fno-diagnostics-show-option\tsuppress output of option that directly\n" " controls the diagnostic")) diff --git a/cobc/parser.y b/cobc/parser.y index 833916a9d..e69000e86 100644 --- a/cobc/parser.y +++ b/cobc/parser.y @@ -11932,7 +11932,9 @@ at_line_column: if (!line_column) { line_column = CB_BUILD_PAIR ($2, cb_int0); - } else { + } else if (CB_PAIR_P (line_column)) { + /* note: if line_column is set but no pair, we already + raised a conflict error as AT pos was used before */ CB_PAIR_X (line_column) = $2; } } @@ -11948,7 +11950,9 @@ at_line_column: if (!line_column) { line_column = CB_BUILD_PAIR (cb_int0, $2); - } else { + } else if (CB_PAIR_P (line_column)) { + /* note: if line_column is set but no pair, we already + raised a conflict error as AT pos was used before */ CB_PAIR_Y (line_column) = $2; } } diff --git a/cobc/pplex.l b/cobc/pplex.l index c8f0bc4c8..c345f1912 100644 --- a/cobc/pplex.l +++ b/cobc/pplex.l @@ -148,7 +148,6 @@ static unsigned int plex_nest_depth = 0; static int quotation_mark = 0; static int listing_line = 0; static int requires_listing_line; -static int requires_new_line = 0; static enum cb_format source_format = CB_FORMAT_AUTO; static int indicator_column = 7; static int text_column = 72; /* end of area B (in single-byte @@ -1092,7 +1091,6 @@ ENDIF_DIRECTIVE_STATE>{ cobc_free (current_copy_info); listing_line = 0; requires_listing_line = 1; - requires_new_line = 0; need_continuation = 0; buffer_overflow = 0; within_comment = 0; @@ -2921,19 +2919,20 @@ check_listing (const char *text, const unsigned int comment) } if (requires_listing_line) { - if (requires_new_line) { - requires_new_line = 0; - putc ('\n', cb_listing_file); - } fprintf (cb_listing_file, "%6d%c", ++listing_line, c); } if (requires_listing_line - && source_format != CB_FORMAT_FREE - && strlen (text) >= (size_t)indicator_column) { - s = &text[indicator_column - 1]; + && source_format != CB_FORMAT_FREE) { + if (strlen (text) >= (size_t)indicator_column) { + s = text + indicator_column - 1; + } else if (strchr (text, '\n')) { + s = "\n"; /* no sequence area, but line break */ + } else { + s = ""; /* do not output sequence area */ + } } else { - s = ""; /* do not output sequence area */ + s = text; } fputs (s, cb_listing_file); if (strchr (text, '\n')) { diff --git a/cobc/scanner.l b/cobc/scanner.l index 5d50debfd..517a9fa3e 100644 --- a/cobc/scanner.l +++ b/cobc/scanner.l @@ -400,6 +400,16 @@ AREA_A "#AREA_A"\n } "FUNCTION" { + if (!lookup_reserved_word ("FUNCTION")) { + /* FIXME: FUNCTION is always reserved, even when explicit + disabled via -fnot-reserved=FUNCTION ?!? */ + yylval = cb_build_reference (yytext); + if (cobc_in_area_a) { + RETURN_TOK (WORD_IN_AREA_A); + } else { + RETURN_TOK (WORD); + } + } if (cobc_in_repository || cobc_cs_check == CB_CS_EXIT) { yylval = NULL; RETURN_TOK (FUNCTION); @@ -824,14 +834,15 @@ H#[0-9A-Za-z]+ { } "NOT"[ ,;\n]+("AT"[ ,;\n]+)?("END-OF-PAGE"|"EOP")/[ .,;\n] { - /* TODO: if those words are not reserved -> directly return */ + /* Note: plain END-OF-PAGE / EOP is directly matched via registered words */ + /* TODO: if END-OF-PAGE/EOP are not reserved -> directly return */ count_lines (yytext); RETURN_TOK (NOT_EOP); } "AT"[ ,;\n]+("END-OF-PAGE"|"EOP")/[ .,;\n] { /* Note: plain END-OF-PAGE / EOP is directly matched via registered words */ - /* TODO: if those words are not reserved -> directly return */ + /* TODO: if END-OF-PAGE/EOP are not reserved -> directly return */ count_lines (yytext); RETURN_TOK (EOP); } @@ -899,6 +910,7 @@ H#[0-9A-Za-z]+ { "SUPPRESS"/[ .,;\n] { count_lines (yytext); if (!lookup_reserved_word ("SUPPRESS")) { + yylval = cb_build_reference (yytext); RETURN_TOK (WORD); } if (cobc_in_xml_generate_body || cobc_in_json_generate_body) { @@ -917,9 +929,10 @@ H#[0-9A-Za-z]+ { } "SEND"/[ .,;\n] { - /* FIXME: seems to wok fine with SUPPRESS, but not here ... */ + /* FIXME: seems to work fine with SUPPRESS, but not here ... */ count_lines (yytext); if (!lookup_reserved_word ("SEND")) { + yylval = cb_build_reference (yytext); RETURN_TOK (WORD); } #if 0 @@ -1310,15 +1323,17 @@ H#[0-9A-Za-z]+ { } <FUNCTION_STATE>{ - [A-Z0-9-]+ { + [A-Z][A-Z0-9-]* { struct cb_intrinsic_table *cbp; cb_tree l; - cb_tree x; BEGIN INITIAL; + + /* TODO: check for cb_word_length, if too long, + then only handle up to max and error */ yylval = cb_build_reference (yytext); for (l = current_program->user_spec_list; l; l = CB_CHAIN(l)) { - x = CB_VALUE (l); + cb_tree x = CB_VALUE (l); if (!strcasecmp (yytext, CB_PROTOTYPE (x)->name)) { RETURN_TOK (USER_FUNCTION_NAME); } @@ -1331,7 +1346,7 @@ H#[0-9A-Za-z]+ { } . { yylval = NULL; - RETURN_TOK (yytext[0]); + RETURN_TOK (yytext[0]); /* is that correct? */ } } diff --git a/config/mvs-strict.conf b/config/mvs-strict.conf index 5292efa6c..eae2210f9 100644 --- a/config/mvs-strict.conf +++ b/config/mvs-strict.conf @@ -1,6 +1,6 @@ # GnuCOBOL compiler configuration # -# Copyright (C) 2001-2012, 2014-2022 Free Software Foundation, Inc. +# Copyright (C) 2001-2012, 2014-2023 Free Software Foundation, Inc. # Written by Keisuke Nishida, Roger While, Simon Sobisch, Edward Hart, # Ron Norman # @@ -21,7 +21,7 @@ # Value: any string -name: "MVS/VM COBOL" +name: "IBM COBOL for MVS & VM" # Value: enum (see default.conf and cobc/cobc.h for details) standard-define 3 diff --git a/config/mvs.words b/config/mvs.words index 2f5de9cb2..a9a9485fb 100644 --- a/config/mvs.words +++ b/config/mvs.words @@ -19,7 +19,7 @@ # along with GnuCOBOL. If not, see <https://www.gnu.org/licenses/>. -# Word list for dialect: MVS/VM COBOL +# Word list for dialect: IBM COBOL for MVS & VM # Note: only used for strict dialect and when # requested by compiler directive >> IMP WORDS MVS diff --git a/tests/ChangeLog b/tests/ChangeLog index 08514e441..190b55288 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -6,9 +6,15 @@ under MSVC Release, by forcing a flush of stdout with fflush and using cob_free instead of free in C codes +2023-07-04 Fabrice Le Fessant <fabrice.le_fessant@ocamlpro.com> + + * atlocal.in: add variables LISTING_FLAGS, COMPILE_LISTING and + COMPILE_LISTING0 to use new flags -fno-ttimestamp and -fttitle + to remove the need for UNIFY_LISTING in listings.at + 2023-04-05 Simon Sobisch <simonsobisch@gnu.org> - * atlocal.in: to allow running some test parts thousands of time for + * atlocal.in: to allow running some test parts thousands of time for performance checks without burning energy on every build, add define "CHECK-PERF" of one of PERFSUFFIX or CGSUFFIX are set, or if --enable-debug was specified during configure diff --git a/tests/atlocal.in b/tests/atlocal.in index f0c704519..0ba615cf7 100644 --- a/tests/atlocal.in +++ b/tests/atlocal.in @@ -68,15 +68,17 @@ if test "x$PERFSUFFIX" != "x" -o "x$CGSUFFIX" != "x" -o "@COB_ENABLE_DEBUG@" == COBOL_FLAGS="-DCHECK-PERF ${COBOL_FLAGS}" fi +FLAGS="-debug -Wall ${COBOL_FLAGS} -fdiagnostics-plain-output" # workaround to adjust the testsuite later: -# FLAGS="-debug -Wall ${COBOL_FLAGS}" -COBC="${COBC} -std=default" -FLAGS="-debug -Wall ${COBOL_FLAGS} -fno-diagnostics-show-option" +FLAGS="${FLAGS} -fno-diagnostics-show-option" -COBC="${COBC} -fdiagnostics-plain-output" +COBC="${COBC} -std=default -fdiagnostics-plain-output" COMPILE="${COBC} -x ${FLAGS}" COMPILE_ONLY="${COBC} -fsyntax-only ${FLAGS} -Wno-unsupported" COMPILE_MODULE="${COBC} -m ${FLAGS}" +LISTING_FLAGS="-fttitle=GnuCOBOL_V.R.P -fno-ttimestamp" +COMPILE_LISTING="${COMPILE_ONLY} ${LISTING_FLAGS}" +COMPILE_LISTING0="${COMPILE_LISTING} -tlines=0" # get performance counters for compiler and/or runtime if test "x$PERFSUFFIX" != "x"; then diff --git a/tests/atlocal_win b/tests/atlocal_win index ce010c61f..ff30656b1 100644 --- a/tests/atlocal_win +++ b/tests/atlocal_win @@ -47,13 +47,17 @@ LC_ALL=C export LC_ALL unset LANG +FLAGS="-debug -Wall ${COBOL_FLAGS} -fdiagnostics-plain-output" # workaround to adjust the testsuite later: -# FLAGS="-debug -Wall ${COBOL_FLAGS}" +FLAGS="${FLAGS} -fno-diagnostics-show-option" + COBC="${COBC} -std=default -fdiagnostics-plain-output" -FLAGS="-debug -Wall ${COBOL_FLAGS} -fno-diagnostics-show-option" COMPILE="${COBC} -x ${FLAGS}" COMPILE_ONLY="${COBC} -fsyntax-only ${FLAGS} -Wno-unsupported" COMPILE_MODULE="${COBC} -m ${FLAGS}" +LISTING_FLAGS="-fttitle=GnuCOBOL_V.R.P -fno-ttimestamp" +COMPILE_LISTING="${COMPILE_ONLY} ${LISTING_FLAGS}" +COMPILE_LISTING0="${COMPILE_LISTING} -tlines=0" # test runner for manual tests, content may be adjusted by the user RUN_PROG_MANUAL="${abs_builddir}/run_prog_manual.sh" diff --git a/tests/testsuite.src/configuration.at b/tests/testsuite.src/configuration.at index 462ca5d63..4e1ad8fc7 100644 --- a/tests/testsuite.src/configuration.at +++ b/tests/testsuite.src/configuration.at @@ -85,7 +85,7 @@ AT_CHECK([$COMPILE_ONLY -std=rm-strict prog.cob], [0], [], ]) AT_CHECK([$COMPILE_ONLY -std=realia-strict prog.cob], [0], [], []) AT_CHECK([$COMPILE_ONLY -std=mvs-strict prog.cob], [0], [], -[prog.cob:4: warning: AUTHOR is obsolete in MVS/VM COBOL +[prog.cob:4: warning: AUTHOR is obsolete in IBM COBOL for MVS & VM ]) AT_CHECK([$COMPILE_ONLY -std=gcos-strict prog.cob], [0], [], [prog.cob:4: warning: AUTHOR is obsolete in GCOS diff --git a/tests/testsuite.src/listings.at b/tests/testsuite.src/listings.at index 58e6cae49..80f24ef4e 100644 --- a/tests/testsuite.src/listings.at +++ b/tests/testsuite.src/listings.at @@ -84,8 +84,6 @@ AT_CLEANUP AT_SETUP([COPY within comment]) AT_KEYWORDS([listing]) -AT_CAPTURE_FILE([prog.lst]) - AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. @@ -96,10 +94,10 @@ AT_DATA([prog.cob], [ STOP RUN. ]) -AT_CHECK([$COMPILE_ONLY -t prog.lst -tlines=0 prog.cob], [0], [], []) +AT_CHECK([$COMPILE_LISTING0 -t prog.lst prog.cob], [0], [], []) -AT_DATA([prog1.lst], -[GnuCOBOL V.R.P prog.cob DDD MMM dd HH:MM:SS YYYY +AT_DATA([expected.lst], +[GnuCOBOL V.R.P prog.cob LINE PG/LN A...B............................................................ @@ -117,7 +115,7 @@ LINE PG/LN A...B............................................................ 0 errors in compilation group ]) -AT_CHECK([gcdiff prog1.lst prog.lst], [0], [], []) +AT_CHECK([diff expected.lst prog.lst], [0], [], []) AT_DATA([prog2.cob], [ IDENTIFICATION DIVISION. @@ -129,10 +127,8 @@ AT_DATA([prog2.cob], [ STOP RUN. ]) -AT_CHECK([$COMPILE_ONLY -t prog.lst -tlines=0 -free prog2.cob], [0], [], []) - -AT_DATA([prog2.lst], -[GnuCOBOL V.R.P prog2.cob DDD MMM dd HH:MM:SS YYYY +AT_CHECK([$COMPILE_LISTING0 -t- -free prog2.cob], [0], +[GnuCOBOL V.R.P prog2.cob LINE .....................SOURCE............................................. @@ -148,9 +144,7 @@ LINE .....................SOURCE............................................. 0 warnings in compilation group 0 errors in compilation group -]) - -AT_CHECK([gcdiff prog2.lst prog.lst], [0], [], []) +], []) AT_CLEANUP @@ -158,8 +152,6 @@ AT_CLEANUP AT_SETUP([Replacement w/o strings]) AT_KEYWORDS([listing symbols]) -AT_CAPTURE_FILE([prog.lst]) - AT_DATA([prog.cob], [ REPLACE =="SOME"== BY =="MANY"== =='SOME'== BY =="VERY MUCH"== @@ -177,10 +169,8 @@ AT_DATA([prog.cob], [ STOP RUN. ]) -AT_CHECK([$COMPILE_ONLY -t prog.lst -tlines=0 -ftsymbols prog.cob], [0], [], []) - -AT_DATA([expected.lst], -[GnuCOBOL V.R.P prog.cob DDD MMM dd HH:MM:SS YYYY +AT_CHECK([$COMPILE_LISTING0 -t- -ftsymbols prog.cob], [0], +[GnuCOBOL V.R.P prog.cob LINE PG/LN A...B............................................................ @@ -210,9 +200,7 @@ SIZE TYPE LVL NAME PICTURE 0 warnings in compilation group 0 errors in compilation group -]) - -AT_CHECK([gcdiff expected.lst prog.lst], [0], [], []) +], []) AT_CLEANUP @@ -220,8 +208,6 @@ AT_CLEANUP AT_SETUP([Partial replacement with literals]) AT_KEYWORDS([listing gcos]) -AT_CAPTURE_FILE([prog.lst]) - AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. @@ -246,10 +232,8 @@ AT_DATA([prog.cob], [ STOP RUN. ]) -AT_CHECK([$COMPILE_ONLY -fpartial-replace-when-literal-src=skip -t prog.lst -tlines=0 prog.cob], [0], [], []) - -AT_DATA([expected.lst], -[GnuCOBOL V.R.P prog.cob DDD MMM dd HH:MM:SS YYYY +AT_CHECK([$COMPILE_LISTING0 -fpartial-replace-when-literal-src=skip -t- prog.cob], [0], +[GnuCOBOL V.R.P prog.cob LINE PG/LN A...B............................................................ @@ -279,11 +263,7 @@ LINE PG/LN A...B............................................................ 0 warnings in compilation group 0 errors in compilation group -]) - -#AT_CHECK([$UNIFY_LISTING prog.lst prog.lis once], [0], [], []) -#AT_CHECK([diff expected.lst prog.lis], [0], [], []) -AT_CHECK([gcdiff -IGnuCOBOL expected.lst prog.lst], [0], [], []) +], []) AT_CLEANUP @@ -291,13 +271,11 @@ AT_CLEANUP AT_SETUP([COPY replacement with partial match]) AT_KEYWORDS([listing copy]) -AT_XFAIL_IF([true]) AT_DATA([copy.inc], [ 02 TEST-VAR PIC X(2) VALUE "OK". 02 TEST-CC PIC X(4) VALUE "OK 2". ]) - AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. @@ -310,18 +288,38 @@ AT_DATA([prog.cob], [ DISPLAY TEST-AVR. STOP RUN. ]) -AT_CHECK([$COMPILE_ONLY -t prog.lst -tlines=0 prog.cob], [0], [], []) -#AT_CHECK([$UNIFY_LISTING prog.lst prog.lis once], [0], [], []) -#AT_CHECK([diff expected.lst prog.lis], [0], [], []) -AT_CHECK([gcdiff -IGnuCOBOL expected.lst prog.lst], [0], [], []) -# TODO: check listing + +AT_CHECK([$COMPILE_LISTING0 -t- prog.cob], [0], +[GnuCOBOL V.R.P prog.cob + +LINE PG/LN A...B............................................................ + +000001 +000002 IDENTIFICATION DIVISION. +000003 PROGRAM-ID. prog. +000004 DATA DIVISION. +000005 WORKING-STORAGE SECTION. +000006 01 GET-VALUE. +000007 COPY "copy.inc" REPLACING ==TEST-VAR== BY ==TEST-AVR== +000008 == 02 TEST-EE == BY == 02 TEST-FF ==. +000001C +000002C 02 TEST-AVR PIC X(2) VALUE "OK". +000003C 02 TEST-CC PIC X(4) VALUE "OK 2". +000009 PROCEDURE DIVISION. +000010 DISPLAY TEST-AVR. +000011 STOP RUN. + + +0 warnings in compilation group +0 errors in compilation group +], +[]) AT_CLEANUP AT_SETUP([COPY replacement with multiple partial matches]) AT_KEYWORDS([listing copy]) -AT_XFAIL_IF([true]) AT_DATA([copy.inc], [ 02 TEST-VAR PIC X(2) VALUE "OK". @@ -330,7 +328,6 @@ AT_DATA([copy.inc], [ 02 TEST-OK PIC X(4) VALUE "OK 3". 02 TEST-EE PIC X(4) VALUE "OK 4". ]) - AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. @@ -352,12 +349,42 @@ AT_DATA([prog.cob], [ STOP RUN. ]) -AT_CHECK([$COMPILE_ONLY -t prog.lst -tlines=0 prog.cob], [0], [], []) -#AT_CHECK([$UNIFY_LISTING prog.lst prog.lis once], [0], [], []) -#AT_CHECK([diff expected.lst prog.lis], [0], [], []) -AT_CHECK([gcdiff -IGnuCOBOL expected.lst prog.lst], [0], [], []) -# TODO: check listing +AT_CHECK([$COMPILE_LISTING0 -t- prog.cob], [0], +[GnuCOBOL V.R.P prog.cob + +LINE PG/LN A...B............................................................ + +000001 +000002 IDENTIFICATION DIVISION. +000003 PROGRAM-ID. prog. +000004 DATA DIVISION. +000005 WORKING-STORAGE SECTION. +000006 01 GET-VALUE. +000007 COPY "copy.inc" REPLACING +000008 LEADING ==TEST-VAR== BY ==TEST-AVR== +000009 == 02 TEST-OK == BY == 02 TEST-KO == +000010 ==TEST-CC== BY ==TEST-DD== +000011 == 02 TEST-EE == BY == 02 TEST-FF == +000012 == PIC == BY == pic ==. +000001C +000002C 02 TEST-AVR pic X(2) VALUE "OK". +000003C 02 TEST-AVR-BIS pic X(6) VALUE "OK BIS". +000004C 02 TEST-DD pic X(4) VALUE "OK 2". +000005C 02 TEST-KO pic X(4) VALUE "OK 3". +000006C 02 TEST-FF pic X(4) VALUE "OK 4". +000013 PROCEDURE DIVISION. +000014 DISPLAY TEST-AVR. +000015 DISPLAY TEST-AVR-BIS. +000016 DISPLAY TEST-KO. +000017 DISPLAY TEST-DD. +000018 DISPLAY TEST-FF. +000019 STOP RUN. + +0 warnings in compilation group +0 errors in compilation group +], +[]) AT_DATA([copy2.inc], [ 02 TEST-VAR PIC X(2) VALUE "OK". 02 TEST-VAR-BIS PIC X(6) VALUE "OK BIS". @@ -365,7 +392,6 @@ AT_DATA([copy2.inc], [ 02 TEST-OK PIC X(4) VALUE "OK 3". 02 TEST-EE PIC X(4) VALUE "OK 4". ]) - AT_DATA([prog2.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog2. @@ -387,12 +413,42 @@ AT_DATA([prog2.cob], [ STOP RUN. ]) -AT_CHECK([$COMPILE_ONLY -t prog2.lst -tlines=0 prog2.cob], [0], [], []) -#AT_CHECK([$UNIFY_LISTING prog2.lst prog2.lis once], [0], [], []) -#AT_CHECK([diff expected2.lst prog2.lis], [0], [], []) -AT_CHECK([gcdiff -IGnuCOBOL expected.lst prog2.lst], [0], [], []) -# TODO: check listing +AT_CHECK([$COMPILE_LISTING0 -t- prog2.cob], [0], +[GnuCOBOL V.R.P prog2.cob + +LINE PG/LN A...B............................................................ + +000001 +000002 IDENTIFICATION DIVISION. +000003 PROGRAM-ID. prog2. +000004 DATA DIVISION. +000005 WORKING-STORAGE SECTION. +000006 01 GET-VALUE. +000007 COPY "copy2.inc" +000008 REPLACING LEADING ==TEST-VAR== BY ==TEST-AVR== +000009 == 02 TEST-OK == BY == 02 TEST-KO == +000010 == TEST-CC == BY == TEST-DD == +000011 == 02 TEST-EE == BY == 02 TEST-FF == +000012 == PIC == BY == pic ==. +000001C +000002C 02 TEST-AVR pic X(2) VALUE "OK". +000003C 02 TEST-AVR-BIS pic X(6) VALUE "OK BIS". +000004C 02 TEST-DD pic X(4) VALUE "OK 2". +000005C 02 TEST-KO pic X(4) VALUE "OK 3". +000006C 02 TEST-FF pic X(4) VALUE "OK 4". +000013 PROCEDURE DIVISION. +000014 DISPLAY TEST-AVR. +000015 DISPLAY TEST-AVR-BIS. +000016 DISPLAY TEST-KO. +000017 DISPLAY TEST-DD. +000018 DISPLAY TEST-FF. +000019 STOP RUN. + +0 warnings in compilation group +0 errors in compilation group +], +[]) AT_DATA([copy3.inc], [ 02 TEST-VAR PIC X(2) VALUE "OK". 02 TEST-VAR-BIS PIC X(6) VALUE "OK BIS". @@ -400,7 +456,6 @@ AT_DATA([copy3.inc], [ 02 TEST-OK PIC X(4) VALUE "OK 3". 02 TEST-EE PIC X(4) VALUE "OK 4". ]) - AT_DATA([prog3.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog3. @@ -422,11 +477,42 @@ AT_DATA([prog3.cob], [ STOP RUN. ]) -AT_CHECK([$COMPILE_ONLY -t prog3.lst -tlines=0 prog3.cob], [0], [], []) -#AT_CHECK([$UNIFY_LISTING prog3.lst prog3.lis once], [0], [], []) -#AT_CHECK([diff expected3.lst prog3.lis], [0], [], []) -AT_CHECK([gcdiff -IGnuCOBOL expected.lst prog3.lst], [0], [], []) -# TODO: check listing +AT_CHECK([$COMPILE_LISTING0 -t- prog3.cob], [0], +[GnuCOBOL V.R.P prog3.cob + +LINE PG/LN A...B............................................................ + +000001 +000002 IDENTIFICATION DIVISION. +000003 PROGRAM-ID. prog3. +000004 DATA DIVISION. +000005 WORKING-STORAGE SECTION. +000006 01 GET-VALUE. +000007 COPY "copy3.inc" +000008 REPLACING LEADING ==TEST-VAR== BY ==TEST-AVR== +000009 == 02 TEST-OK == BY == 02 TEST-KO == +000010 ==TEST-CC== BY ==TEST-DD== +000011 == 02 TEST-EE == BY == 02 TEST-FF == +000012 == PIC == BY == pic ==. +000001C +000002C 02 TEST-AVR pic X(2) VALUE "OK". +000003C 02 TEST-AVR-BIS pic X(6) VALUE "OK BIS". +000004C 02 TEST-DD pic X(4) VALUE "OK 2". +000005C 02 TEST-KO pic X(4) VALUE "OK 3". +000006C 02 TEST-FF pic X(4) VALUE "OK 4". +000013 PROCEDURE DIVISION. +000014 DISPLAY TEST-AVR. +000015 DISPLAY TEST-AVR-BIS. +000016 DISPLAY TEST-KO. +000017 DISPLAY TEST-DD. +000018 DISPLAY TEST-FF. +000019 STOP RUN. + + +0 warnings in compilation group +0 errors in compilation group +], +[]) AT_CLEANUP @@ -434,8 +520,6 @@ AT_CLEANUP AT_SETUP([COPY replacement order]) AT_KEYWORDS([listing symbols]) -AT_CAPTURE_FILE([prog.lst]) - AT_DATA([copy.inc], [ 01 TEST-VAR PIC X(2) VALUE "OK". ]) @@ -454,10 +538,8 @@ AT_DATA([prog.cob], [ STOP RUN. ]) -AT_CHECK([$COMPILE_ONLY -t prog.lst -tlines=0 -ftsymbols prog.cob], [0], [], []) - -AT_DATA([prog3.lst], -[GnuCOBOL V.R.P prog.cob DDD MMM dd HH:MM:SS YYYY +AT_CHECK([$COMPILE_LISTING0 -t- -ftsymbols prog.cob], [0], +[GnuCOBOL V.R.P prog.cob LINE PG/LN A...B............................................................ @@ -485,15 +567,11 @@ SIZE TYPE LVL NAME PICTURE 0 warnings in compilation group 0 errors in compilation group -]) - -AT_CHECK([gcdiff prog3.lst prog.lst], [0], [], []) +], []) AT_CHECK([$COBC $FLAGS -E -o prog.i prog.cob], [0], [], []) -AT_CHECK([$COMPILE_ONLY -t prog.lst -tlines=0 -ftsymbols prog.i], [0], [], []) - -AT_DATA([prog4.lst], -[GnuCOBOL V.R.P prog.i DDD MMM dd HH:MM:SS YYYY +AT_CHECK([$COMPILE_LISTING0 -t- -ftsymbols prog.i], [0], +[GnuCOBOL V.R.P prog.i LINE PG/LN A...B............................................................ @@ -525,9 +603,7 @@ SIZE TYPE LVL NAME PICTURE 0 warnings in compilation group 0 errors in compilation group -]) - -AT_CHECK([gcdiff prog4.lst prog.lst], [0], [], []) +], []) AT_CLEANUP @@ -535,8 +611,6 @@ AT_CLEANUP AT_SETUP([COPY separators]) AT_KEYWORDS([listing symbols]) -AT_CAPTURE_FILE([prog.lst]) - AT_DATA([copy.inc], [ 01 TEST-VAR PIC X(2) VALUE "OK". COPY001 ]) @@ -557,10 +631,8 @@ AT_DATA([prog.cob], [ STOP RUN. PROG013 ]) -AT_CHECK([$COMPILE_ONLY -t prog.lst -tlines=0 -ftsymbols prog.cob], [0], [], []) - -AT_DATA([prog4.lst], -[GnuCOBOL V.R.P prog.cob DDD MMM dd HH:MM:SS YYYY +AT_CHECK([$COMPILE_LISTING0 -t- -ftsymbols prog.cob], [0], +[GnuCOBOL V.R.P prog.cob LINE PG/LN A...B............................................................ @@ -592,16 +664,12 @@ SIZE TYPE LVL NAME PICTURE 0 errors in compilation group ]) -AT_CHECK([gcdiff prog4.lst prog.lst], [0], [], []) - AT_CLEANUP AT_SETUP([COPY partial replacement]) AT_KEYWORDS([listing symbols]) -AT_CAPTURE_FILE([prog.lst]) - AT_DATA([copy.inc], [ 01 :TEST:-VAR PIC X(2) VALUE "OK". 01 (TEST)-VAR PIC X(2) VALUE "OK". @@ -623,10 +691,8 @@ AT_DATA([prog.cob], [ STOP RUN. ]) -AT_CHECK([$COMPILE_ONLY -t prog.lst -tlines=0 -ftsymbols prog.cob], [0], [], []) - -AT_DATA([prog5.lst], -[GnuCOBOL V.R.P prog.cob DDD MMM dd HH:MM:SS YYYY +AT_CHECK([$COMPILE_LISTING0 -t- -ftsymbols prog.cob], [0], +[GnuCOBOL V.R.P prog.cob LINE PG/LN A...B............................................................ @@ -661,10 +727,6 @@ SIZE TYPE LVL NAME PICTURE 0 errors in compilation group ]) -AT_CHECK([gcdiff prog5.lst prog.lst], [0], [], []) - -AT_CAPTURE_FILE([prog1.lst]) - AT_DATA([copy1.inc], [ 01 'yyy-'struktur. 05 'yyy-'hello pic x(30) value 'yyy copy1.inc'. @@ -712,10 +774,8 @@ AT_DATA([prog1.cob], [ end program copytest. ]) -AT_CHECK([$COMPILE_ONLY -t prog1.lst -tlines=0 -ftsymbols prog1.cob], [0], [], []) - -AT_DATA([prog6.lst], -[GnuCOBOL V.R.P prog1.cob DDD MMM dd HH:MM:SS YYYY +AT_CHECK([$COMPILE_LISTING0 -t- -ftsymbols prog1.cob], [0], +[GnuCOBOL V.R.P prog1.cob LINE PG/LN A...B............................................................ @@ -806,16 +866,12 @@ SIZE TYPE LVL NAME PICTURE 0 errors in compilation group ]) -AT_CHECK([gcdiff prog6.lst prog1.lst], [0], [], []) - AT_CLEANUP AT_SETUP([COPY LEADING replacement]) AT_KEYWORDS([listing symbols]) -AT_CAPTURE_FILE([prog.lst]) - AT_DATA([copy.inc], [ 01 TEST-VAR PIC X(2) VALUE "OK". 01 NORM-VAR PIC X(2) VALUE "OK". @@ -837,10 +893,8 @@ AT_DATA([prog.cob], [ STOP RUN. ]) -AT_CHECK([$COMPILE_ONLY -t prog.lst -tlines=0 -ftsymbols prog.cob], [0], [], []) - -AT_DATA([progl.lst], -[GnuCOBOL V.R.P prog.cob DDD MMM dd HH:MM:SS YYYY +AT_CHECK([$COMPILE_LISTING0 -t- -ftsymbols prog.cob], [0], +[GnuCOBOL V.R.P prog.cob LINE PG/LN A...B............................................................ @@ -875,16 +929,12 @@ SIZE TYPE LVL NAME PICTURE 0 errors in compilation group ]) -AT_CHECK([gcdiff progl.lst prog.lst], [0], [], []) - AT_CLEANUP AT_SETUP([COPY TRAILING replacement]) AT_KEYWORDS([listing symbols]) -AT_CAPTURE_FILE([prog.lst]) - AT_DATA([copy.inc], [ 01 TEST-FIRST PIC X(2) VALUE "OK". 01 TEST-SECOND PIC X(2) VALUE "OK". @@ -907,10 +957,8 @@ AT_DATA([prog.cob], [ ]) -AT_CHECK([$COMPILE_ONLY -t prog.lst -tlines=0 -ftsymbols prog.cob], [0], [], []) - -AT_DATA([progr.lst], -[GnuCOBOL V.R.P prog.cob DDD MMM dd HH:MM:SS YYYY +AT_CHECK([$COMPILE_LISTING0 -t- -ftsymbols prog.cob], [0], +[GnuCOBOL V.R.P prog.cob LINE PG/LN A...B............................................................ @@ -945,16 +993,12 @@ SIZE TYPE LVL NAME PICTURE 0 errors in compilation group ]) -AT_CHECK([gcdiff progr.lst prog.lst], [0], [], []) - AT_CLEANUP AT_SETUP([COPY recursive replacement]) AT_KEYWORDS([listing symbols]) -AT_CAPTURE_FILE([prog.lst]) - AT_DATA([copy-2.inc], [ 01 TEST-VAR PIC X(2) VALUE "OK". ]) @@ -976,10 +1020,8 @@ AT_DATA([prog.cob], [ STOP RUN. ]) -AT_CHECK([$COMPILE_ONLY -t prog.lst -tlines=0 -ftsymbols prog.cob], [0], [], []) - -AT_DATA([prog6.lst], -[GnuCOBOL V.R.P prog.cob DDD MMM dd HH:MM:SS YYYY +AT_CHECK([$COMPILE_LISTING0 -t- -ftsymbols prog.cob], [0], +[GnuCOBOL V.R.P prog.cob LINE PG/LN A...B............................................................ @@ -1010,16 +1052,12 @@ SIZE TYPE LVL NAME PICTURE 0 errors in compilation group ]) -AT_CHECK([gcdiff prog6.lst prog.lst], [0], [], []) - AT_CLEANUP AT_SETUP([COPY multiple files]) AT_KEYWORDS([listing symbols BASED EXTERNAL GLOBAL]) -AT_CAPTURE_FILE([prog.lst]) - AT_DATA([copy-fd-1.inc], [ FD TEXTFILE-1 RECORD VARYING 1 TO 999 CHARACTERS DEPENDING ON TEXTFILE-1-SIZE. @@ -1108,10 +1146,8 @@ AT_DATA([tstcpybk.cob], [ STOP RUN. ]) -AT_CHECK([$COMPILE_ONLY -t prog.lst -tlines=0 -ftsymbols tstcpybk.cob], [0], [], []) - -AT_DATA([prog3.lst], -[GnuCOBOL V.R.P tstcpybk.cob DDD MMM dd HH:MM:SS YYYY +AT_CHECK([$COMPILE_LISTING0 -t- -ftsymbols tstcpybk.cob], [0], +[GnuCOBOL V.R.P tstcpybk.cob LINE PG/LN A...B............................................................ @@ -1230,16 +1266,12 @@ SIZE TYPE LVL NAME PICTURE 0 errors in compilation group ]) -AT_CHECK([gcdiff prog3.lst prog.lst], [0], [], []) - AT_CLEANUP AT_SETUP([Error/Warning messages]) AT_KEYWORDS([listing error warning warnings symbols]) -AT_CAPTURE_FILE([prog.lst]) - AT_DATA([copy.inc], [ ENVIRONMENT DIVISION. INPUT-OUTPUT SECTION. @@ -1263,15 +1295,8 @@ AT_DATA([prog.cob], [ STOP RUN. ]) -AT_CHECK([$COMPILE_ONLY -Wimplicit-define -t prog.lst prog.cob], [1], [], -[copy.inc:8: error: syntax error, unexpected Identifier, expecting DYNAMIC or RANDOM or SEQUENTIAL -copy.inc:5: error: missing file description for FILE testfile -prog.cob:7: warning: variable 'filename' will be implicitly defined -prog.cob:8: error: 'FIRST-MATCH' is not defined -]) - -AT_DATA([prog12.lst], -[GnuCOBOL V.R.P prog.cob DDD MMM dd HH:MM:SS YYYY Page 0001 +AT_CHECK([$COMPILE_LISTING -Wimplicit-define -t- prog.cob], [1], +[GnuCOBOL V.R.P prog.cob Page 0001 LINE PG/LN A...B............................................................ @@ -1301,7 +1326,7 @@ error: 'FIRST-MATCH' is not defined 000010 STOP RUN. - GnuCOBOL V.R.P prog.cob DDD MMM dd HH:MM:SS YYYY Page 0002 + GnuCOBOL V.R.P prog.cob Page 0002 Error/Warning summary: @@ -1312,19 +1337,10 @@ prog.cob:8: error: 'FIRST-MATCH' is not defined 1 warning in compilation group 3 errors in compilation group -]) - -AT_CHECK([gcdiff prog12.lst prog.lst], [0], [], []) - -AT_CHECK([$COMPILE_ONLY -Wimplicit-define -T prog.lst prog.cob], [1], [], -[copy.inc:8: error: syntax error, unexpected Identifier, expecting DYNAMIC or RANDOM or SEQUENTIAL -copy.inc:5: error: missing file description for FILE testfile -prog.cob:7: warning: variable 'filename' will be implicitly defined -prog.cob:8: error: 'FIRST-MATCH' is not defined -]) +], [ignore]) -AT_DATA([prog13.lst], -[GnuCOBOL V.R.P prog.cob DDD MMM dd HH:MM:SS YYYY Page 0001 +AT_CHECK([$COMPILE_LISTING -Wimplicit-define -T- prog.cob], [1], +[GnuCOBOL V.R.P prog.cob Page 0001 LINE PG/LN A...B............................................................SEQUENCE @@ -1353,7 +1369,7 @@ error: 'FIRST-MATCH' is not defined 000010 STOP RUN. - GnuCOBOL V.R.P prog.cob DDD MMM dd HH:MM:SS YYYY Page 0002 + GnuCOBOL V.R.P prog.cob Page 0002 Error/Warning summary: @@ -1364,9 +1380,7 @@ prog.cob:8: error: 'FIRST-MATCH' is not defined 1 warning in compilation group 3 errors in compilation group -]) - -AT_CHECK([gcdiff prog13.lst prog.lst], [0], [], []) +], [ignore]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. @@ -1380,10 +1394,8 @@ AT_DATA([prog.cob], [ STOP RUN. ]) -AT_CHECK([$COMPILE_ONLY -t prog.lst -ftsymbols prog.cob], [0], [], [ignore]) - -AT_DATA([prog14.lst], -[GnuCOBOL V.R.P prog.cob DDD MMM dd HH:MM:SS YYYY Page 0001 +AT_CHECK([$COMPILE_LISTING -t- -ftsymbols prog.cob], [0], +[GnuCOBOL V.R.P prog.cob Page 0001 LINE PG/LN A...B............................................................ @@ -1398,7 +1410,7 @@ warning: numeric value is expected 000008 DISPLAY TEST-VAR NO ADVANCING 000009 END-DISPLAY. 000010 STOP RUN. - GnuCOBOL V.R.P prog.cob DDD MMM dd HH:MM:SS YYYY Page 0002 + GnuCOBOL V.R.P prog.cob Page 0002 SIZE TYPE LVL NAME PICTURE @@ -1407,7 +1419,7 @@ SIZE TYPE LVL NAME PICTURE 00002 NUMERIC 01 TEST-VAR 9(2) - GnuCOBOL V.R.P prog.cob DDD MMM dd HH:MM:SS YYYY Page 0003 + GnuCOBOL V.R.P prog.cob Page 0003 Error/Warning summary: @@ -1415,24 +1427,17 @@ prog.cob:6: warning: numeric value is expected 1 warning in compilation group 0 errors in compilation group -]) - -AT_CHECK([gcdiff prog14.lst prog.lst], [0], [], []) - +], [ignore]) -AT_CHECK([$COMPILE_ONLY -t prog.lst crud.cob], [1], [], [ignore]) - -AT_DATA([prog15.lst], -[GnuCOBOL V.R.P crud.cob DDD MMM dd HH:MM:SS YYYY Page 0001 +AT_CHECK([$COMPILE_LISTING -t- crud.cob], [1], +[GnuCOBOL V.R.P crud.cob Page 0001 cobc: crud.cob: No such file or directory 0 warnings in compilation group 1 error in compilation group -]) - -AT_CHECK([gcdiff prog15.lst prog.lst], [0], [], []) +], [ignore]) AT_DATA([prog.cpy], [ 78 I VALUE 20. @@ -1456,11 +1461,8 @@ AT_DATA([prog.cob], [ STOP RUN. ]) -AT_CHECK([$COBC $FLAGS -E -o prog.i prog.cob], [0], [], []) -AT_CHECK([$COMPILE_ONLY -t prog.lst -tlines=0 -ftsymbols prog.i], [0], [], [ignore]) - AT_DATA([prog17.lst], -[GnuCOBOL V.R.P prog.i DDD MMM dd HH:MM:SS YYYY +[GnuCOBOL V.R.P prog.i LINE PG/LN A...B............................................................ @@ -1504,8 +1506,6 @@ prog.cob:11: warning: numeric value is expected 0 errors in compilation group ]) -AT_CHECK([gcdiff prog17.lst prog.lst], [0], [], []) - AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. @@ -1522,10 +1522,8 @@ AT_DATA([prog.cob], [ STOP RUN. ]) -AT_CHECK([$COMPILE_ONLY -t prog.lst -tlines=0 prog.cob], [1], [], [ignore]) - -AT_DATA([prog16.lst], -[GnuCOBOL V.R.P prog.cob DDD MMM dd HH:MM:SS YYYY +AT_CHECK([$COMPILE_LISTING0 -t- prog.cob], [1], +[GnuCOBOL V.R.P prog.cob LINE PG/LN A...B............................................................ @@ -1555,14 +1553,10 @@ prog.cob:6: warning: numeric value is expected 1 warning in compilation group 1 error in compilation group -]) - -AT_CHECK([gcdiff prog16.lst prog.lst], [0], [], []) +], [ignore]) -AT_CHECK([$COMPILE_ONLY -t prog.lst -tlines=0 -Wfatal-errors prog.cob], [97], [], [ignore]) - -AT_DATA([prog17.lst], -[GnuCOBOL V.R.P prog.cob DDD MMM dd HH:MM:SS YYYY +AT_CHECK([$COMPILE_LISTING0 -t- -Wfatal-errors prog.cob], [97], +[GnuCOBOL V.R.P prog.cob LINE PG/LN A...B............................................................ @@ -1591,10 +1585,7 @@ prog.cob:7: error: CRUD.CPY: No such file or directory 0 warnings in compilation group 1 error in compilation group Too many errors in compilation group: 0 maximum errors -]) - -AT_CHECK([gcdiff prog17.lst prog.lst], [0], [], []) - +], [ignore]) AT_CLEANUP @@ -1602,8 +1593,6 @@ AT_CLEANUP AT_SETUP([Two source files]) AT_KEYWORDS([listing]) -AT_CAPTURE_FILE([prog.lst]) - AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. @@ -1624,10 +1613,8 @@ AT_DATA([prog1.cob], [ STOP RUN. ]) -AT_CHECK([$COMPILE_ONLY -t prog.lst prog.cob prog1.cob], [0], [], []) - -AT_DATA([prog11.lst], -[GnuCOBOL V.R.P prog.cob DDD MMM dd HH:MM:SS YYYY Page 0001 +AT_CHECK([$COMPILE_LISTING -t- prog.cob prog1.cob], [0], +[GnuCOBOL V.R.P prog.cob Page 0001 LINE PG/LN A...B............................................................ @@ -1643,7 +1630,7 @@ LINE PG/LN A...B............................................................ 0 warnings in compilation group 0 errors in compilation group - GnuCOBOL V.R.P prog1.cob DDD MMM dd HH:MM:SS YYYY Page 0001 + GnuCOBOL V.R.P prog1.cob Page 0001 LINE PG/LN A...B............................................................ @@ -1661,8 +1648,6 @@ LINE PG/LN A...B............................................................ 0 errors in compilation group ]) -AT_CHECK([gcdiff prog11.lst prog.lst], [0], [], []) - AT_CLEANUP @@ -1688,7 +1673,7 @@ AT_DATA([prog.cob], [ ]) AT_DATA([prog20.lst], -[GnuCOBOL V.R.P prog.cob DDD MMM dd HH:MM:SS YYYY Page 0001 +[GnuCOBOL V.R.P prog.cob Page 0001 LINE PG/LN A...B............................................................ @@ -1705,7 +1690,7 @@ LINE PG/LN A...B............................................................ 000011 IDENTIFICATION DIVISION. 000012 PROGRAM-ID. prog-2. 000013 END PROGRAM prog-2. - GnuCOBOL V.R.P prog.cob DDD MMM dd HH:MM:SS YYYY Page 0002 + GnuCOBOL V.R.P prog.cob Page 0002 SIZE TYPE LVL NAME PICTURE @@ -1726,10 +1711,10 @@ SIZE TYPE LVL NAME PICTURE # Check once with $COMPILE and once with $COMPILE_ONLY. # This tests whether codegen affects the listing. -AT_CHECK([$COMPILE -t prog.lst -ftsymbols prog.cob], [0], [], []) -AT_CHECK([gcdiff prog20.lst prog.lst], [0], [], []) -AT_CHECK([$COMPILE_ONLY -t prog2.lst -ftsymbols prog.cob], [0], [], []) -AT_CHECK([gcdiff prog20.lst prog2.lst], [0], [], []) +AT_CHECK([$COMPILE $LISTING_FLAGS -t prog.lst -ftsymbols prog.cob], [0], [], []) +AT_CHECK([diff prog20.lst prog.lst], [0], [], []) +AT_CHECK([$COMPILE_LISTING -t prog2.lst -ftsymbols prog.cob], [0], [], []) +AT_CHECK([diff prog20.lst prog2.lst], [0], [], []) AT_CHECK([rm -f prog.lst prog2.lst], [0], [], []) @@ -1752,7 +1737,7 @@ AT_DATA([progb.cob], [ ]) AT_DATA([prog20b.lst], -[GnuCOBOL V.R.P progb.cob DDD MMM dd HH:MM:SS YYYY Page 0001 +[GnuCOBOL V.R.P progb.cob Page 0001 LINE PG/LN A...B............................................................ @@ -1772,7 +1757,7 @@ LINE PG/LN A...B............................................................ 000014 END PROGRAM prog-2. 000015 000016 END PROGRAM prog-1. - GnuCOBOL V.R.P progb.cob DDD MMM dd HH:MM:SS YYYY Page 0002 + GnuCOBOL V.R.P progb.cob Page 0002 SIZE TYPE LVL NAME PICTURE @@ -1793,10 +1778,10 @@ SIZE TYPE LVL NAME PICTURE # Check once with $COMPILE and once with $COMPILE_ONLY. # This tests whether codegen affects the listing. -AT_CHECK([$COMPILE -t prog.lst -ftsymbols progb.cob], [0], [], []) -AT_CHECK([gcdiff prog20b.lst prog.lst], [0], [], []) -AT_CHECK([$COMPILE_ONLY -t prog2.lst -ftsymbols progb.cob], [0], [], []) -AT_CHECK([gcdiff prog20b.lst prog2.lst], [0], [], []) +AT_CHECK([$COMPILE $LISTING_FLAGS -t prog.lst -ftsymbols progb.cob], [0], [], []) +AT_CHECK([diff prog20b.lst prog.lst], [0], [], []) +AT_CHECK([$COMPILE_LISTING -t prog2.lst -ftsymbols progb.cob], [0], [], []) +AT_CHECK([diff prog20b.lst prog2.lst], [0], [], []) AT_CHECK([rm -f prog.lst prog2.lst], [0], [], []) @@ -1819,7 +1804,7 @@ AT_DATA([progc.cob], [ ]) AT_DATA([prog20c.lst], -[GnuCOBOL V.R.P progc.cob DDD MMM dd HH:MM:SS YYYY Page 0001 +[GnuCOBOL V.R.P progc.cob Page 0001 LINE PG/LN A...B............................................................ @@ -1840,7 +1825,7 @@ error: syntax error, unexpected ., expecting DIVISION 000014 END PROGRAM prog-2. 000015 000016 END PROGRAM prog-1. - GnuCOBOL V.R.P progc.cob DDD MMM dd HH:MM:SS YYYY Page 0002 + GnuCOBOL V.R.P progc.cob Page 0002 SIZE TYPE LVL NAME PICTURE @@ -1855,7 +1840,7 @@ SIZE TYPE LVL NAME PICTURE No fields defined. - GnuCOBOL V.R.P progc.cob DDD MMM dd HH:MM:SS YYYY Page 0003 + GnuCOBOL V.R.P progc.cob Page 0003 Error/Warning summary: @@ -1867,10 +1852,10 @@ progc.cob:13: error: syntax error, unexpected ., expecting DIVISION # Check once with $COMPILE and once with $COMPILE_ONLY. # This tests whether codegen affects the listing. -AT_CHECK([$COMPILE -t prog.lst -ftsymbols progc.cob], [1], [], [ignore]) -AT_CHECK([gcdiff prog20c.lst prog.lst], [0], [], []) -AT_CHECK([$COMPILE_ONLY -t prog2.lst -ftsymbols progc.cob], [1], [], [ignore]) -AT_CHECK([gcdiff prog20c.lst prog2.lst], [0], [], []) +AT_CHECK([$COMPILE $LISTING_FLAGS -t prog.lst -ftsymbols progc.cob], [1], [], [ignore]) +AT_CHECK([diff prog20c.lst prog.lst], [0], [], []) +AT_CHECK([$COMPILE_LISTING -t prog2.lst -ftsymbols progc.cob], [1], [], [ignore]) +AT_CHECK([diff prog20c.lst prog2.lst], [0], [], []) AT_CLEANUP @@ -1924,7 +1909,7 @@ AT_DATA([prog-2.cob], [ ]) AT_DATA([expected.lst], -[GnuCOBOL V.R.P prog-1.cob DDD MMM dd HH:MM:SS YYYY Page 0001 +[GnuCOBOL V.R.P prog-1.cob Page 0001 LINE PG/LN A...B............................................................ @@ -1945,7 +1930,7 @@ LINE PG/LN A...B............................................................ warning: unreachable statement 'DISPLAY' 000015 000016 EX. STOP RUN. - GnuCOBOL V.R.P prog-1.cob DDD MMM dd HH:MM:SS YYYY Page 0002 + GnuCOBOL V.R.P prog-1.cob Page 0002 SIZE TYPE LVL NAME PICTURE @@ -1953,25 +1938,25 @@ SIZE TYPE LVL NAME PICTURE 00001 ALPHANUMERIC 01 blah X - GnuCOBOL V.R.P prog-1.cob DDD MMM dd HH:MM:SS YYYY Page 0003 + GnuCOBOL V.R.P prog-1.cob Page 0003 NAME DEFINED REFERENCES blah 7 *10 11 14 x3 - GnuCOBOL V.R.P prog-1.cob DDD MMM dd HH:MM:SS YYYY Page 0004 + GnuCOBOL V.R.P prog-1.cob Page 0004 LABEL DEFINED REFERENCES E prog__1 10 P EX 16 12 x1 - GnuCOBOL V.R.P prog-1.cob DDD MMM dd HH:MM:SS YYYY Page 0005 + GnuCOBOL V.R.P prog-1.cob Page 0005 FUNCTION TYPE REFERENCES L prog-2 EXTERN 11 x1 - GnuCOBOL V.R.P prog-1.cob DDD MMM dd HH:MM:SS YYYY Page 0006 + GnuCOBOL V.R.P prog-1.cob Page 0006 Error/Warning summary: @@ -1979,7 +1964,7 @@ prog-1.cob:14: warning: unreachable statement 'DISPLAY' 1 warning in compilation group 0 errors in compilation group - GnuCOBOL V.R.P prog-2.cob DDD MMM dd HH:MM:SS YYYY Page 0001 + GnuCOBOL V.R.P prog-2.cob Page 0001 LINE PG/LN A...B............................................................ @@ -2003,7 +1988,7 @@ warning: unreachable statement 'ACCEPT' 000017 000018 EX. STOP RUN. 000019 - GnuCOBOL V.R.P prog-2.cob DDD MMM dd HH:MM:SS YYYY Page 0002 + GnuCOBOL V.R.P prog-2.cob Page 0002 SIZE TYPE LVL NAME PICTURE @@ -2015,7 +2000,7 @@ SIZE TYPE LVL NAME PICTURE 00001 ALPHANUMERIC 01 stuff X - GnuCOBOL V.R.P prog-2.cob DDD MMM dd HH:MM:SS YYYY Page 0003 + GnuCOBOL V.R.P prog-2.cob Page 0003 NAME DEFINED REFERENCES @@ -2023,7 +2008,7 @@ data-b 7 *12 13 x2 stuff 9 *10 12 *16 x3 - GnuCOBOL V.R.P prog-2.cob DDD MMM dd HH:MM:SS YYYY Page 0004 + GnuCOBOL V.R.P prog-2.cob Page 0004 LABEL DEFINED REFERENCES @@ -2031,7 +2016,7 @@ E prog__2 11 P MAIN 11 not referenced P EX 18 14 x1 - GnuCOBOL V.R.P prog-2.cob DDD MMM dd HH:MM:SS YYYY Page 0005 + GnuCOBOL V.R.P prog-2.cob Page 0005 Error/Warning summary: @@ -2044,11 +2029,11 @@ prog-2.cob:16: warning: unreachable statement 'ACCEPT' # Check once with $COMPILE and once with $COMPILE_ONLY. # This tests whether codegen affects the listing. -AT_CHECK([$COMPILE -Wunreachable -t prog.lst -Xref -ftsymbols prog-1.cob prog-2.cob], [0], [], [ignore]) -AT_CHECK([gcdiff expected.lst prog.lst], [0], [], []) +AT_CHECK([$COMPILE $LISTING_FLAGS -Wunreachable -t prog.lst -Xref -ftsymbols prog-1.cob prog-2.cob], [0], [], [ignore]) +AT_CHECK([diff expected.lst prog.lst], [0], [], []) -AT_CHECK([$COMPILE_ONLY -Wunreachable -t prog.lst -Xref -ftsymbols prog-1.cob prog-2.cob], [0], [], [ignore]) -AT_CHECK([gcdiff expected.lst prog.lst], [0], [], []) +AT_CHECK([$COMPILE_LISTING -Wunreachable -t prog.lst -Xref -ftsymbols prog-1.cob prog-2.cob], [0], [], [ignore]) +AT_CHECK([diff expected.lst prog.lst], [0], [], []) AT_CLEANUP @@ -2057,7 +2042,6 @@ AT_SETUP([command line]) AT_KEYWORDS([listing]) AT_CAPTURE_FILE([prog.lst]) - AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. FUNCTION-ID. WITHPAR. @@ -2071,7 +2055,7 @@ AT_DATA([prog.cob], [ END FUNCTION WITHPAR. ]) -AT_CHECK([$COBC -q -fsyntax-only -t prog.lst -fno-theader -ftcmd prog.cob], [0], [], []) +AT_CHECK([$COBC $LISTING_FLAGS -q -fsyntax-only -t prog.lst -fno-theader -ftcmd prog.cob], [0], [], []) AT_DATA([reference.lst], [ @@ -2086,32 +2070,18 @@ AT_DATA([reference.lst], 000009 ADD 1 TO PAR-IN GIVING PAR-OUT END-ADD. 000010 GOBACK. 000011 END FUNCTION WITHPAR. - - + command line: - cobc -q -fsyntax-only -t prog.lst -fno-theader -ftcmd prog.cob - + cobc -std=default -fdiagnostics-plain-output -fttitle=GnuCOBOL_V.R.P ++ -fno-ttimestamp -q -fsyntax-only -t prog.lst -fno-theader -ftcmd prog.cob 0 warnings in compilation group 0 errors in compilation group ]) -AT_DATA([prog.cob], [ - IDENTIFICATION DIVISION. - FUNCTION-ID. WITHPAR. - DATA DIVISION. - LINKAGE SECTION. - 01 PAR-IN PIC 9. - 01 PAR-OUT PIC 9. - PROCEDURE DIVISION USING PAR-IN RETURNING PAR-OUT. - ADD 1 TO PAR-IN GIVING PAR-OUT END-ADD. - GOBACK. - END FUNCTION WITHPAR. -]) - -AT_CHECK([$COBC -q -std=default -Wall -fno-tmessages -fsyntax-only -t prog.lst -fno-tsymbols -ftcmd prog.cob], [0], [], []) +# TODO: we don't perform any comparison here between prog.lst and reference.lst. Why ? -AT_DATA([reference.lst], -[GnuCOBOL V.R.P prog.cob DDD MMM dd HH:MM:SS YYYY Page 0001 +AT_CHECK([$COBC $LISTING_FLAGS -q -std=default -Wall -fno-tmessages -fsyntax-only -t- -fno-tsymbols -ftcmd prog.cob], [0], +[GnuCOBOL V.R.P prog.cob Page 0001 LINE PG/LN A...B............................................................ @@ -2126,25 +2096,19 @@ LINE PG/LN A...B............................................................ 000009 ADD 1 TO PAR-IN GIVING PAR-OUT END-ADD. 000010 GOBACK. 000011 END FUNCTION WITHPAR. - GnuCOBOL V.R.P prog.cob DDD MMM dd HH:MM:SS YYYY Page 0002 + GnuCOBOL V.R.P prog.cob Page 0002 command line: - cobc -std=default -fdiagnostics-plain-output -q -std=default -Wall -+ -fno-tmessages -fsyntax-only -t prog.lst -fno-tsymbols -ftcmd prog.cob + cobc -std=default -fdiagnostics-plain-output -fttitle=GnuCOBOL_V.R.P ++ -fno-ttimestamp -q -std=default -Wall -fno-tmessages -fsyntax-only -t- -fno-t ]) -#AT_CHECK([$UNIFY_LISTING prog.lst prog.lis], [0], [], []) -#AT_CHECK([diff reference.lst prog.lis], [0], [], []) -AT_CHECK([gcdiff -IGnuCOBOL reference.lst prog.lst], [0], [], []) - AT_CLEANUP AT_SETUP([Wide listing]) AT_KEYWORDS([listing]) -AT_CAPTURE_FILE([prog.lst]) - AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROG001 PROGRAM-ID. prog. PROG002 @@ -2155,10 +2119,8 @@ AT_DATA([prog.cob], [ STOP RUN. PROG007 ]) -AT_CHECK([$COMPILE_ONLY -T prog.lst prog.cob], [0], [], []) - -AT_DATA([prog9.lst], -[GnuCOBOL V.R.P prog.cob DDD MMM dd HH:MM:SS YYYY Page 0001 +AT_CHECK([$COMPILE_LISTING -T- prog.cob], [0], +[GnuCOBOL V.R.P prog.cob Page 0001 LINE PG/LN A...B............................................................SEQUENCE @@ -2167,7 +2129,7 @@ LINE PG/LN A...B............................................................ 000003 PROGRAM-ID. prog. PROG002 000004 DATA DIVISION. PROG003 000005 WORKING-STORAGE SECTION. PROG004 - GnuCOBOL V.R.P prog.cob DDD MMM dd HH:MM:SS YYYY Page 0002 + GnuCOBOL V.R.P prog.cob Page 0002 LINE PG/LN A...B............................................................SEQUENCE @@ -2180,8 +2142,6 @@ LINE PG/LN A...B............................................................ 0 errors in compilation group ]) -AT_CHECK([gcdiff prog9.lst prog.lst], [0], [], []) - AT_DATA([prog2.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog2. @@ -2194,10 +2154,8 @@ AT_DATA([prog2.cob], [ STOP RUN. ]) -AT_CHECK([$COMPILE_ONLY -T prog.lst -free prog2.cob], [0], [], []) - -AT_DATA([prog10.lst], -[GnuCOBOL V.R.P prog2.cob DDD MMM dd HH:MM:SS YYYY Page 0001 +AT_CHECK([$COMPILE_LISTING -T- -free prog2.cob], [0], +[GnuCOBOL V.R.P prog2.cob Page 0001 LINE .....................................................SOURCE..................................................... @@ -2206,7 +2164,7 @@ LINE .....................................................SOURCE............. 000003 PROGRAM-ID. prog2. 000004 DATA DIVISION. 000005 WORKING-STORAGE SECTION. - GnuCOBOL V.R.P prog2.cob DDD MMM dd HH:MM:SS YYYY Page 0002 + GnuCOBOL V.R.P prog2.cob Page 0002 LINE .....................................................SOURCE..................................................... @@ -2221,8 +2179,6 @@ LINE .....................................................SOURCE............. 0 errors in compilation group ]) -AT_CHECK([gcdiff prog10.lst prog.lst], [0], [], []) - AT_CLEANUP @@ -2247,10 +2203,8 @@ AT_DATA([prog.cob], [ STOP RUN. ]) -AT_CHECK([$COMPILE_ONLY -t prog.lst -tlines=0 -fno-tmessages -ftsymbols prog.cob], [0], [], []) - -AT_DATA([prog15.lst], -[GnuCOBOL V.R.P prog.cob DDD MMM dd HH:MM:SS YYYY +AT_CHECK([$COMPILE_LISTING0 -t- -fno-tmessages -ftsymbols prog.cob], [0], +[GnuCOBOL V.R.P prog.cob LINE PG/LN A...B............................................................ @@ -2290,8 +2244,6 @@ SIZE TYPE LVL NAME PICTURE ]) -AT_CHECK([gcdiff prog15.lst prog.lst], [0], [], []) - AT_DATA([prog2.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog2. @@ -2304,10 +2256,8 @@ AT_DATA([prog2.cob], [ STOP RUN. ]) -AT_CHECK([$COMPILE_ONLY -t prog.lst -tlines=0 -fno-tmessages -fno-tsource -ftsymbols prog2.cob], [0], [], []) - -AT_DATA([prog16.lst], -[GnuCOBOL V.R.P prog2.cob DDD MMM dd HH:MM:SS YYYY +AT_CHECK([$COMPILE_LISTING0 -t- -fno-tmessages -fno-tsource -ftsymbols prog2.cob], [0], +[GnuCOBOL V.R.P prog2.cob SIZE TYPE LVL NAME PICTURE @@ -2322,8 +2272,6 @@ SIZE TYPE LVL NAME PICTURE ]) -AT_CHECK([gcdiff prog16.lst prog.lst], [0], [], []) - AT_DATA([prog3.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog3. @@ -2340,10 +2288,10 @@ AT_DATA([prog3.cob], [ STOP RUN. ]) -AT_CHECK([$COMPILE_ONLY -t prog.lst -tlines=0 -fno-tsource -fno-tmessages -ftsymbols prog3.cob], [0], [], []) +AT_CHECK([$COMPILE_LISTING0 -t prog.lst -fno-tsource -fno-tmessages -ftsymbols prog3.cob], [0], [], []) AT_DATA([prog15-1.lst], -[GnuCOBOL V.R.P prog3.cob DDD MMM dd HH:MM:SS YYYY +[GnuCOBOL V.R.P prog3.cob SIZE TYPE LVL NAME PICTURE @@ -2366,14 +2314,12 @@ SIZE TYPE LVL NAME PICTURE ]) -AT_CHECK([gcdiff -IGnuCOBOL prog15-1.lst prog.lst], [0], [], []) +AT_CHECK([diff prog15-1.lst prog.lst], [0], [], []) # verify that the symbol listing is identical if full codegen was done -AT_CHECK([$COMPILE -t prog.lst -tlines=0 -fno-tsource -fno-tmessages -ftsymbols prog3.cob], [0], [], []) +AT_CHECK([$COMPILE $LISTING_FLAGS -t prog2.lst -tlines=0 -fno-tsource -fno-tmessages -ftsymbols prog3.cob], [0], [], []) -#AT_CHECK([$UNIFY_LISTING prog.lst compiled.lis], [0], [], []) -#AT_CHECK([diff prog15-1.lst compiled.lis], [0], [], []) -AT_CHECK([gcdiff -IGnuCOBOL prog15-1.lst prog.lst], [0], [], []) +AT_CHECK([diff prog15-1.lst prog2.lst], [0], [], []) AT_CLEANUP @@ -2430,14 +2376,14 @@ AT_DATA([prog.cob], [ STOP RUN. ]) -AT_CHECK([$COMPILE_ONLY -t prog.lst -tlines=0 -ftsymbols prog.cob], [0], [], []) +AT_CHECK([$COMPILE_LISTING0 -t prog.lst -ftsymbols prog.cob], [0], [], []) AT_CHECK([test "$COB_HAS_64_BIT_POINTER" = "yes"], [0], [], [], # Previous test "failed" --> 32 bit AT_DATA([prog17-32.lst], -[GnuCOBOL V.R.P prog.cob DDD MMM dd HH:MM:SS YYYY +[GnuCOBOL V.R.P prog.cob LINE PG/LN A...B............................................................ @@ -2539,14 +2485,14 @@ SIZE TYPE LVL NAME PICTURE 0 errors in compilation group ]) -AT_CHECK([gcdiff prog17-32.lst prog.lst], [0], [], []) +AT_CHECK([diff prog17-32.lst prog.lst], [0], [], []) , # Previous test "passed" --> 64 bit AT_DATA([prog17-64.lst], -[GnuCOBOL V.R.P prog.cob DDD MMM dd HH:MM:SS YYYY +[GnuCOBOL V.R.P prog.cob LINE PG/LN A...B............................................................ @@ -2648,7 +2594,7 @@ SIZE TYPE LVL NAME PICTURE 0 errors in compilation group ]) -AT_CHECK([gcdiff prog17-64.lst prog.lst], [0], [], []) +AT_CHECK([diff prog17-64.lst prog.lst], [0], [], []) ) @@ -2659,8 +2605,6 @@ AT_CLEANUP AT_SETUP([Symbols: multiple programs/functions]) AT_KEYWORDS([listing symbols program function]) -AT_CAPTURE_FILE([prog.lst]) - AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. FUNCTION-ID. WITHPAR. @@ -2703,10 +2647,8 @@ AT_DATA([prog.cob], [ END PROGRAM prog. ]) -AT_CHECK([$COMPILE_ONLY -t prog.lst -ftsymbols prog.cob], [0], [], []) - -AT_DATA([prog18.lst], -[GnuCOBOL V.R.P prog.cob DDD MMM dd HH:MM:SS YYYY Page 0001 +AT_CHECK([$COMPILE_LISTING -t- -ftsymbols prog.cob], [0], +[GnuCOBOL V.R.P prog.cob Page 0001 LINE PG/LN A...B............................................................ @@ -2750,7 +2692,7 @@ LINE PG/LN A...B............................................................ 000038 END-IF. 000039 STOP RUN. 000040 END PROGRAM prog. - GnuCOBOL V.R.P prog.cob DDD MMM dd HH:MM:SS YYYY Page 0002 + GnuCOBOL V.R.P prog.cob Page 0002 SIZE TYPE LVL NAME PICTURE @@ -2777,16 +2719,12 @@ SIZE TYPE LVL NAME PICTURE 0 errors in compilation group ]) -AT_CHECK([gcdiff prog18.lst prog.lst], [0], [], []) - AT_CLEANUP AT_SETUP([Symbols: OCCURS and REDEFINES]) AT_KEYWORDS([listing symbols UNBOUNDED]) -AT_CAPTURE_FILE([prog.lst]) - AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. @@ -2828,10 +2766,8 @@ AT_DATA([prog.cob], [ STOP RUN. ]) -AT_CHECK([$COMPILE_ONLY -fcomplex-odo -t prog.lst -fno-tsource -ftsymbols prog.cob], [0], [], []) - -AT_DATA([prog19.lst], -[GnuCOBOL V.R.P prog.cob DDD MMM dd HH:MM:SS YYYY Page 0001 +AT_CHECK([$COMPILE_LISTING -fcomplex-odo -t- -fno-tsource -ftsymbols prog.cob], [0], +[GnuCOBOL V.R.P prog.cob Page 0001 SIZE TYPE LVL NAME PICTURE @@ -2873,16 +2809,12 @@ SIZE TYPE LVL NAME PICTURE 0 errors in compilation group ]) -AT_CHECK([gcdiff prog19.lst prog.lst], [0], [], []) - AT_CLEANUP AT_SETUP([Conditional compilation]) AT_KEYWORDS([listing CDF]) -AT_CAPTURE_FILE([prog.lst]) - AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. @@ -2920,10 +2852,8 @@ AT_DATA([prog2.cob], [ STOP RUN. ]) -AT_CHECK([$COMPILE_ONLY -DACTIVATE2 -t prog.lst prog.cob], [0], [], []) - -AT_DATA([prog16.lst], -[GnuCOBOL V.R.P prog.cob DDD MMM dd HH:MM:SS YYYY Page 0001 +AT_CHECK([$COMPILE_LISTING -DACTIVATE2 -t- prog.cob], [0], +[GnuCOBOL V.R.P prog.cob Page 0001 LINE PG/LN A...B............................................................ @@ -2950,12 +2880,8 @@ LINE PG/LN A...B............................................................ 0 errors in compilation group ]) -AT_CHECK([gcdiff prog16.lst prog.lst], [0], [], []) - -AT_CHECK([$COMPILE_ONLY -DACTIVATE2 -t prog.lst prog2.cob], [0], [], []) - -AT_DATA([prog16b.lst], -[GnuCOBOL V.R.P prog2.cob DDD MMM dd HH:MM:SS YYYY Page 0001 +AT_CHECK([$COMPILE_LISTING -DACTIVATE2 -t- prog2.cob], [0], +[GnuCOBOL V.R.P prog2.cob Page 0001 LINE PG/LN A...B............................................................ @@ -2982,16 +2908,12 @@ LINE PG/LN A...B............................................................ 0 errors in compilation group ]) -AT_CHECK([gcdiff prog16b.lst prog.lst], [0], [], []) - AT_CLEANUP AT_SETUP([File descriptions]) AT_KEYWORDS([listing]) -AT_CAPTURE_FILE([prog.lst]) - AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. @@ -3105,11 +3027,8 @@ AT_DATA([prog.cob], [ STOP RUN. ]) -AT_CHECK([$COMPILE_ONLY -t prog.lst -tlines=0 -ftsymbols prog.cob], [1], [], [ignore]) - - -AT_DATA([prog18.lst], -[GnuCOBOL V.R.P prog.cob DDD MMM dd HH:MM:SS YYYY +AT_CHECK([$COMPILE_LISTING0 -t- -ftsymbols prog.cob], [1], +[GnuCOBOL V.R.P prog.cob LINE PG/LN A...B............................................................ @@ -3325,9 +3244,7 @@ prog.cob:66: warning: DATA RECORDS is obsolete in GnuCOBOL 8 warnings in compilation group 1 error in compilation group -]) - -AT_CHECK([gcdiff prog18.lst prog.lst], [0], [], []) +], [ignore]) AT_CLEANUP @@ -3435,10 +3352,10 @@ AT_DATA([prog.cob], [ OCCURS 8 TIMES PIC 1(8) BIT. ]) -AT_CHECK([$COMPILE_ONLY -t prog.lst -tlines=0 -ftsymbols -Wno-pending -Wno-unfinished -fword-continuation=ok prog.cob], [1], [], [ignore]) +AT_CHECK([$COMPILE_LISTING0 -t prog.lst -ftsymbols -Wno-pending -Wno-unfinished -fword-continuation=ok prog.cob], [1], [], [ignore]) -AT_DATA([prog19.lst], -[GnuCOBOL V.R.P prog.cob DDD MMM dd HH:MM:SS YYYY +AT_DATA([expected.lst], +[GnuCOBOL V.R.P prog.cob LINE PG/LN A...B............................................................ @@ -3771,7 +3688,7 @@ prog.cob:81: warning: uncommon parentheses 57 errors in compilation group ]) -AT_CHECK([gcdiff prog19.lst prog.lst], [0], [], []) +AT_CHECK([diff expected.lst prog.lst], [0]) AT_CLEANUP @@ -3779,8 +3696,6 @@ AT_CLEANUP AT_SETUP([Variable format]) AT_KEYWORDS([listing overflow]) -AT_CAPTURE_FILE([prog.lst]) - AT_DATA([prog.cob], [000001 $SET SOURCEFORMAT "VARIABLE" 000010 IDENTIFICATION DIVISION. @@ -3792,10 +3707,8 @@ AT_DATA([prog.cob], 000070 END PROGRAM prog. ]) -AT_CHECK([$COMPILE_ONLY -t prog.lst -tlines=0 prog.cob], [0], [], []) - -AT_DATA([prog20.lst], -[GnuCOBOL V.R.P prog.cob DDD MMM dd HH:MM:SS YYYY +AT_CHECK([$COMPILE_LISTING0 -t- prog.cob], [0], +[GnuCOBOL V.R.P prog.cob LINE PG/LN A...B............................................................ @@ -3814,8 +3727,6 @@ LINE PG/LN A...B............................................................ 0 errors in compilation group ]) -AT_CHECK([gcdiff prog20.lst prog.lst], [0], [], []) - AT_CLEANUP @@ -3832,8 +3743,9 @@ AT_DATA([prog.cob], [ / DISPLAY 'MFCOMMENTSLASH' STOP RUN. ]) -AT_DATA([prog-nomfcomment.lst.expected], -[GnuCOBOL V.R.P prog.cob DDD MMM dd HH:MM:SS YYYY + +AT_CHECK([$COMPILE_LISTING0 -t- prog.cob], [0], +[GnuCOBOL V.R.P prog.cob LINE PG/LN A...B............................................................ @@ -3854,8 +3766,9 @@ LINE PG/LN A...B............................................................ 0 warnings in compilation group 0 errors in compilation group ]) -AT_DATA([prog-mfcomment.lst.expected], -[GnuCOBOL V.R.P prog.cob DDD MMM dd HH:MM:SS YYYY + +AT_CHECK([$COMPILE_LISTING0 -t- -fmfcomment prog.cob], [0], +[GnuCOBOL V.R.P prog.cob LINE PG/LN A...B............................................................ @@ -3876,23 +3789,12 @@ LINE PG/LN A...B............................................................ 0 errors in compilation group ]) -AT_CHECK([$COMPILE_ONLY -t prog-nomfcomment.lst -tlines=0 prog.cob], [0], [], []) -AT_CHECK([$COMPILE_ONLY -t prog-mfcomment.lst -tlines=0 -fmfcomment prog.cob], [0], [], []) -#AT_CHECK([$UNIFY_LISTING prog-nomfcomment.lst prog-nomfcomment.lis once], [0], [], []) -#AT_CHECK([$UNIFY_LISTING prog-mfcomment.lst prog-mfcomment.lis once], [0], [], []) -#AT_CHECK([diff prog-nomfcomment.lst.expected prog-nomfcomment.lis], [0], [], []) -#AT_CHECK([diff prog-mfcomment.lst.expected prog-mfcomment.lis], [0], [], []) -AT_CHECK([gcdiff -IGnuCOBOL prog-nomfcomment.lst.expected prog-nomfcomment.lst], [0], [], []) -AT_CHECK([gcdiff -IGnuCOBOL prog-mfcomment.lst.expected prog-mfcomment.lst], [0], [], []) - AT_CLEANUP AT_SETUP([LISTING directive]) AT_KEYWORDS([CDF]) -AT_CAPTURE_FILE([prog.lst]) - AT_DATA([copy.inc], [ >>LISTING OFF 01 TEST1-VAR PIC X(2) VALUE "OK". @@ -3927,10 +3829,8 @@ AT_DATA([prog.cob], [ STOP RUN. ]) -AT_CHECK([$COMPILE_ONLY -t prog.lst -tlines=0 -ftsymbols prog.cob], [0], [], []) - -AT_DATA([prog17.lst], -[GnuCOBOL V.R.P prog.cob DDD MMM dd HH:MM:SS YYYY +AT_CHECK([$COMPILE_LISTING0 -t- -ftsymbols prog.cob], [0], +[GnuCOBOL V.R.P prog.cob LINE PG/LN A...B............................................................ @@ -3985,16 +3885,12 @@ SIZE TYPE LVL NAME PICTURE 0 errors in compilation group ]) -AT_CHECK([gcdiff prog17.lst prog.lst], [0], [], []) - AT_CLEANUP AT_SETUP([LISTING directive free-form reference-format]) AT_KEYWORDS([CDF]) -AT_CAPTURE_FILE([prog.lst]) - AT_DATA([copy.inc], [ >>LISTING OFF 01 TEST1-VAR PIC X(2) VALUE "OK". @@ -4029,10 +3925,8 @@ AT_DATA([prog.cob], [ STOP RUN. ]) -AT_CHECK([$COMPILE_ONLY -t prog.lst -tlines=0 -ftsymbols -free prog.cob], [0], [], []) - -AT_DATA([prog17.lst], -[GnuCOBOL V.R.P prog.cob DDD MMM dd HH:MM:SS YYYY +AT_CHECK([$COMPILE_LISTING0 -t- -ftsymbols -free prog.cob], [0], +[GnuCOBOL V.R.P prog.cob LINE .....................SOURCE............................................. @@ -4087,18 +3981,12 @@ SIZE TYPE LVL NAME PICTURE 0 errors in compilation group ]) -#AT_CHECK([$UNIFY_LISTING prog.lst prog.lis once], [0], [], []) -#AT_CHECK([diff prog17.lst prog.lis], [0], [], []) -AT_CHECK([gcdiff prog17.lst prog.lst], [0], [], []) - AT_CLEANUP AT_SETUP([Listing-directive statements]) AT_KEYWORDS([listing directive EJECT SKIP1 SKIP2 SKIP3 TITLE]) -AT_CAPTURE_FILE([prog.lst]) - AT_DATA([prog.cob], [ TITLE "GnuCOBOL lists IBM" IDENTIFICATION DIVISION. SKIP1 @@ -4117,10 +4005,8 @@ AT_DATA([prog.cob], [ TITLE "GnuCOBOL lists IBM" STOP RUN. ]) -AT_CHECK([$COMPILE_ONLY -t prog.lst -std=ibm prog.cob], [0], [], []) - -AT_DATA([expect.lst], -[GnuCOBOL lists IBM prog.cob DDD MMM dd HH:MM:SS YYYY Page 0001 +AT_CHECK([$COMPILE_LISTING -t- -std=ibm prog.cob], [0], +[GnuCOBOL lists IBM prog.cob Page 0001 LINE PG/LN A...B............................................................ @@ -4139,12 +4025,12 @@ LINE PG/LN A...B............................................................ 000008 WORKING-STORAGE SECTION. 000009 01 TITLE-01 PIC X(2). 000010 01 TITLE-02 PIC X(2). - here goes the code prog.cob DDD MMM dd HH:MM:SS YYYY Page 0002 + here goes the code prog.cob Page 0002 LINE PG/LN A...B............................................................ 000012 PROCEDURE DIVISION. - here goes the code prog.cob DDD MMM dd HH:MM:SS YYYY Page 0003 + here goes the code prog.cob Page 0003 LINE PG/LN A...B............................................................ @@ -4157,8 +4043,6 @@ LINE PG/LN A...B............................................................ 0 errors in compilation group ]) -AT_CHECK([gcdiff -I"here goes the code" expect.lst prog.lst], [0], [], []) - AT_CLEANUP @@ -4177,10 +4061,8 @@ AT_DATA([prog.cob], [ STOP RUN. ]) -AT_CHECK([$COMPILE_ONLY -t prog.lst prog.cob], [0], [], []) - -AT_DATA([prog7.lst], -[GnuCOBOL V.R.P prog.cob DDD MMM dd HH:MM:SS YYYY Page 0001 +AT_CHECK([$COMPILE_LISTING -t- prog.cob], [0], +[GnuCOBOL V.R.P prog.cob Page 0001 LINE PG/LN A...B............................................................ @@ -4189,7 +4071,7 @@ LINE PG/LN A...B............................................................ 000003 PROGRAM-ID. prog. 000004 DATA DIVISION. 000005 WORKING-STORAGE SECTION. - GnuCOBOL V.R.P prog.cob DDD MMM dd HH:MM:SS YYYY Page 0002 + GnuCOBOL V.R.P prog.cob Page 0002 LINE PG/LN A...B............................................................ @@ -4200,9 +4082,7 @@ LINE PG/LN A...B............................................................ 0 warnings in compilation group 0 errors in compilation group -]) - -AT_CHECK([gcdiff prog7.lst prog.lst], [0], [], []) +], []) AT_DATA([prog2.cob], [ IDENTIFICATION DIVISION. @@ -4215,10 +4095,8 @@ AT_DATA([prog2.cob], [ ]) -AT_CHECK([$COMPILE_ONLY -t prog.lst -free prog2.cob], [0], [], []) - -AT_DATA([prog8.lst], -[GnuCOBOL V.R.P prog2.cob DDD MMM dd HH:MM:SS YYYY Page 0001 +AT_CHECK([$COMPILE_LISTING -t- -free prog2.cob], [0], +[GnuCOBOL V.R.P prog2.cob Page 0001 LINE .....................SOURCE............................................. @@ -4227,7 +4105,7 @@ LINE .....................SOURCE............................................. 000003 PROGRAM-ID. prog2. 000004 DATA DIVISION. 000005 WORKING-STORAGE SECTION. - GnuCOBOL V.R.P prog2.cob DDD MMM dd HH:MM:SS YYYY Page 0002 + GnuCOBOL V.R.P prog2.cob Page 0002 LINE .....................SOURCE............................................. @@ -4238,9 +4116,7 @@ LINE .....................SOURCE............................................. 0 warnings in compilation group 0 errors in compilation group -]) - -AT_CHECK([gcdiff prog8.lst prog.lst], [0], [], []) +], []) AT_DATA([prog3.cob], [ IDENTIFICATION DIVISION. @@ -4267,10 +4143,8 @@ AT_DATA([prog3.cob], [ STOP RUN. ]) -AT_CHECK([$COMPILE_ONLY -t prog.lst prog3.cob], [0], [], []) - -AT_DATA([prog9.lst], -[GnuCOBOL V.R.P prog3.cob DDD MMM dd HH:MM:SS YYYY Page 0001 +AT_CHECK([$COMPILE_LISTING -t- prog3.cob], [0], +[GnuCOBOL V.R.P prog3.cob Page 0001 LINE PG/LN A...B............................................................ @@ -4283,7 +4157,7 @@ LINE PG/LN A...B............................................................ 000007 DATA DIVISION. 000008 WORKING-STORAGE SECTION. 000009 77 WS-VAR PIC X(2). - GnuCOBOL V.R.P prog3.cob DDD MMM dd HH:MM:SS YYYY Page 0002 + GnuCOBOL V.R.P prog3.cob Page 0002 LINE PG/LN A...B............................................................ @@ -4305,14 +4179,10 @@ LINE PG/LN A...B............................................................ 0 warnings in compilation group 0 errors in compilation group -]) - -AT_CHECK([gcdiff prog9.lst prog.lst], [0], [], []) - -AT_CHECK([$COMPILE_ONLY -t prog.lst -tlines=20 prog3.cob], [0], [], []) +], []) -AT_DATA([prog10.lst], -[GnuCOBOL V.R.P prog3.cob DDD MMM dd HH:MM:SS YYYY Page 0001 +AT_CHECK([$COMPILE_LISTING -t- -tlines=20 prog3.cob], [0], +[GnuCOBOL V.R.P prog3.cob Page 0001 LINE PG/LN A...B............................................................ @@ -4325,7 +4195,7 @@ LINE PG/LN A...B............................................................ 000007 DATA DIVISION. 000008 WORKING-STORAGE SECTION. 000009 77 WS-VAR PIC X(2). - GnuCOBOL V.R.P prog3.cob DDD MMM dd HH:MM:SS YYYY Page 0002 + GnuCOBOL V.R.P prog3.cob Page 0002 LINE PG/LN A...B............................................................ @@ -4346,12 +4216,10 @@ LINE PG/LN A...B............................................................ 0 warnings in compilation group - GnuCOBOL V.R.P prog3.cob DDD MMM dd HH:MM:SS YYYY Page 0003 + GnuCOBOL V.R.P prog3.cob Page 0003 0 errors in compilation group -]) - -AT_CHECK([gcdiff prog10.lst prog.lst], [0], [], []) +], []) AT_CLEANUP @@ -4359,8 +4227,6 @@ AT_CLEANUP AT_SETUP([Cross reference]) AT_KEYWORDS([listing xref]) -AT_CAPTURE_FILE([prog.lst]) - AT_DATA([EDITOR.cob], [ IDENTIFICATION DIVISION. EDIT0001 PROGRAM-ID. EDIT0002 @@ -4688,11 +4554,8 @@ AT_DATA([EDITOR.cob], [ END PROGRAM EDITOR. EDIT0343 ]) -AT_CHECK([$COMPILE_ONLY -Xref -t prog.lst -tlines=0 -ftsymbols EDITOR.cob], [1], [], [ignore]) - - -AT_DATA([prog18.lst], -[GnuCOBOL V.R.P EDITOR.cob DDD MMM dd HH:MM:SS YYYY +AT_CHECK([$COMPILE_LISTING0 -Xref -t- -ftsymbols EDITOR.cob], [1], +[GnuCOBOL V.R.P EDITOR.cob LINE PG/LN A...B............................................................ @@ -5270,33 +5133,10 @@ EDITOR.cob:254: warning: ALTER is obsolete in GnuCOBOL 13 warnings in compilation group 1 error in compilation group -]) +], [ignore]) -AT_CHECK([gcdiff prog18.lst prog.lst], [0], [], []) - -AT_CHECK([$COMPILE_ONLY -Xref -T prog.lst -tlines=0 -ftsymbols EDITOR.cob], [1], [], -[EDITOR.cob:42: warning: LABEL RECORDS is obsolete in GnuCOBOL -EDITOR.cob:44: warning: DATA RECORDS is obsolete in GnuCOBOL -EDITOR.cob:51: warning: LABEL RECORDS is obsolete in GnuCOBOL -EDITOR.cob:53: warning: DATA RECORDS is obsolete in GnuCOBOL -EDITOR.cob:60: warning: LABEL RECORDS is obsolete in GnuCOBOL -EDITOR.cob:62: warning: DATA RECORDS is obsolete in GnuCOBOL -EDITOR.cob:85: warning: LABEL RECORDS is obsolete in GnuCOBOL -EDITOR.cob:87: warning: DATA RECORDS is obsolete in GnuCOBOL -EDITOR.cob:30: error: missing file description for FILE PRT-VERSION -EDITOR.cob: in paragraph 'CHANGE-A-RECORD': -EDITOR.cob:198: warning: ALTER is obsolete in GnuCOBOL -EDITOR.cob:199: warning: ALTER is obsolete in GnuCOBOL -EDITOR.cob: in paragraph 'INSERT-A-RECORD': -EDITOR.cob:220: warning: ALTER is obsolete in GnuCOBOL -EDITOR.cob:221: warning: ALTER is obsolete in GnuCOBOL -EDITOR.cob: in paragraph 'DELETE-A-RECORD': -EDITOR.cob:254: warning: ALTER is obsolete in GnuCOBOL -]) - - -AT_DATA([prog19.lst], -[GnuCOBOL V.R.P EDITOR.cob DDD MMM dd HH:MM:SS YYYY +AT_CHECK([$COMPILE_LISTING0 -Xref -T- -ftsymbols EDITOR.cob], [1], +[GnuCOBOL V.R.P EDITOR.cob LINE PG/LN A...B............................................................SEQUENCE @@ -5856,9 +5696,26 @@ EDITOR.cob:254: warning: ALTER is obsolete in GnuCOBOL 13 warnings in compilation group 1 error in compilation group -]) +], -AT_CHECK([gcdiff prog19.lst prog.lst], [0], [], []) +[EDITOR.cob:42: warning: LABEL RECORDS is obsolete in GnuCOBOL +EDITOR.cob:44: warning: DATA RECORDS is obsolete in GnuCOBOL +EDITOR.cob:51: warning: LABEL RECORDS is obsolete in GnuCOBOL +EDITOR.cob:53: warning: DATA RECORDS is obsolete in GnuCOBOL +EDITOR.cob:60: warning: LABEL RECORDS is obsolete in GnuCOBOL +EDITOR.cob:62: warning: DATA RECORDS is obsolete in GnuCOBOL +EDITOR.cob:85: warning: LABEL RECORDS is obsolete in GnuCOBOL +EDITOR.cob:87: warning: DATA RECORDS is obsolete in GnuCOBOL +EDITOR.cob:30: error: missing file description for FILE PRT-VERSION +EDITOR.cob: in paragraph 'CHANGE-A-RECORD': +EDITOR.cob:198: warning: ALTER is obsolete in GnuCOBOL +EDITOR.cob:199: warning: ALTER is obsolete in GnuCOBOL +EDITOR.cob: in paragraph 'INSERT-A-RECORD': +EDITOR.cob:220: warning: ALTER is obsolete in GnuCOBOL +EDITOR.cob:221: warning: ALTER is obsolete in GnuCOBOL +EDITOR.cob: in paragraph 'DELETE-A-RECORD': +EDITOR.cob:254: warning: ALTER is obsolete in GnuCOBOL +]) AT_CLEANUP @@ -5866,8 +5723,6 @@ AT_CLEANUP AT_SETUP([Report Writer]) AT_KEYWORDS([listing]) -AT_CAPTURE_FILE([prog.lst]) - AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. @@ -5976,10 +5831,8 @@ AT_DATA([prog.cob], [ EXIT. ]) -AT_CHECK([$COMPILE_ONLY -t prog.lst -ftsymbols -Xref -tlines=0 prog.cob], [0], [], []) - -AT_DATA([prog1.lst], -[GnuCOBOL V.R.P prog.cob DDD MMM dd HH:MM:SS YYYY +AT_CHECK([$COMPILE_LISTING0 -t- -ftsymbols -Xref prog.cob], [0], +[GnuCOBOL V.R.P prog.cob LINE PG/LN A...B............................................................ @@ -6164,9 +6017,7 @@ P 199-EXIT 105 87 x1 0 warnings in compilation group 0 errors in compilation group -]) - -AT_CHECK([gcdiff prog1.lst prog.lst], [0], [], []) +], []) AT_CLEANUP @@ -6174,8 +6025,6 @@ AT_CLEANUP AT_SETUP([huge REPLACE]) AT_KEYWORDS([listing]) -AT_CAPTURE_FILE([prog.lst]) - AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. @@ -6298,10 +6147,8 @@ AT_DATA([prog.cob], [ STOP RUN. ]) -AT_CHECK([$COMPILE_ONLY -t prog.lst -tlines=0 prog.cob], [0], [], []) - -AT_DATA([prog1.lst], -[GnuCOBOL V.R.P prog.cob DDD MMM dd HH:MM:SS YYYY +AT_CHECK([$COMPILE_LISTING0 -t- prog.cob], [0], +[GnuCOBOL V.R.P prog.cob LINE PG/LN A...B............................................................ @@ -6729,9 +6576,7 @@ LINE PG/LN A...B............................................................ 0 warnings in compilation group 0 errors in compilation group -]) - -AT_CHECK([gcdiff prog1.lst prog.lst], [0], [], []) +], []) AT_DATA([display.inc], [ DISPLAY 111111111111111111111111111111111111111 @@ -6855,10 +6700,8 @@ AT_DATA([prog.cob], [ STOP RUN. ]) -AT_CHECK([$COMPILE_ONLY -t prog.lst -tlines=0 prog.cob], [0], [], []) - -AT_DATA([prog2.lst], -[GnuCOBOL V.R.P prog.cob DDD MMM dd HH:MM:SS YYYY +AT_CHECK([$COMPILE_LISTING0 -t- prog.cob], [0], +[GnuCOBOL V.R.P prog.cob LINE PG/LN A...B............................................................ @@ -7084,9 +6927,7 @@ LINE PG/LN A...B............................................................ 0 warnings in compilation group 0 errors in compilation group -]) - -AT_CHECK([gcdiff prog2.lst prog.lst], [0], [], []) +], []) AT_CLEANUP @@ -7118,10 +6959,8 @@ PROCEDURE DIVISION. EXIT. ]) -AT_CHECK([$COMPILE_ONLY -t prog.lst -tlines=0 prog.cob], [0], [], []) - -AT_DATA([reference.lst], -[GnuCOBOL V.R.P prog.cob DDD MMM dd HH:MM:SS YYYY +AT_CHECK([$COMPILE_LISTING0 -t- prog.cob], [0], +[GnuCOBOL V.R.P prog.cob LINE PG/LN A...B............................................................ @@ -7165,8 +7004,5 @@ LINE PG/LN A...B............................................................ 0 errors in compilation group ]) -#AT_CHECK([$UNIFY_LISTING prog.lst prog.lis once], [0], [], []) -#AT_CHECK([diff reference.lst prog.lis], [0], [], []) -AT_CHECK([gcdiff -IGnuCOBOL reference.lst prog.lst], [0], [], []) - AT_CLEANUP + diff --git a/tests/testsuite.src/run_misc.at b/tests/testsuite.src/run_misc.at index 77462c459..4eb28a12a 100644 --- a/tests/testsuite.src/run_misc.at +++ b/tests/testsuite.src/run_misc.at @@ -4085,8 +4085,8 @@ AT_CHECK([$COBCRUN_DIRECT ./native], [0], [], []) AT_CLEANUP -AT_SETUP([JUSTIED and VALUE clauses]) -AT_KEYWORDS([runmisc JUST INITIALIZE ibm]) +AT_SETUP([JUSTIFIED and VALUE clauses]) +AT_KEYWORDS([runmisc JUST RIGHT INITIALIZE ibm]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. @@ -4111,6 +4111,14 @@ AT_DATA([prog.cob], [ 77 ELE PIC X(10) VALUE 'RIGHT' JUSTIFIED RIGHT. + 77 ELE2 PIC X(10) + VALUE 'R' JUSTIFIED RIGHT. + 77 ELE3 PIC X(10) + VALUE 'RRRRRRRRR' JUSTIFIED RIGHT. + 77 ELE4 PIC X(10) + VALUE 'RRRRRRRRRR' JUSTIFIED RIGHT. + 77 ELE5 PIC X(1003) + VALUE 'RRR' JUSTIFIED RIGHT. PROCEDURE DIVISION. @@ -4120,13 +4128,30 @@ AT_DATA([prog.cob], [ PERFORM 2000-JUSTIFY-IS-OFF THRU 2000-EXIT. >>END-IF + IF ELE4 NOT EQUAL 'RRRRRRRRRR' + DISPLAY 'ELE4 NOT INITIALIZED CORRECTLY' ELE4 + END-IF. + STOP RUN. 1000-JUSTIFY-IS-RIGHT. IF ELE NOT EQUAL ' RIGHT' - DISPLAY 'ELE NOT INITIALIZED CORRECTLY' + DISPLAY 'ELE NOT INITIALIZED CORRECTLY ' ELE + END-IF. + + IF ELE2 NOT EQUAL ' R' + DISPLAY 'ELE2 NOT INITIALIZED CORRECTLY ' ELE2 + END-IF. + + IF ELE3 NOT EQUAL ' RRRRRRRRR' + DISPLAY 'ELE3 NOT INITIALIZED CORRECTLY ' ELE3 + END-IF. + + IF ELE5 (1:1000) NOT EQUAL SPACES + OR ELE5 (1001:) NOT EQUAL "RRR" + DISPLAY 'ELE5 NOT INITIALIZED CORRECTLY ' ELE5 END-IF. IF ARR-FLD1 (2) NOT EQUAL ' RIGHT' @@ -4209,7 +4234,20 @@ AT_DATA([prog.cob], [ 2000-JUSTIFY-IS-OFF. IF ELE NOT EQUAL 'RIGHT ' - DISPLAY 'ELE NOT INITIALIZED CORRECTLY' + DISPLAY 'ELE NOT INITIALIZED CORRECTLY ' ELE + END-IF. + + IF ELE2 NOT EQUAL 'R ' + DISPLAY 'ELE2 NOT INITIALIZED CORRECTLY ' ELE2 + END-IF. + + IF ELE3 NOT EQUAL 'RRRRRRRRR ' + DISPLAY 'ELE3 NOT INITIALIZED CORRECTLY ' ELE3 + END-IF. + + IF ELE5 (1:3) NOT EQUAL "RRR" + OR ELE5 (4:) NOT EQUAL SPACES + DISPLAY 'ELE5 NOT INITIALIZED CORRECTLY ' ELE5 END-IF. IF ARR-FLD1 (2) NOT EQUAL 'RIGHT ' diff --git a/tests/testsuite.src/syn_definition.at b/tests/testsuite.src/syn_definition.at index b2d4e61b4..32db8e3b7 100644 --- a/tests/testsuite.src/syn_definition.at +++ b/tests/testsuite.src/syn_definition.at @@ -390,11 +390,11 @@ AT_DATA([prog.cob], [ E-3. ]) -AT_CHECK([$COBC -fsyntax-only prog.cob], [0], [], +AT_CHECK([$COBC -fdiagnostics-plain-output -fsyntax-only prog.cob], [0], [], [prog.cob: in section 'S-1': prog.cob:6: warning: GO TO SECTION 'S-2' [[-Wgoto-section]] ]) -AT_CHECK([$COBC -fsyntax-only -Wall -Werror=goto-section prog.cob], [1], [], +AT_CHECK([$COBC -fdiagnostics-plain-output -fsyntax-only -Wall -Werror=goto-section prog.cob], [1], [], [prog.cob: in section 'S-1': prog.cob:6: error: GO TO SECTION 'S-2' [[-Werror=goto-section]] prog.cob: in section 'S-2': diff --git a/tests/testsuite.src/syn_misc.at b/tests/testsuite.src/syn_misc.at index 1db8fcf4d..d4653aa6f 100644 --- a/tests/testsuite.src/syn_misc.at +++ b/tests/testsuite.src/syn_misc.at @@ -827,11 +827,11 @@ AT_CHECK([$COMPILE_ONLY prog3.cob], [1], [], [prog3.cob:1: error: PROGRAM-ID header missing ]) -AT_CHECK([$COMPILE -frelax-syntax-checks prog3.cob], [0], [], +AT_CHECK([$COMPILE -fdiagnostics-plain-output -frelax-syntax-checks prog3.cob], [0], [], [prog3.cob:1: warning: PROGRAM-ID header missing prog3.cob:1: note: PROGRAM-ID header assumed ]) -AT_CHECK([$COBC -frelax-syntax-checks prog3.cob], [0], [], +AT_CHECK([$COBC -fdiagnostics-plain-output -frelax-syntax-checks prog3.cob], [0], [], [prog3.cob:1: warning: PROGRAM-ID header missing [[-Wothers]] prog3.cob:1: note: PROGRAM-ID header assumed [[-Wothers]] ]) @@ -1857,20 +1857,20 @@ AT_DATA([prog_tmpl.cob], [ # AT_DATA workaround via sed: AT_CHECK([$SED -e 's/_$//' prog_tmpl.cob > prog.cob], [0], [], []) -AT_CHECK([$COBC -fsyntax-only -fixed -Wextra prog.cob], [0], [], +AT_CHECK([$COBC -fsyntax-only -fdiagnostics-plain-output -fixed -Wextra prog.cob], [0], [], [prog.cob:7: warning: source text exceeds 512 bytes, will be truncated [[-Wothers]] prog.cob:8: warning: source text exceeds 512 bytes, will be truncated [[-Wothers]] prog.cob:11: warning: source text after program-text area (column 72) [[-Wdangling-text]] ]) -AT_CHECK([$COBC -fsyntax-only -free -Wextra prog.cob], [1], [], +AT_CHECK([$COBC -fsyntax-only -fdiagnostics-plain-output -free -Wextra prog.cob], [1], [], [prog.cob:7: warning: source text exceeds 512 bytes, will be truncated [[-Wothers]] prog.cob:8: warning: source text exceeds 512 bytes, will be truncated [[-Wothers]] prog.cob:8: error: syntax error, unexpected IS, expecting SECTION or . prog.cob:8: note: unknown statement 'This' ]) -AT_CHECK([$COBC -fsyntax-only -F -Wextra prog.cob], [1], [], +AT_CHECK([$COBC -fsyntax-only -fdiagnostics-plain-output -F -Wextra prog.cob], [1], [], [prog.cob:7: warning: source text exceeds 512 bytes, will be truncated [[-Wothers]] prog.cob:8: warning: source text exceeds 512 bytes, will be truncated [[-Wothers]] prog.cob:8: error: syntax error, unexpected IS, expecting SECTION or . @@ -1878,7 +1878,7 @@ prog.cob:8: note: unknown statement 'This' ]) # Check dialect option `format` (fixed for default) does not erase flags like `-F`, `--free`: -AT_CHECK([$COBC -fsyntax-only -F -std=default -Wextra prog.cob], [1], [], +AT_CHECK([$COBC -fsyntax-only -fdiagnostics-plain-output -F -std=default -Wextra prog.cob], [1], [], [prog.cob:7: warning: source text exceeds 512 bytes, will be truncated [[-Wothers]] prog.cob:8: warning: source text exceeds 512 bytes, will be truncated [[-Wothers]] prog.cob:8: error: syntax error, unexpected IS, expecting SECTION or . @@ -1907,10 +1907,10 @@ AT_CHECK([$COMPILE_ONLY prog.cob], [0], [], # fixing the initial setup but now producing a missing newline: printf " CONTINUE." >> prog.cob -AT_CHECK([$COBC -fsyntax-only -Wextra -fixed prog.cob], [0], [], +AT_CHECK([$COBC -fsyntax-only -fdiagnostics-plain-output -Wextra -fixed prog.cob], [0], [], [prog.cob:8: warning: line not terminated by a newline [[-Wmissing-newline]] ]) -AT_CHECK([$COBC -fsyntax-only -Wextra -free prog.cob], [0], [], +AT_CHECK([$COBC -fsyntax-only -fdiagnostics-plain-output -Wextra -free prog.cob], [0], [], [prog.cob:8: warning: line not terminated by a newline [[-Wmissing-newline]] ]) diff --git a/tests/testsuite.src/syn_redefines.at b/tests/testsuite.src/syn_redefines.at index d2a9abc4a..ad03a623e 100644 --- a/tests/testsuite.src/syn_redefines.at +++ b/tests/testsuite.src/syn_redefines.at @@ -330,7 +330,7 @@ AT_DATA([prog.cob], [ STOP RUN. ]) -AT_CHECK([$COBC -Wextra prog.cob], [1], [], +AT_CHECK([$COBC -fdiagnostics-plain-output -Wextra prog.cob], [1], [], [[prog.cob:8: error: larger REDEFINES used prog.cob:8: note: size of 'A' larger than size of 'X' [-Wdialect] prog.cob:11: error: larger REDEFINES used @@ -342,7 +342,7 @@ prog.cob:17: warning: size of 'FILLER 1' larger than size of 'WRK-X2' [-Wlarger- # of course, other dialects ignore the rules, implicit adding a FILLER to the original item... AT_CHECK([$COBC -std=mf prog.cob], [0], [], []) -AT_CHECK([$COBC -flarger-redefines=warning prog.cob], [0], [], +AT_CHECK([$COBC -fdiagnostics-plain-output -flarger-redefines=warning prog.cob], [0], [], [[prog.cob:8: warning: larger REDEFINES used [-Wdialect] prog.cob:8: note: size of 'A' larger than size of 'X' [-Wdialect] prog.cob:11: warning: larger REDEFINES used [-Wdialect] diff --git a/tests/testsuite.src/used_binaries.at b/tests/testsuite.src/used_binaries.at index a464e5df9..058f8a054 100644 --- a/tests/testsuite.src/used_binaries.at +++ b/tests/testsuite.src/used_binaries.at @@ -69,19 +69,19 @@ AT_DATA([prog.cob],[ ]) AT_CHECK([$COBC -fsyntax-only prog.cob], [0], [], []) # increasing to more warnings -AT_CHECK([$COBC -fsyntax-only -Wadditional prog.cob], [0], [], +AT_CHECK([$COBC -fsyntax-only -fdiagnostics-plain-output -Wadditional prog.cob], [0], [], [prog.cob:9: warning: PERFORM FOREVER since UNTIL is always FALSE [[-Wadditional]] ]) -AT_CHECK([$COBC -fsyntax-only -fno-diagnostics-show-option -Wadditional prog.cob], [0], [], +AT_CHECK([$COBC -fsyntax-only -fdiagnostics-plain-output -fno-diagnostics-show-option -Wadditional prog.cob], [0], [], [prog.cob:9: warning: PERFORM FOREVER since UNTIL is always FALSE ]) # which in this case is also included in -Wall -AT_CHECK([$COBC -fsyntax-only -Wall prog.cob], [0], [], +AT_CHECK([$COBC -fsyntax-only -fdiagnostics-plain-output -Wall prog.cob], [0], [], [prog.cob:9: warning: expression '0' EQUALS '1' is always FALSE [[-Wconstant-numlit-expression]] prog.cob:9: warning: PERFORM FOREVER since UNTIL is always FALSE [[-Wadditional]] ]) # -Wextra is more descriptive ... -AT_CHECK([$COBC -fsyntax-only -Wextra prog.cob], [0], [], +AT_CHECK([$COBC -fsyntax-only -fdiagnostics-plain-output -Wextra prog.cob], [0], [], [prog.cob:9: warning: expression '0' EQUALS '1' is always FALSE [[-Wconstant-numlit-expression]] prog.cob:9: warning: PERFORM FOREVER since UNTIL is always FALSE [[-Wadditional]] prog.cob:10: warning: DISPLAY statement not terminated by END-DISPLAY [[-Wterminator]] @@ -90,7 +90,7 @@ prog.cob:7: note: 'var2' defined here as PIC 99 [[-Wpossible-truncate]] prog.cob:6: note: 'var1' defined here as PIC 9 [[-Wpossible-truncate]] ]) # ... the old -W is in for backwards portability -AT_CHECK([$COBC -fsyntax-only -W prog.cob], [0], [], +AT_CHECK([$COBC -fsyntax-only -fdiagnostics-plain-output -W prog.cob], [0], [], [prog.cob:9: warning: expression '0' EQUALS '1' is always FALSE [[-Wconstant-numlit-expression]] prog.cob:9: warning: PERFORM FOREVER since UNTIL is always FALSE [[-Wadditional]] prog.cob:10: warning: DISPLAY statement not terminated by END-DISPLAY [[-Wterminator]] @@ -101,26 +101,26 @@ prog.cob:6: note: 'var1' defined here as PIC 9 [[-Wpossible-truncate]] # a global "error" use implies no warning settings AT_CHECK([$COBC -fsyntax-only -Werror prog.cob], [0], [], []) # a concrete "error" use implies setting the warning -AT_CHECK([$COBC -fsyntax-only -Werror=additional prog.cob], [1], [], +AT_CHECK([$COBC -fsyntax-only -fdiagnostics-plain-output -Werror=additional prog.cob], [1], [], [prog.cob:9: error: PERFORM FOREVER since UNTIL is always FALSE [[-Werror=additional]] ]) -AT_CHECK([$COBC -fsyntax-only -fno-diagnostics-show-option -Werror=additional prog.cob], [1], [], +AT_CHECK([$COBC -fsyntax-only -fdiagnostics-plain-output -fno-diagnostics-show-option -Werror=additional prog.cob], [1], [], [prog.cob:9: error: PERFORM FOREVER since UNTIL is always FALSE ]) # a "no-error" use implies nothing AT_CHECK([$COBC -fsyntax-only -Wno-error=additional prog.cob], [0], [], []) # ... now combined AT_CHECK([$COBC -fsyntax-only -Werror -Wno-error=additional prog.cob], [0], [], []) -AT_CHECK([$COBC -fsyntax-only -Werror=additional -Wno-error prog.cob], [1], [], +AT_CHECK([$COBC -fsyntax-only -fdiagnostics-plain-output -Werror=additional -Wno-error prog.cob], [1], [], [prog.cob:9: error: PERFORM FOREVER since UNTIL is always FALSE [[-Werror=additional]] ]) -AT_CHECK([$COBC -fsyntax-only -w -Werror=additional prog.cob], [1], [], +AT_CHECK([$COBC -fsyntax-only -fdiagnostics-plain-output -w -Werror=additional prog.cob], [1], [], [prog.cob:9: error: PERFORM FOREVER since UNTIL is always FALSE [[-Werror=additional]] ]) -AT_CHECK([$COBC -fsyntax-only -w -Wadditional prog.cob], [0], [], +AT_CHECK([$COBC -fsyntax-only -fdiagnostics-plain-output -w -Wadditional prog.cob], [0], [], [prog.cob:9: warning: PERFORM FOREVER since UNTIL is always FALSE [[-Wadditional]] ]) -AT_CHECK([$COBC -fsyntax-only -w -Wpossible-truncate prog.cob], [0], [], +AT_CHECK([$COBC -fsyntax-only -fdiagnostics-plain-output -w -Wpossible-truncate prog.cob], [0], [], [prog.cob:13: warning: some digits may be truncated [[-Wpossible-truncate]] prog.cob:7: note: 'var2' defined here as PIC 99 [[-Wpossible-truncate]] prog.cob:6: note: 'var1' defined here as PIC 9 [[-Wpossible-truncate]] @@ -151,17 +151,17 @@ AT_DATA([prog2.cob], [ STOP RUN. ]) -AT_CHECK([$COBC -Wall -fsyntax-only prog2.cob], [1], [], +AT_CHECK([$COBC -fsyntax-only -fdiagnostics-plain-output -Wall prog2.cob], [1], [], [prog2.cob:7: error: CRUD.CPY: No such file or directory prog2.cob:6: warning: numeric value is expected [[-Wothers]] ]) -AT_CHECK([$COBC -fsyntax-only -fmax-errors=0 prog2.cob], [1], [], +AT_CHECK([$COBC -fsyntax-only -fdiagnostics-plain-output -fmax-errors=0 prog2.cob], [1], [], [prog2.cob:7: error: CRUD.CPY: No such file or directory prog2.cob:6: warning: numeric value is expected [[-Wothers]] ]) -AT_CHECK([$COBC -fsyntax-only -Wfatal-errors prog2.cob], [97], [], +AT_CHECK([$COBC -fsyntax-only -fdiagnostics-plain-output -Wfatal-errors prog2.cob], [97], [], [prog2.cob:7: error: CRUD.CPY: No such file or directory cobc: too many errors [[-Wfatal-errors]] @@ -948,8 +948,7 @@ AT_DATA([progprep.cob],[ # Testcase includes trailing whitespace, setup by dropping '#' AT_CHECK([cat progprep.cob | tr -d '#' > prog.cob]) -# note: $COBC has -fdiagnostics-plain-output -AT_CHECK([$COBC -Wall -fsyntax-only prog.cob], [1], [], +AT_CHECK([$COBC -fdiagnostics-plain-output -Wall prog.cob], [1], [], [[prog.cob:7: error: CRUD.CPY: No such file or directory prog.cob:6: warning: numeric value is expected [-Wothers] prog.cob:14: warning: ignoring redundant . [-Wothers] @@ -974,7 +973,7 @@ prog.cob:14: warning: ignoring redundant . [-Wothers] 15 | <EOF> ]]) -AT_CHECK([$COBC -fdiagnostics-show-caret prog.cob], [1], [], +AT_CHECK([$COBC -fdiagnostics-plain-output -fdiagnostics-show-caret prog.cob], [1], [], [[prog.cob:7: error: CRUD.CPY: No such file or directory WORKING-STORAGE SECTION. 01 TEST-VAR PIC 9(2) VALUE 'A'. @@ -1000,7 +999,7 @@ AT_DATA([longgy.cob],[dddddddddddddddddddddddddddddddddddddddddddddddddddddddddd # note: this is actually an error in the parser line number, # but until that is solved, it is a nice edge case of "line not available" -AT_CHECK([$COBC -Wno-others -fdiagnostics-show-caret longgy.cob], [1], [], +AT_CHECK([$COBC -fdiagnostics-plain-output -fdiagnostics-show-caret -Wno-others longgy.cob], [1], [], [[longgy.cob:2: error: PROGRAM-ID header missing dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd.. > <EOF>