#include "convert.h"
#include "a68.h"
+#include "a68-pretty-print.h"
/* Note that enclosed clauses, which are units, are handled in
a68-low-clauses. */
s = SUB (p);
type = CTYPE (moid);
+ errno = 0;
+#if defined(INT64_T_IS_LONG)
int64_t val = strtol (NSYMBOL (s), &end, 10);
+#else
+ int64_t val = strtoll (NSYMBOL (s), &end, 10);
+#endif
gcc_assert (end[0] == '\0');
+ if (errno == ERANGE || val > wi::max_value (type).to_shwi ())
+ {
+ a68_moid_format_token m (moid);
+ a68_error (s, "denotation is too large for %e", &m);
+ }
+
return build_int_cst (type, val);
}
if (moid == M_BITS
--- /dev/null
+{ dg-options {-fstropping=supper} }
+begin int i0 := 123456789012345678901234567890; { dg-error "denotation is too large for int" }
+ skip
+end
--- /dev/null
+{ dg-options {-fstropping=supper} }
+{ dg-require-effective-target int32 }
+begin int i0 := 2147483648; { dg-error "denotation is too large for int" }
+ int i1 := 2147483647;
+ skip
+end
--- /dev/null
+{ dg-options {-fstropping=supper} }
+{ dg-require-effective-target longlong64 }
+begin long long int i0 := long long 9223372036854775808; { dg-error "denotation is too large for long long int" }
+ long long int i1 := long long 9223372036854775807;
+ skip
+end
i PLUSAB SHORT 100;
ASSERT (i = SHORT 1200)
END;
- BEGIN SHORT SHORT INT i := SHORT SHORT 10000;
- i +:= SHORT SHORT 1000;
- ASSERT (i = SHORT SHORT 11000);
- i PLUSAB SHORT SHORT 1000;
- ASSERT (i = SHORT SHORT 12000)
+ BEGIN SHORT SHORT INT i := SHORT SHORT 100;
+ i +:= SHORT SHORT 10;
+ ASSERT (i = SHORT SHORT 110);
+ i PLUSAB SHORT SHORT 10;
+ ASSERT (i = SHORT SHORT 120)
END;
BEGIN LONG INT i := LONG 1000;