From 5108cab46029c4c89eb5d9576779cc348dbdf8c8 Mon Sep 17 00:00:00 2001 From: gluax Date: Wed, 27 Apr 2022 12:04:45 -0700 Subject: [PATCH] most compiler tests passing --- .../compiler/function/conditional_return.leo | 0 .../function/duplicate_definition_fail.leo | 1 - .../compiler/function/empty.leo | 0 .../compiler/function/input/dummy.in | 0 .../compiler/function/input/integers.in | 0 .../compiler/function/iteration.leo | 2 +- .../compiler/function/iteration_repeated.leo | 2 +- .../compiler/function/repeated.leo | 0 .../compiler/function/return.leo | 0 .../function/conditional_return.leo.out | 23 ++++--------------- .../compiler/function/iteration.leo.out | 23 ++++--------------- .../function/iteration_repeated.leo.out | 23 ++++--------------- .../compiler/function/repeated.leo.out | 23 ++++--------------- .../compiler/compiler/function/return.leo.out | 23 ++++--------------- 14 files changed, 27 insertions(+), 93 deletions(-) rename {disabled_tests => tests}/compiler/function/conditional_return.leo (100%) rename {disabled_tests => tests}/compiler/function/duplicate_definition_fail.leo (99%) rename {disabled_tests => tests}/compiler/function/empty.leo (100%) rename {disabled_tests => tests}/compiler/function/input/dummy.in (100%) rename {disabled_tests => tests}/compiler/function/input/integers.in (100%) rename {disabled_tests => tests}/compiler/function/iteration.leo (90%) rename {disabled_tests => tests}/compiler/function/iteration_repeated.leo (93%) rename {disabled_tests => tests}/compiler/function/repeated.leo (100%) rename {disabled_tests => tests}/compiler/function/return.leo (100%) diff --git a/disabled_tests/compiler/function/conditional_return.leo b/tests/compiler/function/conditional_return.leo similarity index 100% rename from disabled_tests/compiler/function/conditional_return.leo rename to tests/compiler/function/conditional_return.leo diff --git a/disabled_tests/compiler/function/duplicate_definition_fail.leo b/tests/compiler/function/duplicate_definition_fail.leo similarity index 99% rename from disabled_tests/compiler/function/duplicate_definition_fail.leo rename to tests/compiler/function/duplicate_definition_fail.leo index 9b003b6015..4f3a449a13 100644 --- a/disabled_tests/compiler/function/duplicate_definition_fail.leo +++ b/tests/compiler/function/duplicate_definition_fail.leo @@ -4,7 +4,6 @@ expectation: Fail input_file: input/dummy.in */ - function main(y: bool) -> bool { console.log("{}", 1u8); return y; diff --git a/disabled_tests/compiler/function/empty.leo b/tests/compiler/function/empty.leo similarity index 100% rename from disabled_tests/compiler/function/empty.leo rename to tests/compiler/function/empty.leo diff --git a/disabled_tests/compiler/function/input/dummy.in b/tests/compiler/function/input/dummy.in similarity index 100% rename from disabled_tests/compiler/function/input/dummy.in rename to tests/compiler/function/input/dummy.in diff --git a/disabled_tests/compiler/function/input/integers.in b/tests/compiler/function/input/integers.in similarity index 100% rename from disabled_tests/compiler/function/input/integers.in rename to tests/compiler/function/input/integers.in diff --git a/disabled_tests/compiler/function/iteration.leo b/tests/compiler/function/iteration.leo similarity index 90% rename from disabled_tests/compiler/function/iteration.leo rename to tests/compiler/function/iteration.leo index 1c0b310fa5..6811a9da9c 100644 --- a/disabled_tests/compiler/function/iteration.leo +++ b/tests/compiler/function/iteration.leo @@ -12,7 +12,7 @@ function main(y: bool) -> bool { let a = 0u32; for i in 0..10 { - a += one(); + a = a + one(); } return (a == 10u32) == y; diff --git a/disabled_tests/compiler/function/iteration_repeated.leo b/tests/compiler/function/iteration_repeated.leo similarity index 93% rename from disabled_tests/compiler/function/iteration_repeated.leo rename to tests/compiler/function/iteration_repeated.leo index bf443867bd..bbcd429322 100644 --- a/disabled_tests/compiler/function/iteration_repeated.leo +++ b/tests/compiler/function/iteration_repeated.leo @@ -8,7 +8,7 @@ function iteration() -> u32 { let a = 0u32; for i in 0..10 { - a += 1; + a = a + 1; } return a; diff --git a/disabled_tests/compiler/function/repeated.leo b/tests/compiler/function/repeated.leo similarity index 100% rename from disabled_tests/compiler/function/repeated.leo rename to tests/compiler/function/repeated.leo diff --git a/disabled_tests/compiler/function/return.leo b/tests/compiler/function/return.leo similarity index 100% rename from disabled_tests/compiler/function/return.leo rename to tests/compiler/function/return.leo diff --git a/tests/expectations/compiler/compiler/function/conditional_return.leo.out b/tests/expectations/compiler/compiler/function/conditional_return.leo.out index ffd8cd9391..cb741287f0 100644 --- a/tests/expectations/compiler/compiler/function/conditional_return.leo.out +++ b/tests/expectations/compiler/compiler/function/conditional_return.leo.out @@ -2,21 +2,8 @@ namespace: Compile expectation: Pass outputs: - - circuit: - num_public_variables: 0 - num_private_variables: 95 - num_constraints: 127 - at: 2cbb45563950440ec6b2ad12e378f1df49d6a12d4e773f0aa898f65f4eb109ff - bt: 7e12153373f45abf58e3b2954d1f1abfc951c7c1203e9e6c96fc37d9d25d8442 - ct: 50977b6cd45450d9fddf5934d9167f889165f6ff117b03bb780bd6d89434daf4 - output: - - input_file: input/integers.in - output: - registers: - a: - type: u32 - value: "4" - initial_ast: b0aee81e563eee312c23111cbc8e4539b75e0327aa542a47fab9d4ef37b38fbe - imports_resolved_ast: 0804164d1eb1d00132f7f5a7f2610d939694ece73e1705062dbd2793308c2cc8 - canonicalized_ast: 0804164d1eb1d00132f7f5a7f2610d939694ece73e1705062dbd2793308c2cc8 - type_inferenced_ast: e1a8d8a2ad3b963df503aa562c3b59d37a9c083e63d7de2cc871fd86c6c2be8c + - output: + - input_file: "[main]\na: u32 = 0;\nb: u32 = 0;\n\n[registers]\na: u32 = 0;\nb: u32 = 0;" + initial_input_ast: 5f87daedee2388c007b6a79619b20407b8460a41ff30433a611554f9bacd6ecf + symbol_table: 201ed1188a77438794f46c40fd317d61309595d6b8a6964db2391ea33194ba9c + initial_ast: 9e6a274bbf78b10fc2fe402fb5b75fec31690d4661259dec5695ee38520a9d6f diff --git a/tests/expectations/compiler/compiler/function/iteration.leo.out b/tests/expectations/compiler/compiler/function/iteration.leo.out index b6d3f4c789..c099c194c1 100644 --- a/tests/expectations/compiler/compiler/function/iteration.leo.out +++ b/tests/expectations/compiler/compiler/function/iteration.leo.out @@ -2,21 +2,8 @@ namespace: Compile expectation: Pass outputs: - - circuit: - num_public_variables: 0 - num_private_variables: 1 - num_constraints: 1 - at: 042610d0fd1fe6d6ac112138f8755752f44c7d2a00f1b5960574d6da5cda393f - bt: e97756698880ab7555a959a5fb5c6b4e15bd64612aa677adbfe2d0bd91f0a83c - ct: cf1cbb66a638b4860a516671fb74850e6ccf787fe6c4c8d29e9c04efe880bd05 - output: - - input_file: input/dummy.in - output: - registers: - r0: - type: bool - value: "true" - initial_ast: 15a5fd1ead3be9705022c6b8d6b1d5b027ce3372197d4d342f30ba5dc5108d3a - imports_resolved_ast: be81990192561dd8a22cbf67cc29447f0a61a33b8bb676819be381c84298c4d4 - canonicalized_ast: c0311c2e3223d0a32afee57aafb1323bb08366a904d0775ef48f701bc108e37d - type_inferenced_ast: 8a5cc60bef30ee846dd5bd18f0d1df4539c0b6c000f7dca1aeb1b3853bb10621 + - output: + - input_file: "[main]\na: u32 = 10;\nb: u32 = 100;\ny: bool = true;\n\n[registers]\nr0: bool = true;\nr1: bool = true;\n" + initial_input_ast: d718416ac1a3ae6c6d9cc30f75175eb408f584cff8de4994a756a054e4571dbc + symbol_table: b3e2b8611c915bb1cc02c55da02f52b14220c46b641a64c12d373e5b080e05aa + initial_ast: fe8956cdb15c1c47f66eaf29a4432aba5bc8ac69317bcde3373515ab3a9c4e0f diff --git a/tests/expectations/compiler/compiler/function/iteration_repeated.leo.out b/tests/expectations/compiler/compiler/function/iteration_repeated.leo.out index 29ddba27e8..79f5e27c56 100644 --- a/tests/expectations/compiler/compiler/function/iteration_repeated.leo.out +++ b/tests/expectations/compiler/compiler/function/iteration_repeated.leo.out @@ -2,21 +2,8 @@ namespace: Compile expectation: Pass outputs: - - circuit: - num_public_variables: 0 - num_private_variables: 1 - num_constraints: 1 - at: 042610d0fd1fe6d6ac112138f8755752f44c7d2a00f1b5960574d6da5cda393f - bt: e97756698880ab7555a959a5fb5c6b4e15bd64612aa677adbfe2d0bd91f0a83c - ct: cf1cbb66a638b4860a516671fb74850e6ccf787fe6c4c8d29e9c04efe880bd05 - output: - - input_file: input/dummy.in - output: - registers: - r0: - type: bool - value: "true" - initial_ast: 2739f323c714258c2f41be1ea0e7d5d4b1b6100d41a232204221540e3d155b98 - imports_resolved_ast: 1348982d07ba2b271bde48ec59dcadcf287d4878832bfd504dc225126f3bb0db - canonicalized_ast: 5e9ba7cd47bd28af1a72b83d830cde2c9c737cce10e87f928fb3fbbb010a81c9 - type_inferenced_ast: fb07aaa6e07d7ab768366ae79ba95f3938a76892155ca7b142d3ed65efe6c6a5 + - output: + - input_file: "[main]\na: u32 = 10;\nb: u32 = 100;\ny: bool = true;\n\n[registers]\nr0: bool = true;\nr1: bool = true;\n" + initial_input_ast: d718416ac1a3ae6c6d9cc30f75175eb408f584cff8de4994a756a054e4571dbc + symbol_table: 810eac2cd2c03bd318d5216b4bba024737c31201ee0ca7f2713ef1adf01b78d4 + initial_ast: aa3f5e742a53e960cd3e522099fca35f0a80977fe5815241a50b367c34a76600 diff --git a/tests/expectations/compiler/compiler/function/repeated.leo.out b/tests/expectations/compiler/compiler/function/repeated.leo.out index 9aac24bcb1..d821972c13 100644 --- a/tests/expectations/compiler/compiler/function/repeated.leo.out +++ b/tests/expectations/compiler/compiler/function/repeated.leo.out @@ -2,21 +2,8 @@ namespace: Compile expectation: Pass outputs: - - circuit: - num_public_variables: 0 - num_private_variables: 1 - num_constraints: 1 - at: 042610d0fd1fe6d6ac112138f8755752f44c7d2a00f1b5960574d6da5cda393f - bt: e97756698880ab7555a959a5fb5c6b4e15bd64612aa677adbfe2d0bd91f0a83c - ct: cf1cbb66a638b4860a516671fb74850e6ccf787fe6c4c8d29e9c04efe880bd05 - output: - - input_file: input/dummy.in - output: - registers: - r0: - type: bool - value: "true" - initial_ast: 9db2132a80b875db93ba9faa272d46c8e0b9bd3e561f457e4388b6b75f2da708 - imports_resolved_ast: 1d17d29a3020a099484220650ad8f1477b713874f5ba7181a4e96752f9addbe3 - canonicalized_ast: 1d17d29a3020a099484220650ad8f1477b713874f5ba7181a4e96752f9addbe3 - type_inferenced_ast: 333404df1440cae1176b04c0c9eee5a0370c16295a20ce45c6144849e209ff44 + - output: + - input_file: "[main]\na: u32 = 10;\nb: u32 = 100;\ny: bool = true;\n\n[registers]\nr0: bool = true;\nr1: bool = true;\n" + initial_input_ast: d718416ac1a3ae6c6d9cc30f75175eb408f584cff8de4994a756a054e4571dbc + symbol_table: 2cfbddeb0164fe71820d396f5eb04b09e354158022e54c498a676cb9ce676a57 + initial_ast: af7f82d7b8b1c09d0658813c7f59fa5ae9b65f697ae04399d01f6fb142e5f880 diff --git a/tests/expectations/compiler/compiler/function/return.leo.out b/tests/expectations/compiler/compiler/function/return.leo.out index c47ff8ed25..e5f58c7871 100644 --- a/tests/expectations/compiler/compiler/function/return.leo.out +++ b/tests/expectations/compiler/compiler/function/return.leo.out @@ -2,21 +2,8 @@ namespace: Compile expectation: Pass outputs: - - circuit: - num_public_variables: 0 - num_private_variables: 1 - num_constraints: 1 - at: 042610d0fd1fe6d6ac112138f8755752f44c7d2a00f1b5960574d6da5cda393f - bt: e97756698880ab7555a959a5fb5c6b4e15bd64612aa677adbfe2d0bd91f0a83c - ct: cf1cbb66a638b4860a516671fb74850e6ccf787fe6c4c8d29e9c04efe880bd05 - output: - - input_file: input/dummy.in - output: - registers: - r0: - type: bool - value: "true" - initial_ast: baf6543c53c08f26703bca8541dd804c699470fd9378c5f1fc0edccf8f070a54 - imports_resolved_ast: bc8f34c08103383ddc262f881a669798e66f8944302448fd87315928e5a161e4 - canonicalized_ast: bc8f34c08103383ddc262f881a669798e66f8944302448fd87315928e5a161e4 - type_inferenced_ast: ccdd5b12784e3763ec28fe860feb45e0c3b8866d15e8b939ab8fe8c343d1b855 + - output: + - input_file: "[main]\na: u32 = 10;\nb: u32 = 100;\ny: bool = true;\n\n[registers]\nr0: bool = true;\nr1: bool = true;\n" + initial_input_ast: d718416ac1a3ae6c6d9cc30f75175eb408f584cff8de4994a756a054e4571dbc + symbol_table: b25c0ab70906c0cac81eca91609c3ad6201198c2f871147e455f0689d1222e6d + initial_ast: 3c9f874c442a8b41ff0e3f3f212d96690d2665022d7898045bec0b18495db1bc