harec

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 9a8438bf0a90d7a4dc6302d0eb304894d9859f1b
parent a36b7b00417e90d192550202ff4b209a683a15c4
Author: Eyal Sawady <ecs@d2evs.net>
Date:   Sat, 26 Mar 2022 19:40:18 +0000

tests/25-promotion: fix shift behavior

The old tests relied on some incorrect qbe behavior which was fixed in
e7c13e8d0191d9e8987af42a8561fceba0f6c2f1. Per the IL reference:

> The shifting amount is taken modulo the size of the result type

Thus, 0xFFu8 << 32u32 == 0xFFu32, not 0u32.

Signed-off-by: Eyal Sawady <ecs@d2evs.net>

Diffstat:
Mtests/25-promotion.ha | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/25-promotion.ha b/tests/25-promotion.ha @@ -2,7 +2,7 @@ export fn main() void = { assert(0xFFu8 << 8u16 == 0xFF00u16); assert(0xFFu8 << 8u8 == 0u8); assert(0xFFu8 << 24u32 == 0xFF000000u32); - assert(0xFFu8 << 32u32 == 0u32); + assert(0xFFu8 << 32u32 == 0xFFu32); assert(0xFFu8 << 32u64 == 0xFF00000000u64); -// assert(0xFFu8 << 64u64 == 0u64); TODO + assert(0xFFu8 << 64u64 == 0xFFu64); };