From 1cc276cb43462ba97a94cdc0fe9f24f3ea55d355 Mon Sep 17 00:00:00 2001 From: ychenfo Date: Tue, 8 Mar 2022 22:23:13 +0800 Subject: [PATCH] nac3standalone: add test for max function --- nac3standalone/demo/src/min_max_abs.py | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/nac3standalone/demo/src/min_max_abs.py b/nac3standalone/demo/src/min_max_abs.py index fa99a39f..81dbb3f6 100644 --- a/nac3standalone/demo/src/min_max_abs.py +++ b/nac3standalone/demo/src/min_max_abs.py @@ -16,6 +16,7 @@ def output_float64(x: float): def run() -> int32: + # min =========== output_int32(int32(min(True, False))) output_int32(int32(min(True, True))) output_int32(int32(min(False, False))) @@ -39,4 +40,29 @@ def run() -> int32: output_float64(min(-12.234, 3.23)) output_float64(min(0.1, 12.3)) output_float64(min(1.1, 1.1)) + + # max =========== + output_int32(int32(max(True, False))) + output_int32(int32(max(True, True))) + output_int32(int32(max(False, False))) + + output_int32(max(-12, 0)) + output_int32(max(1, -3)) + output_int32(max(2, 2)) + + output_int64(max(int64(-12), int64(0))) + output_int64(max(int64(1), int64(-3))) + output_int64(max(int64(2), int64(2))) + + output_uint32(max(uint32(12), uint32(0))) + output_uint32(max(uint32(12), uint32(24))) + output_uint32(max(uint32(2), uint32(2))) + + output_uint64(max(uint64(12), uint64(0))) + output_uint64(max(uint64(12), uint64(24))) + output_uint64(max(uint64(2), uint64(2))) + + output_float64(max(-12.234, 3.23)) + output_float64(max(0.1, 12.3)) + output_float64(max(1.1, 1.1)) return 0