From bdedc4f90c385581ab54c1a7839c4f169e9a1c89 Mon Sep 17 00:00:00 2001 From: Aaron Delasy Date: Tue, 15 Oct 2024 01:40:59 +0300 Subject: [PATCH] codegen: Fix some tests Type cast primitive types --- packages/codegen/src/codegen | 23 ++++- .../test/codegen/as-expression-root.txt | 66 +++++++------- .../codegen/test/codegen/as-expression.txt | 89 ++++++++----------- .../codegen/loop-statement-with-reference.txt | 12 +-- .../codegen/test/codegen/map-expression.txt | 40 ++++----- .../codegen/test/codegen/unary-expression.txt | 52 +++++------ 6 files changed, 141 insertions(+), 141 deletions(-) diff --git a/packages/codegen/src/codegen b/packages/codegen/src/codegen index 618d15a8a..736b88ab7 100644 --- a/packages/codegen/src/codegen +++ b/packages/codegen/src/codegen @@ -1567,7 +1567,20 @@ export obj Codegen { } expression := item.asAs() - return self._generateExpression(ref expression.expression) + + if !(item.contextExtra is Analyzer.AsExpressionContextExtra) { + throw error_NewError("Expected AsExpression context extra") + } + + initialType := Analyzer.contextInitial(item) + contextExtra := item.contextExtra as Analyzer.AsExpressionContextExtra + result := self._generateExpression(ref expression.expression) + + if Analyzer.match(contextExtra.fromType, initialType) { + return result + } + + return self._wrap(result, item, contextExtra.fromType, initialType) } fn _generateAssignmentExpression (mut self: ref Codegen, item: ref Parser.Expression) AST.CExpression? { @@ -3230,6 +3243,14 @@ export obj Codegen { AST.createPropertyAccessExpression(expression, "data"), "v" + typeDefIdx.str(), ) + } elif !Analyzer.match(t, targetType) && ( + targetType.name == "bool" || + targetType.name == "byte" || + targetType.name == "char" || + targetType.name == "rune" || + targetType.isNumber() + ) { + expression = AST.createCastExpression(AST.createType(self._type(targetType)), expression) } if !transform { diff --git a/packages/codegen/test/codegen/as-expression-root.txt b/packages/codegen/test/codegen/as-expression-root.txt index d172e210d..5631be503 100644 --- a/packages/codegen/test/codegen/as-expression-root.txt +++ b/packages/codegen/test/codegen/as-expression-root.txt @@ -24,15 +24,12 @@ main { c as f64; d: byte = 65; - d as i8; d as u8; d as char; d as int; d as float; e := 'a'; - e as i8; - e as u8; e as int; e as float; @@ -52,42 +49,39 @@ int main (void) { unsigned char d_0; wchar_t e_0; bool f_0; - int8_t a_0 = 10; - a_0; - a_0; - a_0; - a_0; - a_0; - a_0; - a_0; - b_0 = 10; - b_0; - b_0; - b_0; - b_0; - b_0; - b_0; + int8_t a_0 = (int8_t) 10; + (int16_t) a_0; + (int32_t) a_0; + (int32_t) a_0; + (int64_t) a_0; + (double) a_0; + (float) a_0; + (double) a_0; + b_0 = (uint8_t) 10; + (uint16_t) b_0; + (uint32_t) b_0; + (uint64_t) b_0; + (double) b_0; + (float) b_0; + (double) b_0; c_0 = 10; - c_0; - c_0; - c_0; - c_0; - c_0; + (int32_t) c_0; + (int64_t) c_0; + (double) c_0; + (float) c_0; + (double) c_0; d_0 = 65; - d_0; - d_0; - d_0; - d_0; - d_0; + (uint8_t) d_0; + (char) d_0; + (int32_t) d_0; + (double) d_0; e_0 = L'a'; - e_0; - e_0; - e_0; - e_0; + (int32_t) e_0; + (double) e_0; f_0 = true; - f_0; - f_0; - f_0; - f_0; + (int8_t) f_0; + (uint8_t) f_0; + (int32_t) f_0; + (double) f_0; } ===== output ===== diff --git a/packages/codegen/test/codegen/as-expression.txt b/packages/codegen/test/codegen/as-expression.txt index 53bbe0b7f..5f74453ca 100644 --- a/packages/codegen/test/codegen/as-expression.txt +++ b/packages/codegen/test/codegen/as-expression.txt @@ -24,15 +24,12 @@ main { print(c as f64) d: byte = 65 - print(d as i8) print(d as u8) print(d as char) print(d as int) print(d as float) e := 'a' - print(e as i8) - print(e as u8) print(e as int) print(e as float) @@ -63,12 +60,12 @@ main { #define TYPE_u16 8 #define TYPE_u32 9 #define TYPE_u64 10 -#define TYPE_i8 11 -#define TYPE_u8 12 -#define TYPE_char 13 +#define TYPE_u8 11 +#define TYPE_char 12 +#define TYPE_i8 13 +D4_ANY_DECLARE(i8, int8_t) D4_ANY_DECLARE(char, char) D4_ANY_DECLARE(u8, uint8_t) -D4_ANY_DECLARE(i8, int8_t) D4_ANY_DECLARE(u64, uint64_t) D4_ANY_DECLARE(u32, uint32_t) D4_ANY_DECLARE(u16, uint16_t) @@ -79,9 +76,9 @@ D4_ANY_DECLARE(i64, int64_t) D4_ANY_DECLARE(int, int32_t) D4_ANY_DECLARE(i32, int32_t) D4_ANY_DECLARE(i16, int16_t) +D4_ANY_DEFINE(TYPE_i8, i8, int8_t, val, lhs_val == rhs_val, (void) val, d4_i8_str(val)) D4_ANY_DEFINE(TYPE_char, char, char, val, lhs_val == rhs_val, (void) val, d4_char_str(val)) D4_ANY_DEFINE(TYPE_u8, u8, uint8_t, val, lhs_val == rhs_val, (void) val, d4_u8_str(val)) -D4_ANY_DEFINE(TYPE_i8, i8, int8_t, val, lhs_val == rhs_val, (void) val, d4_i8_str(val)) D4_ANY_DEFINE(TYPE_u64, u64, uint64_t, val, lhs_val == rhs_val, (void) val, d4_u64_str(val)) D4_ANY_DEFINE(TYPE_u32, u32, uint32_t, val, lhs_val == rhs_val, (void) val, d4_u32_str(val)) D4_ANY_DEFINE(TYPE_u16, u16, uint16_t, val, lhs_val == rhs_val, (void) val, d4_u16_str(val)) @@ -118,57 +115,48 @@ int main (void) { d4_any_t __THE_20 = {-1, NULL, NULL, NULL, NULL, NULL}; d4_any_t __THE_21 = {-1, NULL, NULL, NULL, NULL, NULL}; d4_any_t __THE_22 = {-1, NULL, NULL, NULL, NULL, NULL}; - d4_any_t __THE_23 = {-1, NULL, NULL, NULL, NULL, NULL}; wchar_t e_0; + d4_any_t __THE_23 = {-1, NULL, NULL, NULL, NULL, NULL}; d4_any_t __THE_24 = {-1, NULL, NULL, NULL, NULL, NULL}; + bool f_0; d4_any_t __THE_25 = {-1, NULL, NULL, NULL, NULL, NULL}; d4_any_t __THE_26 = {-1, NULL, NULL, NULL, NULL, NULL}; d4_any_t __THE_27 = {-1, NULL, NULL, NULL, NULL, NULL}; - bool f_0; d4_any_t __THE_28 = {-1, NULL, NULL, NULL, NULL, NULL}; - d4_any_t __THE_29 = {-1, NULL, NULL, NULL, NULL, NULL}; - d4_any_t __THE_30 = {-1, NULL, NULL, NULL, NULL, NULL}; - d4_any_t __THE_31 = {-1, NULL, NULL, NULL, NULL, NULL}; - int8_t a_0 = 10; - d4_print.func(d4_print.ctx, d4_safe_calloc(&(d4_fn_sFP4arr_anyFP1strFP1strFP1strFRvoidFE_params_t) {d4_arr_any_alloc(1, __THE_1 = d4_any_i16_alloc(a_0)), 0, d4_str_empty_val, 0, d4_str_empty_val, 0, d4_str_empty_val}, sizeof(d4_fn_sFP4arr_anyFP1strFP1strFP1strFRvoidFE_params_t))); - d4_print.func(d4_print.ctx, d4_safe_calloc(&(d4_fn_sFP4arr_anyFP1strFP1strFP1strFRvoidFE_params_t) {d4_arr_any_alloc(1, __THE_2 = d4_any_i32_alloc(a_0)), 0, d4_str_empty_val, 0, d4_str_empty_val, 0, d4_str_empty_val}, sizeof(d4_fn_sFP4arr_anyFP1strFP1strFP1strFRvoidFE_params_t))); - d4_print.func(d4_print.ctx, d4_safe_calloc(&(d4_fn_sFP4arr_anyFP1strFP1strFP1strFRvoidFE_params_t) {d4_arr_any_alloc(1, __THE_3 = d4_any_int_alloc(a_0)), 0, d4_str_empty_val, 0, d4_str_empty_val, 0, d4_str_empty_val}, sizeof(d4_fn_sFP4arr_anyFP1strFP1strFP1strFRvoidFE_params_t))); - d4_print.func(d4_print.ctx, d4_safe_calloc(&(d4_fn_sFP4arr_anyFP1strFP1strFP1strFRvoidFE_params_t) {d4_arr_any_alloc(1, __THE_4 = d4_any_i64_alloc(a_0)), 0, d4_str_empty_val, 0, d4_str_empty_val, 0, d4_str_empty_val}, sizeof(d4_fn_sFP4arr_anyFP1strFP1strFP1strFRvoidFE_params_t))); - d4_print.func(d4_print.ctx, d4_safe_calloc(&(d4_fn_sFP4arr_anyFP1strFP1strFP1strFRvoidFE_params_t) {d4_arr_any_alloc(1, __THE_5 = d4_any_float_alloc(a_0)), 0, d4_str_empty_val, 0, d4_str_empty_val, 0, d4_str_empty_val}, sizeof(d4_fn_sFP4arr_anyFP1strFP1strFP1strFRvoidFE_params_t))); - d4_print.func(d4_print.ctx, d4_safe_calloc(&(d4_fn_sFP4arr_anyFP1strFP1strFP1strFRvoidFE_params_t) {d4_arr_any_alloc(1, __THE_6 = d4_any_f32_alloc(a_0)), 0, d4_str_empty_val, 0, d4_str_empty_val, 0, d4_str_empty_val}, sizeof(d4_fn_sFP4arr_anyFP1strFP1strFP1strFRvoidFE_params_t))); - d4_print.func(d4_print.ctx, d4_safe_calloc(&(d4_fn_sFP4arr_anyFP1strFP1strFP1strFRvoidFE_params_t) {d4_arr_any_alloc(1, __THE_7 = d4_any_f64_alloc(a_0)), 0, d4_str_empty_val, 0, d4_str_empty_val, 0, d4_str_empty_val}, sizeof(d4_fn_sFP4arr_anyFP1strFP1strFP1strFRvoidFE_params_t))); - b_0 = 10; - d4_print.func(d4_print.ctx, d4_safe_calloc(&(d4_fn_sFP4arr_anyFP1strFP1strFP1strFRvoidFE_params_t) {d4_arr_any_alloc(1, __THE_8 = d4_any_u16_alloc(b_0)), 0, d4_str_empty_val, 0, d4_str_empty_val, 0, d4_str_empty_val}, sizeof(d4_fn_sFP4arr_anyFP1strFP1strFP1strFRvoidFE_params_t))); - d4_print.func(d4_print.ctx, d4_safe_calloc(&(d4_fn_sFP4arr_anyFP1strFP1strFP1strFRvoidFE_params_t) {d4_arr_any_alloc(1, __THE_9 = d4_any_u32_alloc(b_0)), 0, d4_str_empty_val, 0, d4_str_empty_val, 0, d4_str_empty_val}, sizeof(d4_fn_sFP4arr_anyFP1strFP1strFP1strFRvoidFE_params_t))); - d4_print.func(d4_print.ctx, d4_safe_calloc(&(d4_fn_sFP4arr_anyFP1strFP1strFP1strFRvoidFE_params_t) {d4_arr_any_alloc(1, __THE_10 = d4_any_u64_alloc(b_0)), 0, d4_str_empty_val, 0, d4_str_empty_val, 0, d4_str_empty_val}, sizeof(d4_fn_sFP4arr_anyFP1strFP1strFP1strFRvoidFE_params_t))); - d4_print.func(d4_print.ctx, d4_safe_calloc(&(d4_fn_sFP4arr_anyFP1strFP1strFP1strFRvoidFE_params_t) {d4_arr_any_alloc(1, __THE_11 = d4_any_float_alloc(b_0)), 0, d4_str_empty_val, 0, d4_str_empty_val, 0, d4_str_empty_val}, sizeof(d4_fn_sFP4arr_anyFP1strFP1strFP1strFRvoidFE_params_t))); - d4_print.func(d4_print.ctx, d4_safe_calloc(&(d4_fn_sFP4arr_anyFP1strFP1strFP1strFRvoidFE_params_t) {d4_arr_any_alloc(1, __THE_12 = d4_any_f32_alloc(b_0)), 0, d4_str_empty_val, 0, d4_str_empty_val, 0, d4_str_empty_val}, sizeof(d4_fn_sFP4arr_anyFP1strFP1strFP1strFRvoidFE_params_t))); - d4_print.func(d4_print.ctx, d4_safe_calloc(&(d4_fn_sFP4arr_anyFP1strFP1strFP1strFRvoidFE_params_t) {d4_arr_any_alloc(1, __THE_13 = d4_any_f64_alloc(b_0)), 0, d4_str_empty_val, 0, d4_str_empty_val, 0, d4_str_empty_val}, sizeof(d4_fn_sFP4arr_anyFP1strFP1strFP1strFRvoidFE_params_t))); + int8_t a_0 = (int8_t) 10; + d4_print.func(d4_print.ctx, d4_safe_calloc(&(d4_fn_sFP4arr_anyFP1strFP1strFP1strFRvoidFE_params_t) {d4_arr_any_alloc(1, __THE_1 = d4_any_i16_alloc((int16_t) a_0)), 0, d4_str_empty_val, 0, d4_str_empty_val, 0, d4_str_empty_val}, sizeof(d4_fn_sFP4arr_anyFP1strFP1strFP1strFRvoidFE_params_t))); + d4_print.func(d4_print.ctx, d4_safe_calloc(&(d4_fn_sFP4arr_anyFP1strFP1strFP1strFRvoidFE_params_t) {d4_arr_any_alloc(1, __THE_2 = d4_any_i32_alloc((int32_t) a_0)), 0, d4_str_empty_val, 0, d4_str_empty_val, 0, d4_str_empty_val}, sizeof(d4_fn_sFP4arr_anyFP1strFP1strFP1strFRvoidFE_params_t))); + d4_print.func(d4_print.ctx, d4_safe_calloc(&(d4_fn_sFP4arr_anyFP1strFP1strFP1strFRvoidFE_params_t) {d4_arr_any_alloc(1, __THE_3 = d4_any_int_alloc((int32_t) a_0)), 0, d4_str_empty_val, 0, d4_str_empty_val, 0, d4_str_empty_val}, sizeof(d4_fn_sFP4arr_anyFP1strFP1strFP1strFRvoidFE_params_t))); + d4_print.func(d4_print.ctx, d4_safe_calloc(&(d4_fn_sFP4arr_anyFP1strFP1strFP1strFRvoidFE_params_t) {d4_arr_any_alloc(1, __THE_4 = d4_any_i64_alloc((int64_t) a_0)), 0, d4_str_empty_val, 0, d4_str_empty_val, 0, d4_str_empty_val}, sizeof(d4_fn_sFP4arr_anyFP1strFP1strFP1strFRvoidFE_params_t))); + d4_print.func(d4_print.ctx, d4_safe_calloc(&(d4_fn_sFP4arr_anyFP1strFP1strFP1strFRvoidFE_params_t) {d4_arr_any_alloc(1, __THE_5 = d4_any_float_alloc((double) a_0)), 0, d4_str_empty_val, 0, d4_str_empty_val, 0, d4_str_empty_val}, sizeof(d4_fn_sFP4arr_anyFP1strFP1strFP1strFRvoidFE_params_t))); + d4_print.func(d4_print.ctx, d4_safe_calloc(&(d4_fn_sFP4arr_anyFP1strFP1strFP1strFRvoidFE_params_t) {d4_arr_any_alloc(1, __THE_6 = d4_any_f32_alloc((float) a_0)), 0, d4_str_empty_val, 0, d4_str_empty_val, 0, d4_str_empty_val}, sizeof(d4_fn_sFP4arr_anyFP1strFP1strFP1strFRvoidFE_params_t))); + d4_print.func(d4_print.ctx, d4_safe_calloc(&(d4_fn_sFP4arr_anyFP1strFP1strFP1strFRvoidFE_params_t) {d4_arr_any_alloc(1, __THE_7 = d4_any_f64_alloc((double) a_0)), 0, d4_str_empty_val, 0, d4_str_empty_val, 0, d4_str_empty_val}, sizeof(d4_fn_sFP4arr_anyFP1strFP1strFP1strFRvoidFE_params_t))); + b_0 = (uint8_t) 10; + d4_print.func(d4_print.ctx, d4_safe_calloc(&(d4_fn_sFP4arr_anyFP1strFP1strFP1strFRvoidFE_params_t) {d4_arr_any_alloc(1, __THE_8 = d4_any_u16_alloc((uint16_t) b_0)), 0, d4_str_empty_val, 0, d4_str_empty_val, 0, d4_str_empty_val}, sizeof(d4_fn_sFP4arr_anyFP1strFP1strFP1strFRvoidFE_params_t))); + d4_print.func(d4_print.ctx, d4_safe_calloc(&(d4_fn_sFP4arr_anyFP1strFP1strFP1strFRvoidFE_params_t) {d4_arr_any_alloc(1, __THE_9 = d4_any_u32_alloc((uint32_t) b_0)), 0, d4_str_empty_val, 0, d4_str_empty_val, 0, d4_str_empty_val}, sizeof(d4_fn_sFP4arr_anyFP1strFP1strFP1strFRvoidFE_params_t))); + d4_print.func(d4_print.ctx, d4_safe_calloc(&(d4_fn_sFP4arr_anyFP1strFP1strFP1strFRvoidFE_params_t) {d4_arr_any_alloc(1, __THE_10 = d4_any_u64_alloc((uint64_t) b_0)), 0, d4_str_empty_val, 0, d4_str_empty_val, 0, d4_str_empty_val}, sizeof(d4_fn_sFP4arr_anyFP1strFP1strFP1strFRvoidFE_params_t))); + d4_print.func(d4_print.ctx, d4_safe_calloc(&(d4_fn_sFP4arr_anyFP1strFP1strFP1strFRvoidFE_params_t) {d4_arr_any_alloc(1, __THE_11 = d4_any_float_alloc((double) b_0)), 0, d4_str_empty_val, 0, d4_str_empty_val, 0, d4_str_empty_val}, sizeof(d4_fn_sFP4arr_anyFP1strFP1strFP1strFRvoidFE_params_t))); + d4_print.func(d4_print.ctx, d4_safe_calloc(&(d4_fn_sFP4arr_anyFP1strFP1strFP1strFRvoidFE_params_t) {d4_arr_any_alloc(1, __THE_12 = d4_any_f32_alloc((float) b_0)), 0, d4_str_empty_val, 0, d4_str_empty_val, 0, d4_str_empty_val}, sizeof(d4_fn_sFP4arr_anyFP1strFP1strFP1strFRvoidFE_params_t))); + d4_print.func(d4_print.ctx, d4_safe_calloc(&(d4_fn_sFP4arr_anyFP1strFP1strFP1strFRvoidFE_params_t) {d4_arr_any_alloc(1, __THE_13 = d4_any_f64_alloc((double) b_0)), 0, d4_str_empty_val, 0, d4_str_empty_val, 0, d4_str_empty_val}, sizeof(d4_fn_sFP4arr_anyFP1strFP1strFP1strFRvoidFE_params_t))); c_0 = 10; - d4_print.func(d4_print.ctx, d4_safe_calloc(&(d4_fn_sFP4arr_anyFP1strFP1strFP1strFRvoidFE_params_t) {d4_arr_any_alloc(1, __THE_14 = d4_any_i32_alloc(c_0)), 0, d4_str_empty_val, 0, d4_str_empty_val, 0, d4_str_empty_val}, sizeof(d4_fn_sFP4arr_anyFP1strFP1strFP1strFRvoidFE_params_t))); - d4_print.func(d4_print.ctx, d4_safe_calloc(&(d4_fn_sFP4arr_anyFP1strFP1strFP1strFRvoidFE_params_t) {d4_arr_any_alloc(1, __THE_15 = d4_any_i64_alloc(c_0)), 0, d4_str_empty_val, 0, d4_str_empty_val, 0, d4_str_empty_val}, sizeof(d4_fn_sFP4arr_anyFP1strFP1strFP1strFRvoidFE_params_t))); - d4_print.func(d4_print.ctx, d4_safe_calloc(&(d4_fn_sFP4arr_anyFP1strFP1strFP1strFRvoidFE_params_t) {d4_arr_any_alloc(1, __THE_16 = d4_any_float_alloc(c_0)), 0, d4_str_empty_val, 0, d4_str_empty_val, 0, d4_str_empty_val}, sizeof(d4_fn_sFP4arr_anyFP1strFP1strFP1strFRvoidFE_params_t))); - d4_print.func(d4_print.ctx, d4_safe_calloc(&(d4_fn_sFP4arr_anyFP1strFP1strFP1strFRvoidFE_params_t) {d4_arr_any_alloc(1, __THE_17 = d4_any_f32_alloc(c_0)), 0, d4_str_empty_val, 0, d4_str_empty_val, 0, d4_str_empty_val}, sizeof(d4_fn_sFP4arr_anyFP1strFP1strFP1strFRvoidFE_params_t))); - d4_print.func(d4_print.ctx, d4_safe_calloc(&(d4_fn_sFP4arr_anyFP1strFP1strFP1strFRvoidFE_params_t) {d4_arr_any_alloc(1, __THE_18 = d4_any_f64_alloc(c_0)), 0, d4_str_empty_val, 0, d4_str_empty_val, 0, d4_str_empty_val}, sizeof(d4_fn_sFP4arr_anyFP1strFP1strFP1strFRvoidFE_params_t))); + d4_print.func(d4_print.ctx, d4_safe_calloc(&(d4_fn_sFP4arr_anyFP1strFP1strFP1strFRvoidFE_params_t) {d4_arr_any_alloc(1, __THE_14 = d4_any_i32_alloc((int32_t) c_0)), 0, d4_str_empty_val, 0, d4_str_empty_val, 0, d4_str_empty_val}, sizeof(d4_fn_sFP4arr_anyFP1strFP1strFP1strFRvoidFE_params_t))); + d4_print.func(d4_print.ctx, d4_safe_calloc(&(d4_fn_sFP4arr_anyFP1strFP1strFP1strFRvoidFE_params_t) {d4_arr_any_alloc(1, __THE_15 = d4_any_i64_alloc((int64_t) c_0)), 0, d4_str_empty_val, 0, d4_str_empty_val, 0, d4_str_empty_val}, sizeof(d4_fn_sFP4arr_anyFP1strFP1strFP1strFRvoidFE_params_t))); + d4_print.func(d4_print.ctx, d4_safe_calloc(&(d4_fn_sFP4arr_anyFP1strFP1strFP1strFRvoidFE_params_t) {d4_arr_any_alloc(1, __THE_16 = d4_any_float_alloc((double) c_0)), 0, d4_str_empty_val, 0, d4_str_empty_val, 0, d4_str_empty_val}, sizeof(d4_fn_sFP4arr_anyFP1strFP1strFP1strFRvoidFE_params_t))); + d4_print.func(d4_print.ctx, d4_safe_calloc(&(d4_fn_sFP4arr_anyFP1strFP1strFP1strFRvoidFE_params_t) {d4_arr_any_alloc(1, __THE_17 = d4_any_f32_alloc((float) c_0)), 0, d4_str_empty_val, 0, d4_str_empty_val, 0, d4_str_empty_val}, sizeof(d4_fn_sFP4arr_anyFP1strFP1strFP1strFRvoidFE_params_t))); + d4_print.func(d4_print.ctx, d4_safe_calloc(&(d4_fn_sFP4arr_anyFP1strFP1strFP1strFRvoidFE_params_t) {d4_arr_any_alloc(1, __THE_18 = d4_any_f64_alloc((double) c_0)), 0, d4_str_empty_val, 0, d4_str_empty_val, 0, d4_str_empty_val}, sizeof(d4_fn_sFP4arr_anyFP1strFP1strFP1strFRvoidFE_params_t))); d_0 = 65; - d4_print.func(d4_print.ctx, d4_safe_calloc(&(d4_fn_sFP4arr_anyFP1strFP1strFP1strFRvoidFE_params_t) {d4_arr_any_alloc(1, __THE_19 = d4_any_i8_alloc(d_0)), 0, d4_str_empty_val, 0, d4_str_empty_val, 0, d4_str_empty_val}, sizeof(d4_fn_sFP4arr_anyFP1strFP1strFP1strFRvoidFE_params_t))); - d4_print.func(d4_print.ctx, d4_safe_calloc(&(d4_fn_sFP4arr_anyFP1strFP1strFP1strFRvoidFE_params_t) {d4_arr_any_alloc(1, __THE_20 = d4_any_u8_alloc(d_0)), 0, d4_str_empty_val, 0, d4_str_empty_val, 0, d4_str_empty_val}, sizeof(d4_fn_sFP4arr_anyFP1strFP1strFP1strFRvoidFE_params_t))); - d4_print.func(d4_print.ctx, d4_safe_calloc(&(d4_fn_sFP4arr_anyFP1strFP1strFP1strFRvoidFE_params_t) {d4_arr_any_alloc(1, __THE_21 = d4_any_char_alloc(d_0)), 0, d4_str_empty_val, 0, d4_str_empty_val, 0, d4_str_empty_val}, sizeof(d4_fn_sFP4arr_anyFP1strFP1strFP1strFRvoidFE_params_t))); - d4_print.func(d4_print.ctx, d4_safe_calloc(&(d4_fn_sFP4arr_anyFP1strFP1strFP1strFRvoidFE_params_t) {d4_arr_any_alloc(1, __THE_22 = d4_any_int_alloc(d_0)), 0, d4_str_empty_val, 0, d4_str_empty_val, 0, d4_str_empty_val}, sizeof(d4_fn_sFP4arr_anyFP1strFP1strFP1strFRvoidFE_params_t))); - d4_print.func(d4_print.ctx, d4_safe_calloc(&(d4_fn_sFP4arr_anyFP1strFP1strFP1strFRvoidFE_params_t) {d4_arr_any_alloc(1, __THE_23 = d4_any_float_alloc(d_0)), 0, d4_str_empty_val, 0, d4_str_empty_val, 0, d4_str_empty_val}, sizeof(d4_fn_sFP4arr_anyFP1strFP1strFP1strFRvoidFE_params_t))); + d4_print.func(d4_print.ctx, d4_safe_calloc(&(d4_fn_sFP4arr_anyFP1strFP1strFP1strFRvoidFE_params_t) {d4_arr_any_alloc(1, __THE_19 = d4_any_u8_alloc((uint8_t) d_0)), 0, d4_str_empty_val, 0, d4_str_empty_val, 0, d4_str_empty_val}, sizeof(d4_fn_sFP4arr_anyFP1strFP1strFP1strFRvoidFE_params_t))); + d4_print.func(d4_print.ctx, d4_safe_calloc(&(d4_fn_sFP4arr_anyFP1strFP1strFP1strFRvoidFE_params_t) {d4_arr_any_alloc(1, __THE_20 = d4_any_char_alloc((char) d_0)), 0, d4_str_empty_val, 0, d4_str_empty_val, 0, d4_str_empty_val}, sizeof(d4_fn_sFP4arr_anyFP1strFP1strFP1strFRvoidFE_params_t))); + d4_print.func(d4_print.ctx, d4_safe_calloc(&(d4_fn_sFP4arr_anyFP1strFP1strFP1strFRvoidFE_params_t) {d4_arr_any_alloc(1, __THE_21 = d4_any_int_alloc((int32_t) d_0)), 0, d4_str_empty_val, 0, d4_str_empty_val, 0, d4_str_empty_val}, sizeof(d4_fn_sFP4arr_anyFP1strFP1strFP1strFRvoidFE_params_t))); + d4_print.func(d4_print.ctx, d4_safe_calloc(&(d4_fn_sFP4arr_anyFP1strFP1strFP1strFRvoidFE_params_t) {d4_arr_any_alloc(1, __THE_22 = d4_any_float_alloc((double) d_0)), 0, d4_str_empty_val, 0, d4_str_empty_val, 0, d4_str_empty_val}, sizeof(d4_fn_sFP4arr_anyFP1strFP1strFP1strFRvoidFE_params_t))); e_0 = L'a'; - d4_print.func(d4_print.ctx, d4_safe_calloc(&(d4_fn_sFP4arr_anyFP1strFP1strFP1strFRvoidFE_params_t) {d4_arr_any_alloc(1, __THE_24 = d4_any_i8_alloc(e_0)), 0, d4_str_empty_val, 0, d4_str_empty_val, 0, d4_str_empty_val}, sizeof(d4_fn_sFP4arr_anyFP1strFP1strFP1strFRvoidFE_params_t))); - d4_print.func(d4_print.ctx, d4_safe_calloc(&(d4_fn_sFP4arr_anyFP1strFP1strFP1strFRvoidFE_params_t) {d4_arr_any_alloc(1, __THE_25 = d4_any_u8_alloc(e_0)), 0, d4_str_empty_val, 0, d4_str_empty_val, 0, d4_str_empty_val}, sizeof(d4_fn_sFP4arr_anyFP1strFP1strFP1strFRvoidFE_params_t))); - d4_print.func(d4_print.ctx, d4_safe_calloc(&(d4_fn_sFP4arr_anyFP1strFP1strFP1strFRvoidFE_params_t) {d4_arr_any_alloc(1, __THE_26 = d4_any_int_alloc(e_0)), 0, d4_str_empty_val, 0, d4_str_empty_val, 0, d4_str_empty_val}, sizeof(d4_fn_sFP4arr_anyFP1strFP1strFP1strFRvoidFE_params_t))); - d4_print.func(d4_print.ctx, d4_safe_calloc(&(d4_fn_sFP4arr_anyFP1strFP1strFP1strFRvoidFE_params_t) {d4_arr_any_alloc(1, __THE_27 = d4_any_float_alloc(e_0)), 0, d4_str_empty_val, 0, d4_str_empty_val, 0, d4_str_empty_val}, sizeof(d4_fn_sFP4arr_anyFP1strFP1strFP1strFRvoidFE_params_t))); + d4_print.func(d4_print.ctx, d4_safe_calloc(&(d4_fn_sFP4arr_anyFP1strFP1strFP1strFRvoidFE_params_t) {d4_arr_any_alloc(1, __THE_23 = d4_any_int_alloc((int32_t) e_0)), 0, d4_str_empty_val, 0, d4_str_empty_val, 0, d4_str_empty_val}, sizeof(d4_fn_sFP4arr_anyFP1strFP1strFP1strFRvoidFE_params_t))); + d4_print.func(d4_print.ctx, d4_safe_calloc(&(d4_fn_sFP4arr_anyFP1strFP1strFP1strFRvoidFE_params_t) {d4_arr_any_alloc(1, __THE_24 = d4_any_float_alloc((double) e_0)), 0, d4_str_empty_val, 0, d4_str_empty_val, 0, d4_str_empty_val}, sizeof(d4_fn_sFP4arr_anyFP1strFP1strFP1strFRvoidFE_params_t))); f_0 = true; - d4_print.func(d4_print.ctx, d4_safe_calloc(&(d4_fn_sFP4arr_anyFP1strFP1strFP1strFRvoidFE_params_t) {d4_arr_any_alloc(1, __THE_28 = d4_any_i8_alloc(f_0)), 0, d4_str_empty_val, 0, d4_str_empty_val, 0, d4_str_empty_val}, sizeof(d4_fn_sFP4arr_anyFP1strFP1strFP1strFRvoidFE_params_t))); - d4_print.func(d4_print.ctx, d4_safe_calloc(&(d4_fn_sFP4arr_anyFP1strFP1strFP1strFRvoidFE_params_t) {d4_arr_any_alloc(1, __THE_29 = d4_any_u8_alloc(f_0)), 0, d4_str_empty_val, 0, d4_str_empty_val, 0, d4_str_empty_val}, sizeof(d4_fn_sFP4arr_anyFP1strFP1strFP1strFRvoidFE_params_t))); - d4_print.func(d4_print.ctx, d4_safe_calloc(&(d4_fn_sFP4arr_anyFP1strFP1strFP1strFRvoidFE_params_t) {d4_arr_any_alloc(1, __THE_30 = d4_any_int_alloc(f_0)), 0, d4_str_empty_val, 0, d4_str_empty_val, 0, d4_str_empty_val}, sizeof(d4_fn_sFP4arr_anyFP1strFP1strFP1strFRvoidFE_params_t))); - d4_print.func(d4_print.ctx, d4_safe_calloc(&(d4_fn_sFP4arr_anyFP1strFP1strFP1strFRvoidFE_params_t) {d4_arr_any_alloc(1, __THE_31 = d4_any_float_alloc(f_0)), 0, d4_str_empty_val, 0, d4_str_empty_val, 0, d4_str_empty_val}, sizeof(d4_fn_sFP4arr_anyFP1strFP1strFP1strFRvoidFE_params_t))); - d4_any_free(__THE_31); - d4_any_free(__THE_30); - d4_any_free(__THE_29); + d4_print.func(d4_print.ctx, d4_safe_calloc(&(d4_fn_sFP4arr_anyFP1strFP1strFP1strFRvoidFE_params_t) {d4_arr_any_alloc(1, __THE_25 = d4_any_i8_alloc((int8_t) f_0)), 0, d4_str_empty_val, 0, d4_str_empty_val, 0, d4_str_empty_val}, sizeof(d4_fn_sFP4arr_anyFP1strFP1strFP1strFRvoidFE_params_t))); + d4_print.func(d4_print.ctx, d4_safe_calloc(&(d4_fn_sFP4arr_anyFP1strFP1strFP1strFRvoidFE_params_t) {d4_arr_any_alloc(1, __THE_26 = d4_any_u8_alloc((uint8_t) f_0)), 0, d4_str_empty_val, 0, d4_str_empty_val, 0, d4_str_empty_val}, sizeof(d4_fn_sFP4arr_anyFP1strFP1strFP1strFRvoidFE_params_t))); + d4_print.func(d4_print.ctx, d4_safe_calloc(&(d4_fn_sFP4arr_anyFP1strFP1strFP1strFRvoidFE_params_t) {d4_arr_any_alloc(1, __THE_27 = d4_any_int_alloc((int32_t) f_0)), 0, d4_str_empty_val, 0, d4_str_empty_val, 0, d4_str_empty_val}, sizeof(d4_fn_sFP4arr_anyFP1strFP1strFP1strFRvoidFE_params_t))); + d4_print.func(d4_print.ctx, d4_safe_calloc(&(d4_fn_sFP4arr_anyFP1strFP1strFP1strFRvoidFE_params_t) {d4_arr_any_alloc(1, __THE_28 = d4_any_float_alloc((double) f_0)), 0, d4_str_empty_val, 0, d4_str_empty_val, 0, d4_str_empty_val}, sizeof(d4_fn_sFP4arr_anyFP1strFP1strFP1strFRvoidFE_params_t))); d4_any_free(__THE_28); d4_any_free(__THE_27); d4_any_free(__THE_26); @@ -218,13 +206,10 @@ int main (void) { 10.0 10.0 65 -65 A 65 65.0 97 -97 -97 97.0 1 1 diff --git a/packages/codegen/test/codegen/loop-statement-with-reference.txt b/packages/codegen/test/codegen/loop-statement-with-reference.txt index 45050bb52..b96a103dd 100644 --- a/packages/codegen/test/codegen/loop-statement-with-reference.txt +++ b/packages/codegen/test/codegen/loop-statement-with-reference.txt @@ -42,25 +42,25 @@ int main (void) { d4_ref_int_t c_0; int32_t testInt1_0 = 1; int32_t testInt2_0 = 2; - for (d4_ref_int_t i_0 = &testInt1_0; *i_0 != *&testInt2_0; i_0 = (&testInt2_0)) {} + for (d4_ref_int_t i_0 = &testInt1_0; i_0 != &testInt2_0; i_0 = (&testInt2_0)) {} a_0 = &testInt1_0; - for (; *a_0 != *&testInt2_0; a_0 = (&testInt2_0)) {} + for (; a_0 != &testInt2_0; a_0 = (&testInt2_0)) {} b_0 = &testInt1_0; - while (*b_0 != *&testInt2_0) { + while (b_0 != &testInt2_0) { b_0 = &testInt2_0; } c_0 = &testInt1_0; while (1) { - if (*c_0 == (*&testInt2_0)) { + if (c_0 == (&testInt2_0)) { break; } c_0 = &testInt2_0; } - for (d4_ref_int_t d_0 = &testInt1_0; *d_0 != *&testInt2_0;) { + for (d4_ref_int_t d_0 = &testInt1_0; d_0 != &testInt2_0;) { d_0 = &testInt2_0; } for (d4_ref_int_t e_0 = &testInt1_0;; e_0 = (&testInt2_0)) { - if (*e_0 == (*&testInt2_0)) { + if (e_0 == (&testInt2_0)) { break; } } diff --git a/packages/codegen/test/codegen/map-expression.txt b/packages/codegen/test/codegen/map-expression.txt index 742f58abc..c02aad6b6 100644 --- a/packages/codegen/test/codegen/map-expression.txt +++ b/packages/codegen/test/codegen/map-expression.txt @@ -219,33 +219,33 @@ int main (void) { d4_map_strMSboolME_t c01_0 = d4_map_strMSboolME_alloc(1, __THE_1 = d4_str_alloc(L"key"), true); d4_map_strMSbyteME_t c02_0 = d4_map_strMSbyteME_alloc(1, __THE_2 = d4_str_alloc(L"key"), 0x0F); d4_map_strMSruneME_t c03_0 = d4_map_strMSruneME_alloc(1, __THE_3 = d4_str_alloc(L"key"), L'a'); - d4_map_strMSf32ME_t c04_0 = d4_map_strMSf32ME_alloc(1, __THE_4 = d4_str_alloc(L"key"), 6.32); - d4_map_strMSf64ME_t c05_0 = d4_map_strMSf64ME_alloc(1, __THE_5 = d4_str_alloc(L"key"), 3.14); + d4_map_strMSf32ME_t c04_0 = d4_map_strMSf32ME_alloc(1, __THE_4 = d4_str_alloc(L"key"), (float) 6.32); + d4_map_strMSf64ME_t c05_0 = d4_map_strMSf64ME_alloc(1, __THE_5 = d4_str_alloc(L"key"), (double) 3.14); d4_map_strMSfloatME_t c06_0 = d4_map_strMSfloatME_alloc(1, __THE_6 = d4_str_alloc(L"key"), 4.12); - d4_map_strMSi8ME_t c07_0 = d4_map_strMSi8ME_alloc(1, __THE_7 = d4_str_alloc(L"key"), -1); - d4_map_strMSi16ME_t c08_0 = d4_map_strMSi16ME_alloc(1, __THE_8 = d4_str_alloc(L"key"), -2); - d4_map_strMSi32ME_t c09_0 = d4_map_strMSi32ME_alloc(1, __THE_9 = d4_str_alloc(L"key"), -3); - d4_map_strMSi64ME_t c10_0 = d4_map_strMSi64ME_alloc(1, __THE_10 = d4_str_alloc(L"key"), -4); + d4_map_strMSi8ME_t c07_0 = d4_map_strMSi8ME_alloc(1, __THE_7 = d4_str_alloc(L"key"), -(int8_t) 1); + d4_map_strMSi16ME_t c08_0 = d4_map_strMSi16ME_alloc(1, __THE_8 = d4_str_alloc(L"key"), -(int16_t) 2); + d4_map_strMSi32ME_t c09_0 = d4_map_strMSi32ME_alloc(1, __THE_9 = d4_str_alloc(L"key"), -(int32_t) 3); + d4_map_strMSi64ME_t c10_0 = d4_map_strMSi64ME_alloc(1, __THE_10 = d4_str_alloc(L"key"), -(int64_t) 4); d4_map_strMSintME_t c11_0 = d4_map_strMSintME_alloc(1, __THE_11 = d4_str_alloc(L"key"), 1); - d4_map_strMSu8ME_t c12_0 = d4_map_strMSu8ME_alloc(1, __THE_12 = d4_str_alloc(L"key"), 1); - d4_map_strMSu16ME_t c13_0 = d4_map_strMSu16ME_alloc(1, __THE_13 = d4_str_alloc(L"key"), 2); - d4_map_strMSu32ME_t c14_0 = d4_map_strMSu32ME_alloc(1, __THE_14 = d4_str_alloc(L"key"), 3); - d4_map_strMSu64ME_t c15_0 = d4_map_strMSu64ME_alloc(1, __THE_15 = d4_str_alloc(L"key"), 4); + d4_map_strMSu8ME_t c12_0 = d4_map_strMSu8ME_alloc(1, __THE_12 = d4_str_alloc(L"key"), (uint8_t) 1); + d4_map_strMSu16ME_t c13_0 = d4_map_strMSu16ME_alloc(1, __THE_13 = d4_str_alloc(L"key"), (uint16_t) 2); + d4_map_strMSu32ME_t c14_0 = d4_map_strMSu32ME_alloc(1, __THE_14 = d4_str_alloc(L"key"), (uint32_t) 3); + d4_map_strMSu64ME_t c15_0 = d4_map_strMSu64ME_alloc(1, __THE_15 = d4_str_alloc(L"key"), (uint64_t) 4); d4_map_strMSboolME_t d01_0 = d4_map_strMSboolME_alloc(2, __THE_16 = d4_str_alloc(L"key1"), true, __THE_17 = d4_str_alloc(L"key2"), false); d4_map_strMSbyteME_t d02_0 = d4_map_strMSbyteME_alloc(2, __THE_18 = d4_str_alloc(L"key1"), 0x0F, __THE_19 = d4_str_alloc(L"key2"), 0x00); d4_map_strMSruneME_t d03_0 = d4_map_strMSruneME_alloc(2, __THE_20 = d4_str_alloc(L"key1"), L'a', __THE_21 = d4_str_alloc(L"key2"), L'z'); - d4_map_strMSf32ME_t d04_0 = d4_map_strMSf32ME_alloc(2, __THE_22 = d4_str_alloc(L"key1"), 6.32, __THE_23 = d4_str_alloc(L"key2"), 6.32); - d4_map_strMSf64ME_t d05_0 = d4_map_strMSf64ME_alloc(2, __THE_24 = d4_str_alloc(L"key1"), 3.14, __THE_25 = d4_str_alloc(L"key2"), 3.14); + d4_map_strMSf32ME_t d04_0 = d4_map_strMSf32ME_alloc(2, __THE_22 = d4_str_alloc(L"key1"), (float) 6.32, __THE_23 = d4_str_alloc(L"key2"), (float) 6.32); + d4_map_strMSf64ME_t d05_0 = d4_map_strMSf64ME_alloc(2, __THE_24 = d4_str_alloc(L"key1"), (double) 3.14, __THE_25 = d4_str_alloc(L"key2"), (double) 3.14); d4_map_strMSfloatME_t d06_0 = d4_map_strMSfloatME_alloc(2, __THE_26 = d4_str_alloc(L"key1"), 4.12, __THE_27 = d4_str_alloc(L"key2"), 4.12); - d4_map_strMSi8ME_t d07_0 = d4_map_strMSi8ME_alloc(2, __THE_28 = d4_str_alloc(L"key1"), -1, __THE_29 = d4_str_alloc(L"key2"), -1); - d4_map_strMSi16ME_t d08_0 = d4_map_strMSi16ME_alloc(2, __THE_30 = d4_str_alloc(L"key1"), -2, __THE_31 = d4_str_alloc(L"key2"), -2); - d4_map_strMSi32ME_t d09_0 = d4_map_strMSi32ME_alloc(2, __THE_32 = d4_str_alloc(L"key1"), -3, __THE_33 = d4_str_alloc(L"key2"), -3); - d4_map_strMSi64ME_t d10_0 = d4_map_strMSi64ME_alloc(2, __THE_34 = d4_str_alloc(L"key1"), -4, __THE_35 = d4_str_alloc(L"key2"), -4); + d4_map_strMSi8ME_t d07_0 = d4_map_strMSi8ME_alloc(2, __THE_28 = d4_str_alloc(L"key1"), -(int8_t) 1, __THE_29 = d4_str_alloc(L"key2"), -(int8_t) 1); + d4_map_strMSi16ME_t d08_0 = d4_map_strMSi16ME_alloc(2, __THE_30 = d4_str_alloc(L"key1"), -(int16_t) 2, __THE_31 = d4_str_alloc(L"key2"), -(int16_t) 2); + d4_map_strMSi32ME_t d09_0 = d4_map_strMSi32ME_alloc(2, __THE_32 = d4_str_alloc(L"key1"), -(int32_t) 3, __THE_33 = d4_str_alloc(L"key2"), -(int32_t) 3); + d4_map_strMSi64ME_t d10_0 = d4_map_strMSi64ME_alloc(2, __THE_34 = d4_str_alloc(L"key1"), -(int64_t) 4, __THE_35 = d4_str_alloc(L"key2"), -(int64_t) 4); d4_map_strMSintME_t d11_0 = d4_map_strMSintME_alloc(2, __THE_36 = d4_str_alloc(L"key1"), 1, __THE_37 = d4_str_alloc(L"key2"), 1); - d4_map_strMSu8ME_t d12_0 = d4_map_strMSu8ME_alloc(2, __THE_38 = d4_str_alloc(L"key1"), 1, __THE_39 = d4_str_alloc(L"key2"), 1); - d4_map_strMSu16ME_t d13_0 = d4_map_strMSu16ME_alloc(2, __THE_40 = d4_str_alloc(L"key1"), 2, __THE_41 = d4_str_alloc(L"key2"), 2); - d4_map_strMSu32ME_t d14_0 = d4_map_strMSu32ME_alloc(2, __THE_42 = d4_str_alloc(L"key1"), 3, __THE_43 = d4_str_alloc(L"key2"), 3); - d4_map_strMSu64ME_t d15_0 = d4_map_strMSu64ME_alloc(2, __THE_44 = d4_str_alloc(L"key1"), 4, __THE_45 = d4_str_alloc(L"key2"), 4); + d4_map_strMSu8ME_t d12_0 = d4_map_strMSu8ME_alloc(2, __THE_38 = d4_str_alloc(L"key1"), (uint8_t) 1, __THE_39 = d4_str_alloc(L"key2"), (uint8_t) 1); + d4_map_strMSu16ME_t d13_0 = d4_map_strMSu16ME_alloc(2, __THE_40 = d4_str_alloc(L"key1"), (uint16_t) 2, __THE_41 = d4_str_alloc(L"key2"), (uint16_t) 2); + d4_map_strMSu32ME_t d14_0 = d4_map_strMSu32ME_alloc(2, __THE_42 = d4_str_alloc(L"key1"), (uint32_t) 3, __THE_43 = d4_str_alloc(L"key2"), (uint32_t) 3); + d4_map_strMSu64ME_t d15_0 = d4_map_strMSu64ME_alloc(2, __THE_44 = d4_str_alloc(L"key1"), (uint64_t) 4, __THE_45 = d4_str_alloc(L"key2"), (uint64_t) 4); d4_map_strMSu64ME_free(d15_0); d4_str_free(__THE_45); d4_str_free(__THE_44); diff --git a/packages/codegen/test/codegen/unary-expression.txt b/packages/codegen/test/codegen/unary-expression.txt index a7030d96a..82734a3ea 100644 --- a/packages/codegen/test/codegen/unary-expression.txt +++ b/packages/codegen/test/codegen/unary-expression.txt @@ -116,35 +116,35 @@ int main (void) { double zFloatEmpty_0 = 0.0; double zFloatNeg_0 = -((bool) 3.14); double zFloat_0 = 3.14; - float zF32Empty_0 = 0; - float zF32Neg_0 = -((bool) 3.14); - float zF32_0 = 3.14; - double zF64Empty_0 = 0; - double zF64Neg_0 = -((bool) 3.14); - double zF64_0 = 3.14; + float zF32Empty_0 = (float) 0; + float zF32Neg_0 = -((bool) (float) 3.14); + float zF32_0 = (float) 3.14; + double zF64Empty_0 = (double) 0; + double zF64Neg_0 = -((bool) (double) 3.14); + double zF64_0 = (double) 3.14; int32_t zIntEmpty_0 = 0; int32_t zIntNeg_0 = -3; int32_t zInt_0 = 3; - int8_t zI8Empty_0 = 0; - int8_t zI8Neg_0 = -3; - int8_t zI8_0 = 3; - int16_t zI16Empty_0 = 0; - int16_t zI16Neg_0 = -3; - int16_t zI16_0 = 3; - int32_t zI32Empty_0 = 0; - int32_t zI32Neg_0 = -3; - int32_t zI32_0 = 3; - int64_t zI64Empty_0 = 0; - int64_t zI64Neg_0 = -3; - int64_t zI64_0 = 3; - uint8_t zU8Empty_0 = 0; - uint8_t zU8_0 = 3; - uint16_t zU16Empty_0 = 0; - uint16_t zU16_0 = 3; - uint32_t zU32Empty_0 = 0; - uint32_t zU32_0 = 3; - uint64_t zU64Empty_0 = 0; - uint64_t zU64_0 = 3; + int8_t zI8Empty_0 = (int8_t) 0; + int8_t zI8Neg_0 = -(int8_t) 3; + int8_t zI8_0 = (int8_t) 3; + int16_t zI16Empty_0 = (int16_t) 0; + int16_t zI16Neg_0 = -(int16_t) 3; + int16_t zI16_0 = (int16_t) 3; + int32_t zI32Empty_0 = (int32_t) 0; + int32_t zI32Neg_0 = -(int32_t) 3; + int32_t zI32_0 = (int32_t) 3; + int64_t zI64Empty_0 = (int64_t) 0; + int64_t zI64Neg_0 = -(int64_t) 3; + int64_t zI64_0 = (int64_t) 3; + uint8_t zU8Empty_0 = (uint8_t) 0; + uint8_t zU8_0 = (uint8_t) 3; + uint16_t zU16Empty_0 = (uint16_t) 0; + uint16_t zU16_0 = (uint16_t) 3; + uint32_t zU32Empty_0 = (uint32_t) 0; + uint32_t zU32_0 = (uint32_t) 3; + uint64_t zU64Empty_0 = (uint64_t) 0; + uint64_t zU64_0 = (uint64_t) 3; bool a01_0 = !true; bool a02_0 = !false; bool a05_0 = !0;