From 630508c4ae0ca84a27ae13f0dc713a94ffc114f5 Mon Sep 17 00:00:00 2001 From: Pranav Gaddamadugu Date: Fri, 13 Oct 2023 16:11:13 -0400 Subject: [PATCH] Update tests --- tests/test-framework/benches/leo_compiler.rs | 10 +++++----- .../compiler/array/array_in_function_signature.leo | 2 ++ tests/tests/compiler/array/array_of_records.leo | 2 +- .../compiler/array/array_variable_access_fail.leo | 2 +- tests/tests/execution/array_sum.leo | 2 +- 5 files changed, 10 insertions(+), 8 deletions(-) diff --git a/tests/test-framework/benches/leo_compiler.rs b/tests/test-framework/benches/leo_compiler.rs index f82163c868..4ee7ed60a6 100644 --- a/tests/test-framework/benches/leo_compiler.rs +++ b/tests/test-framework/benches/leo_compiler.rs @@ -242,7 +242,7 @@ impl Sample { compiler.static_single_assignment_pass(&symbol_table).expect("failed to run ssa pass"); compiler.flattening_pass(&symbol_table).expect("failed to run flattener pass"); let start = Instant::now(); - let out = compiler.destructuring_pass(&symbol_table); + let out = compiler.destructuring_pass(); let time = start.elapsed(); out.expect("failed to run destructurer pass"); time @@ -257,7 +257,7 @@ impl Sample { let symbol_table = compiler.loop_unrolling_pass(symbol_table).expect("failed to run loop unrolling pass"); compiler.static_single_assignment_pass(&symbol_table).expect("failed to run ssa pass"); compiler.flattening_pass(&symbol_table).expect("failed to run flattener pass"); - compiler.destructuring_pass(&symbol_table).expect("failed to run destructurer pass"); + compiler.destructuring_pass().expect("failed to run destructurer pass"); let start = Instant::now(); let out = compiler.function_inlining_pass(&call_graph); let time = start.elapsed(); @@ -274,7 +274,7 @@ impl Sample { let symbol_table = compiler.loop_unrolling_pass(symbol_table).expect("failed to run loop unrolling pass"); compiler.static_single_assignment_pass(&symbol_table).expect("failed to run ssa pass"); compiler.flattening_pass(&symbol_table).expect("failed to run flattener pass"); - compiler.destructuring_pass(&symbol_table).expect("failed to run destructurer pass"); + compiler.destructuring_pass().expect("failed to run destructurer pass"); compiler.function_inlining_pass(&call_graph).expect("failed to run inliner pass"); let start = Instant::now(); let out = compiler.dead_code_elimination_pass(); @@ -292,7 +292,7 @@ impl Sample { let symbol_table = compiler.loop_unrolling_pass(symbol_table).expect("failed to run loop unrolling pass"); compiler.static_single_assignment_pass(&symbol_table).expect("failed to run ssa pass"); compiler.flattening_pass(&symbol_table).expect("failed to run flattener pass"); - compiler.destructuring_pass(&symbol_table).expect("failed to run destructurer pass"); + compiler.destructuring_pass().expect("failed to run destructurer pass"); compiler.function_inlining_pass(&call_graph).expect("failed to run inliner pass"); compiler.dead_code_elimination_pass().expect("failed to run dce pass"); let start = Instant::now(); @@ -314,7 +314,7 @@ impl Sample { let symbol_table = compiler.loop_unrolling_pass(symbol_table).expect("failed to run loop unrolling pass"); compiler.static_single_assignment_pass(&symbol_table).expect("failed to run ssa pass"); compiler.flattening_pass(&symbol_table).expect("failed to run flattening pass"); - compiler.destructuring_pass(&symbol_table).expect("failed to run destructuring pass"); + compiler.destructuring_pass().expect("failed to run destructuring pass"); compiler.function_inlining_pass(&call_graph).expect("failed to run function inlining pass"); compiler.dead_code_elimination_pass().expect("failed to run dce pass"); compiler diff --git a/tests/tests/compiler/array/array_in_function_signature.leo b/tests/tests/compiler/array/array_in_function_signature.leo index e40b6f43b8..d472b72ebb 100644 --- a/tests/tests/compiler/array/array_in_function_signature.leo +++ b/tests/tests/compiler/array/array_in_function_signature.leo @@ -13,10 +13,12 @@ program test.aleo { } function baz(a: [bool; 8]) -> bool { + assert(a[0u8]); return true; } function qux(a: [bool; 8]) -> [bool; 8] { + assert(a[0u8]); return a; } } diff --git a/tests/tests/compiler/array/array_of_records.leo b/tests/tests/compiler/array/array_of_records.leo index 279c4f1c38..e42ce452d0 100644 --- a/tests/tests/compiler/array/array_of_records.leo +++ b/tests/tests/compiler/array/array_of_records.leo @@ -1,6 +1,6 @@ /* namespace: Compile -expectation: Pass +expectation: Fail */ program test.aleo { diff --git a/tests/tests/compiler/array/array_variable_access_fail.leo b/tests/tests/compiler/array/array_variable_access_fail.leo index a86f14ba28..e2d40e1cd9 100644 --- a/tests/tests/compiler/array/array_variable_access_fail.leo +++ b/tests/tests/compiler/array/array_variable_access_fail.leo @@ -1,6 +1,6 @@ /* namespace: Compile -expectation: Pass +expectation: Fail */ program test.aleo { diff --git a/tests/tests/execution/array_sum.leo b/tests/tests/execution/array_sum.leo index cc060a2a10..f8db8831f4 100644 --- a/tests/tests/execution/array_sum.leo +++ b/tests/tests/execution/array_sum.leo @@ -11,7 +11,7 @@ cases: program test.aleo { transition sum_manually(a: [u64; 4]) -> u64 { - return a[0] + a[1] + a[2] + a[3]; + return a[0u8] + a[1u8] + a[2u8] + a[3u8]; } transition sum_with_loop(a: [u64; 4]) -> u64 {