diff --git a/cobj/codegen.c b/cobj/codegen.c index 615ea2ed..2d233a0f 100644 --- a/cobj/codegen.c +++ b/cobj/codegen.c @@ -1973,7 +1973,7 @@ static void joutput_cond(cb_tree x, int save_flag) { } joutput_indent("(new GetInt() {"); joutput_indent_level += 2; - joutput_indent("public int run(){"); + joutput_indent("public int run() throws CobolStopRunException {"); joutput_indent_level += 2; for (; x; x = CB_CHAIN(x)) { // 最後の文ならreturn文を書く diff --git a/libcobj/app/src/main/java/jp/osscons/opensourcecobol/libcobj/common/GetInt.java b/libcobj/app/src/main/java/jp/osscons/opensourcecobol/libcobj/common/GetInt.java index cacc233e..3dd2ffcb 100644 --- a/libcobj/app/src/main/java/jp/osscons/opensourcecobol/libcobj/common/GetInt.java +++ b/libcobj/app/src/main/java/jp/osscons/opensourcecobol/libcobj/common/GetInt.java @@ -18,12 +18,15 @@ */ package jp.osscons.opensourcecobol.libcobj.common; +import jp.osscons.opensourcecobol.libcobj.exceptions.CobolStopRunException; + /** TODO: 準備中 */ public interface GetInt { /** * TODO: 準備中 * * @return TODO: 準備中 + * @throws CobolStopRunException TODO: 準備中 */ - int run(); + int run() throws CobolStopRunException; } diff --git a/tests/Makefile.am b/tests/Makefile.am index 9841b799..d12e5eb5 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -220,7 +220,8 @@ misc_DEPENDENCIES = \ misc.src/japanese-char-section-var.at \ misc.src/evaluate-switch.at \ misc.src/fserial-variable.at \ - misc.src/file-handler-japanese.at + misc.src/file-handler-japanese.at \ + misc.src/perform-until-div.at EXTRA_DIST = $(srcdir)/package.m4 \ $(TESTS) \ diff --git a/tests/Makefile.in b/tests/Makefile.in index dad91307..64a8f7bc 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -759,7 +759,8 @@ misc_DEPENDENCIES = \ misc.src/japanese-char-section-var.at \ misc.src/evaluate-switch.at \ misc.src/fserial-variable.at \ - misc.src/file-handler-japanese.at + misc.src/file-handler-japanese.at \ + misc.src/perform-until-div.at EXTRA_DIST = $(srcdir)/package.m4 \ $(TESTS) \ diff --git a/tests/misc.at b/tests/misc.at index 7f8a6157..449c5271 100644 --- a/tests/misc.at +++ b/tests/misc.at @@ -50,3 +50,4 @@ m4_include([japanese-char-section-var.at]) m4_include([evaluate-switch.at]) m4_include([fserial-variable.at]) m4_include([file-handler-japanese.at]) +m4_include([perform-until-div.at]) diff --git a/tests/misc.src/perform-until-div.at b/tests/misc.src/perform-until-div.at new file mode 100644 index 00000000..db986153 --- /dev/null +++ b/tests/misc.src/perform-until-div.at @@ -0,0 +1,25 @@ +AT_SETUP([PERFORM UNTIL whose condition contains division]) + +AT_DATA([prog.cbl], [ + IDENTIFICATION DIVISION. + PROGRAM-ID. prog. + DATA DIVISION. + WORKING-STORAGE SECTION. + 01 CNT PIC 9(4) VALUE 1000. + 01 I PIC 9(4) VALUE 1. + PROCEDURE DIVISION. + MAIN. + PERFORM + VARYING I + FROM 1 BY 1 + UNTIL I > (CNT + 743) / 744 + PERFORM SUB + END-PERFORM + STOP RUN. + SUB. + DISPLAY "HELLO". +]) + +AT_CHECK([${COBJ} prog.cbl]) + +AT_CLEANUP