From 58cd074c23701c28549f8ae3004e43a9b6d473a5 Mon Sep 17 00:00:00 2001 From: johanknol Date: Sun, 20 Apr 2003 11:52:03 +0000 Subject: [PATCH] no bitfields yet git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@2550 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- support/regression/tests/bitfields.c | 2 ++ support/regression/tests/logic.c | 2 -- support/regression/tests/shifts.c | 16 ++++++---------- 3 files changed, 8 insertions(+), 12 deletions(-) diff --git a/support/regression/tests/bitfields.c b/support/regression/tests/bitfields.c index b34abe00..13f81b9a 100644 --- a/support/regression/tests/bitfields.c +++ b/support/regression/tests/bitfields.c @@ -22,6 +22,7 @@ struct { void testBitfields(void) { +#if 0 // not yet c_bitfield.c0_3 = 2; c_bitfield.c3_5 = 3; ASSERT(*(char *)(&c_bitfield) == (2 + (3<<3)) ); @@ -34,4 +35,5 @@ testBitfields(void) l_bitfield.l7_10 = 234; l_bitfield.l17_15 = 2345; ASSERT(*(long *)(&l_bitfield) == (23 + (234<<7) + (2345<<17)) ); +#endif } diff --git a/support/regression/tests/logic.c b/support/regression/tests/logic.c index 1636d334..25f3e817 100644 --- a/support/regression/tests/logic.c +++ b/support/regression/tests/logic.c @@ -51,7 +51,6 @@ testLogicalAnd(void) ASSERT(true && !false); ASSERT(!false && true); - /* PENDING: Doesn't work. */ /* Test that the evaluation is aborted on the first false. */ if (true && false && neverGetHere()) { /* Tested using neverGetHere() */ @@ -80,7 +79,6 @@ testLogicalOr(void) ASSERT(!true || !false); ASSERT(false || true); - /* PENDING: Doesn't work in sdcc. */ /* Test that the evaluation is aborted on the first hit. */ if (false || true || neverGetHere()) { /* Tested using neverGetHere() */ diff --git a/support/regression/tests/shifts.c b/support/regression/tests/shifts.c index 86fe1816..c709c5a2 100644 --- a/support/regression/tests/shifts.c +++ b/support/regression/tests/shifts.c @@ -48,24 +48,20 @@ testShiftRight(void) ASSERT(result == -15); } -/** PENDING: Disabled. */ static void testShiftByteMultiples(void) { -#if 0 - /* PENDING */ {attr} {storage} {type} i; i = ({type}){vals}; - ASSERT(i>>8 == (({type}){vals} >> 8)); - ASSERT(i>>16 == (({type}){vals} >> 16)); - ASSERT(i>>24 == (({type}){vals} >> 24)); + ASSERT(i>>8 == ({type})({vals} >> 8)); + ASSERT(i>>16 == ({type})({vals} >> 16)); + ASSERT(i>>24 == ({type})({vals} >> 24)); i = ({type}){vals}; - ASSERT(i<<8 == (({type}){vals} << 8));; - ASSERT(i<<16 == (({type}){vals} << 16)); - ASSERT(i<<24 == (({type}){vals} << 24)); -#endif + ASSERT(({type})(i<<8) == ({type})({vals} << 8));; + ASSERT(({type})(i<<16) == ({type})({vals} << 16)); + ASSERT(({type})(i<<24) == ({type})({vals} << 24)); } static void -- 2.30.2