From 566d23915320379fdeedd2eb14f774ae7bf40fe9 Mon Sep 17 00:00:00 2001 From: Pranav Gaddamadugu Date: Wed, 10 Aug 2022 09:27:50 -0700 Subject: [PATCH] Fix some tests --- tests/compiler/integers/i128/negate_min_fail.leo | 5 ++--- tests/compiler/integers/i16/negate_min_fail.leo | 5 ++--- tests/compiler/integers/i32/negate_min_fail.leo | 5 ++--- tests/compiler/integers/i64/negate_min_fail.leo | 5 ++--- tests/compiler/integers/i8/negate_min_fail.leo | 5 ++--- .../compiler/integers/i128/negate_min_fail.out | 8 ++++---- .../compiler/integers/i16/negate_min_fail.out | 8 ++++---- .../compiler/integers/i32/negate_min_fail.out | 8 ++++---- .../compiler/integers/i64/negate_min_fail.out | 8 ++++---- .../expectations/compiler/integers/i8/negate_min_fail.out | 8 ++++---- 10 files changed, 30 insertions(+), 35 deletions(-) diff --git a/tests/compiler/integers/i128/negate_min_fail.leo b/tests/compiler/integers/i128/negate_min_fail.leo index 1f5d5ed74c..7a6039d462 100644 --- a/tests/compiler/integers/i128/negate_min_fail.leo +++ b/tests/compiler/integers/i128/negate_min_fail.leo @@ -8,8 +8,7 @@ input_file: ../inputs/dummy.in @program function main(y: bool) -> i128 { - let a: i128 = -170141183460469231731687303715884105727i128; - let b: i128 = a - 1i128; + let a: i128 = -170141183460469231731687303715884105728i128; - return -b; // This line attempts to return 170141183460469231731687303715884105728i128 however, the largest i128 value is 170141183460469231731687303715884105727i128. + return -a; // This line attempts to return 170141183460469231731687303715884105728i128 however, the largest i128 value is 170141183460469231731687303715884105727i128. } diff --git a/tests/compiler/integers/i16/negate_min_fail.leo b/tests/compiler/integers/i16/negate_min_fail.leo index 07215ece6b..07d74bd73d 100644 --- a/tests/compiler/integers/i16/negate_min_fail.leo +++ b/tests/compiler/integers/i16/negate_min_fail.leo @@ -8,8 +8,7 @@ input_file: ../inputs/dummy.in @program function main(y: bool) -> i16 { - let a: i16 = -32767i16; - let b: i16 = a - 1i16; + let a: i16 = -32768i16; - return -b; // This line attempts to return 32768i16 however, the largest i16 value is 32767i16. + return -a; // This line attempts to return 32768i16 however, the largest i16 value is 32767i16. } diff --git a/tests/compiler/integers/i32/negate_min_fail.leo b/tests/compiler/integers/i32/negate_min_fail.leo index 48c79b3c6a..ea663d3831 100644 --- a/tests/compiler/integers/i32/negate_min_fail.leo +++ b/tests/compiler/integers/i32/negate_min_fail.leo @@ -8,8 +8,7 @@ input_file: ../inputs/dummy.in @program function main(y: bool) -> i32 { - let a: i32 = -2147483647i32; - let b: i32 = a - 1i32; + let a: i32 = -2147483648i32; - return -b; // This line attempts to return 2147483648i32 however, the largest i32 value is 2147483647i32. + return -a; // This line attempts to return 2147483648i32 however, the largest i32 value is 2147483647i32. } diff --git a/tests/compiler/integers/i64/negate_min_fail.leo b/tests/compiler/integers/i64/negate_min_fail.leo index 1ea7c0189f..98b936056e 100644 --- a/tests/compiler/integers/i64/negate_min_fail.leo +++ b/tests/compiler/integers/i64/negate_min_fail.leo @@ -8,8 +8,7 @@ input_file: ../inputs/dummy.in @program function main(y: bool) -> i64 { - let a: i64 = -9223372036854775807i64; - let b: i64 = a - 1i64; + let a: i64 = -9223372036854775808i64; - return -b; // This line attempts to return 9223372036854775808i64 however, the largest i64 value is 9223372036854775807i64. + return -a; // This line attempts to return 9223372036854775808i64 however, the largest i64 value is 9223372036854775807i64. } diff --git a/tests/compiler/integers/i8/negate_min_fail.leo b/tests/compiler/integers/i8/negate_min_fail.leo index 8db789fcef..58e3e79e46 100644 --- a/tests/compiler/integers/i8/negate_min_fail.leo +++ b/tests/compiler/integers/i8/negate_min_fail.leo @@ -8,8 +8,7 @@ input_file: ../inputs/dummy.in @program function main(y: bool) -> i8 { - let a: i8 = -127i8; - let b: i8 = a - 1i8; + let a: i8 = -128i8; - return -b; // This line attempts to return 128i8 however, the largest i8 value is 127i8. + return -a; // This line attempts to return 128i8 however, the largest i8 value is 127i8. } diff --git a/tests/expectations/compiler/integers/i128/negate_min_fail.out b/tests/expectations/compiler/integers/i128/negate_min_fail.out index df2e5ea92c..6f389f0d1d 100644 --- a/tests/expectations/compiler/integers/i128/negate_min_fail.out +++ b/tests/expectations/compiler/integers/i128/negate_min_fail.out @@ -3,7 +3,7 @@ namespace: Compile expectation: Pass outputs: - output: - - initial_input_ast: cc445b61155a660fbbd967b7736f50f07a9f5a139143a7f486b80eca2aaa29f2 - initial_ast: 805299a00fb71e9fb1d001b4a9706e58965a8aeb3189b269021e1d28d4aa4039 - unrolled_ast: 805299a00fb71e9fb1d001b4a9706e58965a8aeb3189b269021e1d28d4aa4039 - ssa_ast: 84c94b86325af97e2fc4e2ba2fd959e2ecaa4500249935d1e08b074a588a8e40 + - initial_input_ast: bebb28a7f8a3f608d135f8e25ddff07a36e01448741c59b662c8d6f98a7f302c + initial_ast: 274c41a99717c990553f9f21404ef3fa78a992e81d8db0b9c866be2b1365add9 + unrolled_ast: 274c41a99717c990553f9f21404ef3fa78a992e81d8db0b9c866be2b1365add9 + ssa_ast: ae4a25d296a61714c14209db27c3e9da80c3f9af2b5f0bba0a3cfadf6f8c82cc diff --git a/tests/expectations/compiler/integers/i16/negate_min_fail.out b/tests/expectations/compiler/integers/i16/negate_min_fail.out index d5a169c384..dec431bf45 100644 --- a/tests/expectations/compiler/integers/i16/negate_min_fail.out +++ b/tests/expectations/compiler/integers/i16/negate_min_fail.out @@ -3,7 +3,7 @@ namespace: Compile expectation: Pass outputs: - output: - - initial_input_ast: 6b4cdfe5abc1c4ee9ebc7c514658f87e6c179a03a18a7d9249849c1fdff20e39 - initial_ast: 0440d94eecc9c17b787fe02d2adce7e59ec555b3757abccb69d052fa9c45366a - unrolled_ast: 0440d94eecc9c17b787fe02d2adce7e59ec555b3757abccb69d052fa9c45366a - ssa_ast: 0e509b5959c4db25344bdc086628e149390fdb2640cd369362ff838469c866be + - initial_input_ast: 7d7d24b1f2f5007157bd3955352c5c5a27447c23c7c5c9d0760aaddec8de6c6b + initial_ast: 3dfddcf4607fa1b360809fc8a8ad1e20903f5d22fe4c74d89abfa25a949ffd33 + unrolled_ast: 3dfddcf4607fa1b360809fc8a8ad1e20903f5d22fe4c74d89abfa25a949ffd33 + ssa_ast: ab32ff2e18e2eeb5274738fad98678896bd5a6d152868a5e9cf805bb51a16b34 diff --git a/tests/expectations/compiler/integers/i32/negate_min_fail.out b/tests/expectations/compiler/integers/i32/negate_min_fail.out index e5876222c6..2edc40465d 100644 --- a/tests/expectations/compiler/integers/i32/negate_min_fail.out +++ b/tests/expectations/compiler/integers/i32/negate_min_fail.out @@ -3,7 +3,7 @@ namespace: Compile expectation: Pass outputs: - output: - - initial_input_ast: 3ca155c33debfdfb0192a7bddb387e5e7fafeeaf31f0ef5089be2352d74faed3 - initial_ast: 363b5086541a48fb6f45600281a01b2b29ebd11364eb7bd7f99df619c4335ae4 - unrolled_ast: 363b5086541a48fb6f45600281a01b2b29ebd11364eb7bd7f99df619c4335ae4 - ssa_ast: 6dfca0c27bda52e7578da2abd3f209ad58769d1087f0ef6c0bcb0fe8395f9185 + - initial_input_ast: 83b4ce2489e23f80e3cfbcecbde6664a9c98966c4b0ceff53c41d4ac9f1aa5d4 + initial_ast: 0c959c2e3f8e965b48b144c8a907f737dfc7b2fc6123ff45452885eda7dd5569 + unrolled_ast: 0c959c2e3f8e965b48b144c8a907f737dfc7b2fc6123ff45452885eda7dd5569 + ssa_ast: 4480e8d0d649d5c404fa4a2aaeec95c3ed4250f4ad3a6300cf156740334d9b55 diff --git a/tests/expectations/compiler/integers/i64/negate_min_fail.out b/tests/expectations/compiler/integers/i64/negate_min_fail.out index aa11612fa0..83b31bd913 100644 --- a/tests/expectations/compiler/integers/i64/negate_min_fail.out +++ b/tests/expectations/compiler/integers/i64/negate_min_fail.out @@ -3,7 +3,7 @@ namespace: Compile expectation: Pass outputs: - output: - - initial_input_ast: b92bed9f53de41035d8001d9f8be4a5631049b47066b2d71de4c461f7f2a464d - initial_ast: 0cc342cea14752ac6e0a311fb66df84fa36e3f2a58dc7f9947a69aed91dfc410 - unrolled_ast: 0cc342cea14752ac6e0a311fb66df84fa36e3f2a58dc7f9947a69aed91dfc410 - ssa_ast: 1669ebc39317a0782b40b3b6fc21b48f1e8b3d0e5363eeeb12df66a21fb45372 + - initial_input_ast: 3ca155c33debfdfb0192a7bddb387e5e7fafeeaf31f0ef5089be2352d74faed3 + initial_ast: 66ea25d2b8cb34ebbfa4e2cb29c0a2b24c4a2ecc2c0c196187cc5d152ea0f497 + unrolled_ast: 66ea25d2b8cb34ebbfa4e2cb29c0a2b24c4a2ecc2c0c196187cc5d152ea0f497 + ssa_ast: 76ba17718a3480dce449628c113c5d2d6267b47b133197353b3a8aa039d1a19c diff --git a/tests/expectations/compiler/integers/i8/negate_min_fail.out b/tests/expectations/compiler/integers/i8/negate_min_fail.out index 1afe34e405..2c974ef346 100644 --- a/tests/expectations/compiler/integers/i8/negate_min_fail.out +++ b/tests/expectations/compiler/integers/i8/negate_min_fail.out @@ -3,7 +3,7 @@ namespace: Compile expectation: Pass outputs: - output: - - initial_input_ast: 53570f9b01fe828f720945ab561a01e4c514f52cec152aa4b458f1f0da94bcd2 - initial_ast: da5ed5d49f447486e6ddb77ccf04513ca4bf3294a908756a820f7f06fdadbe61 - unrolled_ast: da5ed5d49f447486e6ddb77ccf04513ca4bf3294a908756a820f7f06fdadbe61 - ssa_ast: 4040cbed0e5f812353e3481b44ef8b51b597790856a8a611e9c7dba27352ccb0 + - initial_input_ast: c206fdfeceed348568d29f8eac48d60fb03306f23294b6b7a88d873cea5becdd + initial_ast: 4f5793ec5e9217775d74b734c81a425380b1e9f2fcd6a5f1e4f5d1966b2247f1 + unrolled_ast: 4f5793ec5e9217775d74b734c81a425380b1e9f2fcd6a5f1e4f5d1966b2247f1 + ssa_ast: 48a982de96518499fb7c4b06b61a1c41528c2762b1dadb818e862d1a823d3ba5