From 40a20ab97351ac988a73cfea4ec8fca1ce100f7c Mon Sep 17 00:00:00 2001 From: Alex Volkov Date: Wed, 25 Mar 2026 19:03:00 -0400 Subject: [PATCH] Expand bug1374 tests to a few other conditions --- test/val/bug1374.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/test/val/bug1374.c b/test/val/bug1374.c index b55e75fee..86f0223a9 100644 --- a/test/val/bug1374.c +++ b/test/val/bug1374.c @@ -24,6 +24,15 @@ int test1b(void) return (z == 0x89ab) ? 0 : 1; } +int test1c(void) +{ + uint8_t x = 0x95; + uint8_t y = 0xab; + uint16_t z = (x * 0) | y; + printf("%x\n", z); + return (z == 0x00ab) ? 0 : 1; +} + int test2(void) { uint16_t x = 0x8900; @@ -33,6 +42,15 @@ int test2(void) return (z == 0x89ab) ? 0 : 1; } +int test2c(void) +{ + uint16_t x = 0x6795; + uint8_t y = 0xab; + uint16_t z = (x * 0) | y; + printf("%x\n", z); + return (z == 0x00ab) ? 0 : 1; +} + int test3(void) { uint16_t x = 0x89; @@ -69,6 +87,15 @@ int test4b(void) return (z == 0x89ab) ? 0 : 1; } +int test4c(void) +{ + uint8_t x = 0x95; + uint16_t y = 0xabcd; + uint16_t z = (x * 0) | y; + printf("%x\n", z); + return (z == 0xabcd) ? 0 : 1; +} + int main(void) { res |= test1(); @@ -78,6 +105,9 @@ int main(void) res |= test1b(); res |= test3b(); res |= test4b(); + res |= test1c(); + res |= test2c(); + res |= test4c(); printf("res: %d\n", res); return res; }