aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/cobol.dg/literal1.cob
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/cobol.dg/literal1.cob')
-rw-r--r--gcc/testsuite/cobol.dg/literal1.cob14
1 files changed, 14 insertions, 0 deletions
diff --git a/gcc/testsuite/cobol.dg/literal1.cob b/gcc/testsuite/cobol.dg/literal1.cob
new file mode 100644
index 0000000..43369e0
--- /dev/null
+++ b/gcc/testsuite/cobol.dg/literal1.cob
@@ -0,0 +1,14 @@
+*> { dg-do run }
+*> Make sure we properly round to integer when computing the initial
+*> binary representation of a literal
+IDENTIFICATION DIVISION.
+PROGRAM-ID. literal1.
+DATA DIVISION.
+WORKING-STORAGE SECTION.
+ 77 VAR8 PIC 999V9(8) COMP-5 .
+ 77 VAR555 PIC 999V99999999 COMP-5 VALUE 555.55555555.
+ PROCEDURE DIVISION.
+ MOVE 555.55555555 TO VAR8
+ ADD 0.00000001 TO VAR555 GIVING VAR8 ROUNDED
+ IF VAR8 NOT EQUAL TO 555.55555556 STOP RUN ERROR 1.
+ END PROGRAM literal1.