================ @@ -157,4 +157,13 @@ namespace Bitfields { // expected-warning {{changes value from 100 to 0}} } +namespace BitOps { + constexpr unsigned __int128 UZero = 0; + constexpr unsigned __int128 Max = ~UZero; + static_assert(Max == ~0, ""); + static_assert((Max & 0) == 0, ""); + static_assert((UZero | 0) == 0, ""); + static_assert((Max ^ Max) == 0, ""); ---------------- AaronBallman wrote:
```suggestion static_assert((Max & 0) == 0, ""); static_assert((UZero | 0) == 0, ""); static_assert((Max ^ Max) == 0, ""); static_assert((Max & 1) == 1, ""); static_assert((UZero | 1) == 1, ""); static_assert((Max ^ UZero) == Max, ""); ``` Let's add some tests where the results aren't zero. https://github.com/llvm/llvm-project/pull/71807 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits