Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 16 additions & 5 deletions cobj/codegen.c
Original file line number Diff line number Diff line change
Expand Up @@ -5544,11 +5544,12 @@ static void joutput_declare_member_variables(struct cb_program *prog,
prevprog = blp->curr_prog;
joutput_prefix();
joutput("/* PROGRAM-ID : %s */\n", prevprog);
joutput_prefix();
joutput("private CobolDataStorage %s;", base_name, blp->f->memory_size);
}
joutput_prefix();
if (strcmp(blp->f->name, "RETURN-CODE") == 0) {
joutput("public CobolDataStorage %s;", base_name);
} else {
joutput_prefix();
joutput("private CobolDataStorage %s;", base_name, blp->f->memory_size);
joutput("private CobolDataStorage %s;", base_name);
}
free(base_name);
joutput("\t/* %s */\n", blp->f->name);
Expand Down Expand Up @@ -6237,8 +6238,18 @@ void codegen(struct cb_program *prog, const int nested, char **program_id_list,
//}

joutput_line("CobolDecimal.cobInitNumeric();");
joutput_line("new %s().%s_(0);", prog->program_id, prog->program_id);
if (cb_enable_program_status_register) {
joutput_line("%s $module$ = new %s();", prog->program_id, prog->program_id);
joutput_line("$module$.%s_(0);", prog->program_id);
} else {
joutput_line("new %s().%s_(0);", prog->program_id, prog->program_id);
}
joutput_line("CobolStopRunException.stopRun();");

if (cb_enable_program_status_register) {
joutput_line("System.exit($module$.b_RETURN_CODE.intValue());");
}

joutput_indent_level -= 2;
joutput_line("}\n");

Expand Down
2 changes: 1 addition & 1 deletion tests/jp-compat.src/job-date.at
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ AT_DATA([prog.cob], [
])

AT_CHECK([${COMPILE_JP_COMPAT} prog.cob])
AT_CHECK([COB_DATE=`date +%Y/%m/%d` java prog], [0], [0
AT_CHECK([COB_DATE=`date +%Y/%m/%d` java prog || true], [0], [0
])

AT_CLEANUP
1 change: 0 additions & 1 deletion tests/jp-compat.src/spl-registers.at
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
AT_SETUP([PROGRAM-STATUS])
AT_CHECK([${SKIP_TEST}])

AT_DATA([prog.cob], [
IDENTIFICATION DIVISION.
Expand Down