From b605dbfcf04f310e08634b52507da7a4155bfce1 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Mon, 13 Dec 2021 12:58:18 +0100 Subject: treewide: rework numeric value handling - Parse integer literals as unsigned numeric values in order to be able to represent the entire unsigned 64bit value range - Stop parsing minus-prefixed integer literals as negative numbers but treat them as separate minus operator followed by a positive integer instead - Only store unsigned numeric constants in bytecode - Rework numeric comparison logic to be able to handle full 64bit unsigned integers - If possible, yield unsigned 64 bit results for additions - Simplify numeric value conversion API - Compile code with -fwrapv for defined signed overflow semantics Signed-off-by: Jo-Philipp Wich --- tests/custom/00_syntax/10_numeric_literals | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'tests/custom/00_syntax/10_numeric_literals') diff --git a/tests/custom/00_syntax/10_numeric_literals b/tests/custom/00_syntax/10_numeric_literals index 3e367d0..7aa49b6 100644 --- a/tests/custom/00_syntax/10_numeric_literals +++ b/tests/custom/00_syntax/10_numeric_literals @@ -12,7 +12,7 @@ Special values: Infinity, Infinity, NaN, NaN Minimum values: -9223372036854775808, -1.79769e+308 Maximum values: 9223372036854775807, 1.79769e+308 Minimum truncation: -9223372036854775808, -Infinity -Maximum truncation: 9223372036854775807, Infinity +Maximum truncation: 18446744073709551615, Infinity -- End -- -- Testcase -- @@ -21,6 +21,6 @@ Float literals: {{ 10. }}, {{ 10.3 }}, {{ 123.456e-67 }}, {{ 0x10.1 }} Special values: {{ Infinity }}, {{ 1 / 0 }}, {{ NaN }}, {{ "x" / 1 }} Minimum values: {{ -9223372036854775808 }}, {{ -1.7976931348623158e+308 }} Maximum values: {{ 9223372036854775807 }}, {{ 1.7976931348623158e+308 }} -Minimum truncation: {{ -10000000000000000000 }}, {{ -1.0e309 }} -Maximum truncation: {{ 10000000000000000000 }}, {{ 1.0e309 }} +Minimum truncation: {{ -100000000000000000000 }}, {{ -1.0e309 }} +Maximum truncation: {{ 100000000000000000000 }}, {{ 1.0e309 }} -- End -- -- cgit v1.2.3