diff --git a/tests/rng/test.c b/tests/rng/test.c
index d73722e4e811bc6c5ef00d095c901ffbf49836cc..02555a33448362eb050fe4531943be235bba74f9 100644
--- a/tests/rng/test.c
+++ b/tests/rng/test.c
@@ -154,7 +154,7 @@ void test_distributions(uint32_t samples)
 
         /* count bits */
         for (int i = 0; i < 32; i++) {
-            if (value & (1 << i)) {
+            if (value & (UINT32_C(1) << i)) {
                 distributions[i]++;
             }
         }