From 88b0dfc9d6729dcfd606e56132bcfe1061fd7949 Mon Sep 17 00:00:00 2001 From: ManuelLerchner Date: Tue, 10 Dec 2024 17:24:09 +0100 Subject: [PATCH] hotfix regression tests --- .../{03-simple-bitwise-c => 03-simple-bitwise.c} | 0 tests/regression/82-bitfield/08-refine-with-bitfield.c | 8 +++----- .../{09-refine-interval.c => 09-refine-intervalA.c} | 6 +++--- .../{10-refine-interval.c => 10-refine-intervalB.c} | 0 .../{11-refine-interval2.c => 11-refine-intervalC.c} | 0 5 files changed, 6 insertions(+), 8 deletions(-) rename tests/regression/82-bitfield/{03-simple-bitwise-c => 03-simple-bitwise.c} (100%) rename tests/regression/82-bitfield/{09-refine-interval.c => 09-refine-intervalA.c} (76%) rename tests/regression/82-bitfield/{10-refine-interval.c => 10-refine-intervalB.c} (100%) rename tests/regression/82-bitfield/{11-refine-interval2.c => 11-refine-intervalC.c} (100%) diff --git a/tests/regression/82-bitfield/03-simple-bitwise-c b/tests/regression/82-bitfield/03-simple-bitwise.c similarity index 100% rename from tests/regression/82-bitfield/03-simple-bitwise-c rename to tests/regression/82-bitfield/03-simple-bitwise.c diff --git a/tests/regression/82-bitfield/08-refine-with-bitfield.c b/tests/regression/82-bitfield/08-refine-with-bitfield.c index 64cb588f2d..9ca687671c 100644 --- a/tests/regression/82-bitfield/08-refine-with-bitfield.c +++ b/tests/regression/82-bitfield/08-refine-with-bitfield.c @@ -43,7 +43,6 @@ int main() { // Testing OR operations with patterns int OR_MASK = 0x55; // 01010101 in binary if ((a | OR_MASK) == 0x55) { - __goblint_assert(a == 0); // Only possible if a is 0 __goblint_assert((a | 0xFF) == 0xFF); // ORing with all 1s gives all 1s } @@ -74,7 +73,7 @@ int main() { if ((a & SHIFT_MASK) == SHIFT_MASK) { __goblint_assert((a & 12) == 12); // Both bits must be set __goblint_assert(((a >> 2) & 3) == 3); // When shifted right, lowest bits must be 11 - __goblint_assert(((a << 2) & 12) == 12); // When shifted left, highest bits must be 1100 + __goblint_assert(((a << 2) & 48) == 48); // When shifted left, highest bits must be 11 } int SHIFTED = 0x7 << 3; // 111000 in binary @@ -89,10 +88,9 @@ int main() { } // Testing bitwise complement - int COMP_MASK = ~0xF0; // Complement of 11110000 + int COMP_MASK = ~0x0F; if ((a & COMP_MASK) == 0x0F) { - __goblint_assert((a & 0xF0) == 0); // Upper 4 bits must be 0 - __goblint_assert((a & 0x0F) == 0x0F); // Lower 4 bits must be all 1s + __goblint_check(0); // NOWARN (unreachable) } return 0; diff --git a/tests/regression/82-bitfield/09-refine-interval.c b/tests/regression/82-bitfield/09-refine-intervalA.c similarity index 76% rename from tests/regression/82-bitfield/09-refine-interval.c rename to tests/regression/82-bitfield/09-refine-intervalA.c index 69c24ea0e3..0ff9f3b9e3 100644 --- a/tests/regression/82-bitfield/09-refine-interval.c +++ b/tests/regression/82-bitfield/09-refine-intervalA.c @@ -11,10 +11,10 @@ int main() { if ((a & inv_mask) == 0) { __goblint_check(a <= 14); // SUCCESS - __goblint_check(a >= 1); // SUCCESS + __goblint_check(a >= 0); // SUCCESS - if (1 <= a && a <= 14) { - printf("a is in the interval [1, 14]\n"); + if (0 <= a && a <= 14) { + printf("a is in the interval [0, 14]\n"); } else { __goblint_check(0); // NOWARN (unreachable) } diff --git a/tests/regression/82-bitfield/10-refine-interval.c b/tests/regression/82-bitfield/10-refine-intervalB.c similarity index 100% rename from tests/regression/82-bitfield/10-refine-interval.c rename to tests/regression/82-bitfield/10-refine-intervalB.c diff --git a/tests/regression/82-bitfield/11-refine-interval2.c b/tests/regression/82-bitfield/11-refine-intervalC.c similarity index 100% rename from tests/regression/82-bitfield/11-refine-interval2.c rename to tests/regression/82-bitfield/11-refine-intervalC.c