[tint] Use INT64_MIN instead of -0x8000000000000000ll
The latter is technically invalid as the hex constant value is larger
than the largest `long long`, and it gets promoted to an `unsigned
long long` before the unary minus. MSVC complains about this when
C++20 is enabled.
Change-Id: I905fa0be664c37638e37c0234efcfcbe9fc20d69
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/148021
Commit-Queue: James Price <jrprice@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Auto-Submit: James Price <jrprice@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
diff --git a/src/tint/lang/core/number_test.cc b/src/tint/lang/core/number_test.cc
index 2a1e61c..d8ecab4 100644
--- a/src/tint/lang/core/number_test.cc
+++ b/src/tint/lang/core/number_test.cc
@@ -13,6 +13,7 @@
// limitations under the License.
#include <cmath>
+#include <cstdint>
#include <tuple>
#include <variant>
#include <vector>
@@ -602,8 +603,8 @@
{AInt(-0x4000000000000000ll), AInt(0x1000000000000000ll), AInt(-4)},
{AInt(-0x4000000000000000ll), AInt(-0x1000000000000000ll), AInt(4)},
{AInt(-0x4000000000000000ll), AInt(0x1000000000000000ll), AInt(-4)},
- {AInt(-0x8000000000000000ll), AInt(0x1000000000000000ll), AInt(-8)},
- {AInt(-0x8000000000000000ll), AInt(-0x1000000000000000ll), AInt(8)},
+ {AInt(INT64_MIN), AInt(0x1000000000000000ll), AInt(-8)},
+ {AInt(INT64_MIN), AInt(-0x1000000000000000ll), AInt(8)},
{AInt(0), AInt::Highest(), AInt(0)},
{AInt(0), AInt::Lowest(), AInt(0)},
{OVERFLOW, AInt(0x1000000000000000ll), AInt(8)},
@@ -884,8 +885,8 @@
{AInt(-0x4000000000000000ll), AInt(0x1000000000000000ll), AInt(-4), AInt(0)},
{AInt(-0x4000000000000000ll), AInt(-0x1000000000000000ll), AInt(4), AInt(0)},
{AInt(-0x4000000000000000ll), AInt(0x1000000000000000ll), AInt(-4), AInt(0)},
- {AInt(-0x8000000000000000ll), AInt(0x1000000000000000ll), AInt(-8), AInt(0)},
- {AInt(-0x8000000000000000ll), AInt(-0x1000000000000000ll), AInt(8), AInt(0)},
+ {AInt(INT64_MIN), AInt(0x1000000000000000ll), AInt(-8), AInt(0)},
+ {AInt(INT64_MIN), AInt(-0x1000000000000000ll), AInt(8), AInt(0)},
{AInt::Highest(), AInt(1), AInt(1), AInt(AInt::kHighestValue - 1)},
{AInt::Lowest(), AInt(1), AInt(-1), AInt(AInt::kLowestValue + 1)},
{AInt::Highest(), AInt(1), AInt(0x7fffffff00000000ll), AInt(0x00000000ffffffffll)},