diff --git a/test_programs/execution_success/regression_6834/Nargo.toml b/test_programs/execution_success/regression_6834/Nargo.toml new file mode 100644 index 00000000000..edc3257d52d --- /dev/null +++ b/test_programs/execution_success/regression_6834/Nargo.toml @@ -0,0 +1,7 @@ +[package] +name = "regression_6834" +version = "0.1.0" +type = "bin" +authors = [""] + +[dependencies] diff --git a/test_programs/execution_success/regression_6834/Prover.toml b/test_programs/execution_success/regression_6834/Prover.toml new file mode 100644 index 00000000000..3c12b06d7f8 --- /dev/null +++ b/test_programs/execution_success/regression_6834/Prover.toml @@ -0,0 +1,2 @@ +year = 2000 +min_age = 20 diff --git a/test_programs/execution_success/regression_6834/src/main.nr b/test_programs/execution_success/regression_6834/src/main.nr new file mode 100644 index 00000000000..1ce03fc5df3 --- /dev/null +++ b/test_programs/execution_success/regression_6834/src/main.nr @@ -0,0 +1,13 @@ +fn main(year: u32, min_age: u8) { + if min_age == 0 { + if year > 2028 { + assert((((year - 1) - 2028) / 4 + 1) as i32 >= 0); + } + } else { + if year > 2028 { + // Uncomment the next line and the assertion on line 10 will pass + // assert(year > 2028); + assert((((year - 1) - 2028) / 4 + 1) as i32 >= 0); + } + } +}