diff options
-rw-r--r-- | evaluate.c | 5 | ||||
-rw-r--r-- | validation/linear/shift-assign2.c | 1 |
2 files changed, 5 insertions, 1 deletions
@@ -1348,6 +1348,11 @@ static int evaluate_assign_op(struct expression *expr) unrestrict(expr->right, sclass, &s); source = integer_promotion(s); expr->right = cast_to(expr->right, source); + + // both gcc & clang seems to do this, so ... + if (target->bit_size > source->bit_size) + expr->right = cast_to(expr->right, &uint_ctype); + goto Cast; } else if (!(sclass & TYPE_RESTRICT)) goto usual; diff --git a/validation/linear/shift-assign2.c b/validation/linear/shift-assign2.c index 30d74376..9990ac38 100644 --- a/validation/linear/shift-assign2.c +++ b/validation/linear/shift-assign2.c @@ -13,7 +13,6 @@ u64 u64s32(u64 a, s32 b) { a >>= b; return a; } /* * check-name: shift-assign2 * check-command: test-linearize -Wno-decl $file - * check-known-to-fail * * check-output-start s64s16: |