[SingleSource] Don't instantiate uniform distribution with char.

As @Kai pointed out post-commit, instantiating
std::uniform_int_distribution with char is UB. To avoid this, use the
widest type the test uses (uint64_t) and convert to smaller values as
needed.
diff --git a/MicroBenchmarks/LoopVectorization/RuntimeChecks.cpp b/MicroBenchmarks/LoopVectorization/RuntimeChecks.cpp
index 51ec2a1..5ce7f8a 100644
--- a/MicroBenchmarks/LoopVectorization/RuntimeChecks.cpp
+++ b/MicroBenchmarks/LoopVectorization/RuntimeChecks.cpp
@@ -9,7 +9,7 @@
 // Initialize array A with random numbers.
 template <typename Ty>
 static void init_data(const std::unique_ptr<Ty[]> &A, unsigned N) {
-  std::uniform_int_distribution<int64_t> distrib(
+  std::uniform_int_distribution<uint64_t> distrib(
       std::numeric_limits<Ty>::min(), std::numeric_limits<Ty>::max());
   for (unsigned i = 0; i < N; i++)
     A[i] = static_cast<Ty>(distrib(rng));
diff --git a/SingleSource/UnitTests/Vectorizer/runtime-checks.cpp b/SingleSource/UnitTests/Vectorizer/runtime-checks.cpp
index 562c5f2..03f826b 100644
--- a/SingleSource/UnitTests/Vectorizer/runtime-checks.cpp
+++ b/SingleSource/UnitTests/Vectorizer/runtime-checks.cpp
@@ -3,6 +3,7 @@
 #include <limits>
 #include <memory>
 #include <random>
+#include <stdint.h>
 
 // Tests for memory runtime checks generated by the vectorizer. Runs scalar and
 // vectorized versions of a loop requiring runtime checks on the same inputs
@@ -14,7 +15,7 @@
 // Initialize arrays A with random numbers.
 template <typename Ty>
 static void init_data(const std::unique_ptr<Ty[]> &A, unsigned N) {
-  std::uniform_int_distribution<Ty> distrib(std::numeric_limits<Ty>::min(),
+  std::uniform_int_distribution<uint64_t> distrib(std::numeric_limits<Ty>::min(),
                                             std::numeric_limits<Ty>::max());
   for (unsigned i = 0; i < N; i++)
     A[i] = distrib(rng);
@@ -141,12 +142,12 @@
         A[i] = B[i] + 10;
     );
 
-    checkOverlappingMemoryOneRuntimeCheck<char>(
-        ScalarFn, VectorFn, "1 read, 1 write, step 1, char");
-    checkOverlappingMemoryOneRuntimeCheck<int>(ScalarFn, VectorFn,
-                                               "1 read, 1 write, step 1, int");
-    checkOverlappingMemoryOneRuntimeCheck<long long>(
-        ScalarFn, VectorFn, "1 read, 1 write, step 1, long long");
+    checkOverlappingMemoryOneRuntimeCheck<uint8_t>(
+        ScalarFn, VectorFn, "1 read, 1 write, step 1, uint8_t");
+    checkOverlappingMemoryOneRuntimeCheck<uint32_t>(ScalarFn, VectorFn,
+                                               "1 read, 1 write, step 1, uint32_t");
+    checkOverlappingMemoryOneRuntimeCheck<uint64_t>(
+        ScalarFn, VectorFn, "1 read, 1 write, step 1, uint64_t");
   }
 
   {
@@ -155,12 +156,12 @@
         A[i] = B[i + 3] + 10;
     );
 
-    checkOverlappingMemoryOneRuntimeCheck<char>(
-        ScalarFn, VectorFn, "1 read, 1 write, offset 3, char");
-    checkOverlappingMemoryOneRuntimeCheck<int>(
-        ScalarFn, VectorFn, "1 read, 1 write, offset 3, int");
-    checkOverlappingMemoryOneRuntimeCheck<long long>(
-        ScalarFn, VectorFn, "1 read, 1 write, offset 3, long long");
+    checkOverlappingMemoryOneRuntimeCheck<uint8_t>(
+        ScalarFn, VectorFn, "1 read, 1 write, offset 3, uint8_t");
+    checkOverlappingMemoryOneRuntimeCheck<uint32_t>(
+        ScalarFn, VectorFn, "1 read, 1 write, offset 3, uint32_t");
+    checkOverlappingMemoryOneRuntimeCheck<uint64_t>(
+        ScalarFn, VectorFn, "1 read, 1 write, offset 3, uint64_t");
   }
 
   {
@@ -169,12 +170,12 @@
         A[i] = B[i - 3] + 10;
     );
 
-    checkOverlappingMemoryOneRuntimeCheck<char>(
-        ScalarFn, VectorFn, "1 read, 1 write, offset -3, char");
-    checkOverlappingMemoryOneRuntimeCheck<int>(
-        ScalarFn, VectorFn, "1 read, 1 write, offset -3, int");
-    checkOverlappingMemoryOneRuntimeCheck<long long>(
-        ScalarFn, VectorFn, "1 read, 1 write, offset -3, long long");
+    checkOverlappingMemoryOneRuntimeCheck<uint8_t>(
+        ScalarFn, VectorFn, "1 read, 1 write, offset -3, uint8_t");
+    checkOverlappingMemoryOneRuntimeCheck<uint32_t>(
+        ScalarFn, VectorFn, "1 read, 1 write, offset -3, uint32_t");
+    checkOverlappingMemoryOneRuntimeCheck<uint64_t>(
+        ScalarFn, VectorFn, "1 read, 1 write, offset -3, uint64_t");
   }
 
   {
@@ -182,12 +183,12 @@
       for (unsigned i = TC; i > 0; i--)
         A[i] = B[i] + 10;);
 
-    checkOverlappingMemoryOneRuntimeCheck<char>(
-        ScalarFn, VectorFn, "1 read, 1 write, index count down, char");
-    checkOverlappingMemoryOneRuntimeCheck<int>(
-        ScalarFn, VectorFn, "1 read, 1 write, index count down, int");
-    checkOverlappingMemoryOneRuntimeCheck<long long>(
-        ScalarFn, VectorFn, "1 read, 1 write, index count down, long long");
+    checkOverlappingMemoryOneRuntimeCheck<uint8_t>(
+        ScalarFn, VectorFn, "1 read, 1 write, index count down, uint8_t");
+    checkOverlappingMemoryOneRuntimeCheck<uint32_t>(
+        ScalarFn, VectorFn, "1 read, 1 write, index count down, uint32_t");
+    checkOverlappingMemoryOneRuntimeCheck<uint64_t>(
+        ScalarFn, VectorFn, "1 read, 1 write, index count down, uint64_t");
   }
 
   {
@@ -196,12 +197,12 @@
         A[i] = B[i] + 10;
     );
 
-    checkOverlappingMemoryOneRuntimeCheck<char>(
-        ScalarFn, VectorFn, "1 read, 1 write, index count down 2, char");
-    checkOverlappingMemoryOneRuntimeCheck<int>(
-        ScalarFn, VectorFn, "1 read, 1 write, index count down 2, int");
-    checkOverlappingMemoryOneRuntimeCheck<long long>(
-        ScalarFn, VectorFn, "1 read, 1 write, index count down 2, long long");
+    checkOverlappingMemoryOneRuntimeCheck<uint8_t>(
+        ScalarFn, VectorFn, "1 read, 1 write, index count down 2, uint8_t");
+    checkOverlappingMemoryOneRuntimeCheck<uint32_t>(
+        ScalarFn, VectorFn, "1 read, 1 write, index count down 2, uint32_t");
+    checkOverlappingMemoryOneRuntimeCheck<uint64_t>(
+        ScalarFn, VectorFn, "1 read, 1 write, index count down 2, uint64_t");
   }
 
   {
@@ -211,15 +212,15 @@
         j += 2;
       }
     );
-    checkOverlappingMemoryOneRuntimeCheck<char>(
+    checkOverlappingMemoryOneRuntimeCheck<uint8_t>(
         ScalarFn, VectorFn,
-        "1 read, 1 write, 2 inductions, different steps, char");
-    checkOverlappingMemoryOneRuntimeCheck<int>(
+        "1 read, 1 write, 2 inductions, different steps, uint8_t");
+    checkOverlappingMemoryOneRuntimeCheck<uint32_t>(
         ScalarFn, VectorFn,
-        "1 read, 1 write, 2 inductions, different steps, int");
-    checkOverlappingMemoryOneRuntimeCheck<long long>(
+        "1 read, 1 write, 2 inductions, different steps, uint32_t");
+    checkOverlappingMemoryOneRuntimeCheck<uint64_t>(
         ScalarFn, VectorFn,
-        "1 read, 1 write, 2 inductions, different steps, long long");
+        "1 read, 1 write, 2 inductions, different steps, uint64_t");
   }
 
   {
@@ -229,13 +230,13 @@
         A[i] = B[i] + 10;
     );
 
-    checkOverlappingMemoryOneRuntimeCheck<char>(
-        ScalarFn, VectorFn, "1 read, 1 write, induction increment 2, char");
-    checkOverlappingMemoryOneRuntimeCheck<int>(
-        ScalarFn, VectorFn, "1 read, 1 write, induction increment 2, int");
-    checkOverlappingMemoryOneRuntimeCheck<long long>(
+    checkOverlappingMemoryOneRuntimeCheck<uint8_t>(
+        ScalarFn, VectorFn, "1 read, 1 write, induction increment 2, uint8_t");
+    checkOverlappingMemoryOneRuntimeCheck<uint32_t>(
+        ScalarFn, VectorFn, "1 read, 1 write, induction increment 2, uint32_t");
+    checkOverlappingMemoryOneRuntimeCheck<uint64_t>(
         ScalarFn, VectorFn,
-        "1 read, 1 write, induction increment 2, long long");
+        "1 read, 1 write, induction increment 2, uint64_t");
   }
 
   {
@@ -244,12 +245,12 @@
         A[i] = B[i] + C[i] + 10;
     );
 
-    checkOverlappingMemoryTwoRuntimeChecks<int>(
-        ScalarFn, VectorFn, "2 reads, 1 write, simple indices, int");
-    checkOverlappingMemoryTwoRuntimeChecks<char>(
-        ScalarFn, VectorFn, "2 reads, 1 write, simple indices, char");
-    checkOverlappingMemoryTwoRuntimeChecks<long long>(
-        ScalarFn, VectorFn, "2 reads, 1 write, simple indices, long long");
+    checkOverlappingMemoryTwoRuntimeChecks<uint32_t>(
+        ScalarFn, VectorFn, "2 reads, 1 write, simple indices, uint32_t");
+    checkOverlappingMemoryTwoRuntimeChecks<uint8_t>(
+        ScalarFn, VectorFn, "2 reads, 1 write, simple indices, uint8_t");
+    checkOverlappingMemoryTwoRuntimeChecks<uint64_t>(
+        ScalarFn, VectorFn, "2 reads, 1 write, simple indices, uint64_t");
   }
 
   {
@@ -261,12 +262,12 @@
       }
     );
 
-    checkOverlappingMemoryTwoRuntimeChecks<char>(
-        ScalarFn, VectorFn, "1 read, 2 writes, simple indices, char");
-    checkOverlappingMemoryTwoRuntimeChecks<int>(
-        ScalarFn, VectorFn, "1 read, 2 writes, simple indices, int");
-    checkOverlappingMemoryTwoRuntimeChecks<long long>(
-        ScalarFn, VectorFn, "1 read, 2 writes, simple indices, long long");
+    checkOverlappingMemoryTwoRuntimeChecks<uint8_t>(
+        ScalarFn, VectorFn, "1 read, 2 writes, simple indices, uint8_t");
+    checkOverlappingMemoryTwoRuntimeChecks<uint32_t>(
+        ScalarFn, VectorFn, "1 read, 2 writes, simple indices, uint32_t");
+    checkOverlappingMemoryTwoRuntimeChecks<uint64_t>(
+        ScalarFn, VectorFn, "1 read, 2 writes, simple indices, uint64_t");
   }
 
   return 0;
diff --git a/SingleSource/UnitTests/Vectorizer/runtime-checks.reference_output b/SingleSource/UnitTests/Vectorizer/runtime-checks.reference_output
index 26bfc22..3212ddc 100644
--- a/SingleSource/UnitTests/Vectorizer/runtime-checks.reference_output
+++ b/SingleSource/UnitTests/Vectorizer/runtime-checks.reference_output
@@ -1,28 +1,28 @@
-Checking 1 read, 1 write, step 1, char
-Checking 1 read, 1 write, step 1, int
-Checking 1 read, 1 write, step 1, long long
-Checking 1 read, 1 write, offset 3, char
-Checking 1 read, 1 write, offset 3, int
-Checking 1 read, 1 write, offset 3, long long
-Checking 1 read, 1 write, offset -3, char
-Checking 1 read, 1 write, offset -3, int
-Checking 1 read, 1 write, offset -3, long long
-Checking 1 read, 1 write, index count down, char
-Checking 1 read, 1 write, index count down, int
-Checking 1 read, 1 write, index count down, long long
-Checking 1 read, 1 write, index count down 2, char
-Checking 1 read, 1 write, index count down 2, int
-Checking 1 read, 1 write, index count down 2, long long
-Checking 1 read, 1 write, 2 inductions, different steps, char
-Checking 1 read, 1 write, 2 inductions, different steps, int
-Checking 1 read, 1 write, 2 inductions, different steps, long long
-Checking 1 read, 1 write, induction increment 2, char
-Checking 1 read, 1 write, induction increment 2, int
-Checking 1 read, 1 write, induction increment 2, long long
-Checking 2 reads, 1 write, simple indices, int
-Checking 2 reads, 1 write, simple indices, char
-Checking 2 reads, 1 write, simple indices, long long
-Checking 1 read, 2 writes, simple indices, char
-Checking 1 read, 2 writes, simple indices, int
-Checking 1 read, 2 writes, simple indices, long long
+Checking 1 read, 1 write, step 1, uint8_t
+Checking 1 read, 1 write, step 1, uint32_t
+Checking 1 read, 1 write, step 1, uint64_t
+Checking 1 read, 1 write, offset 3, uint8_t
+Checking 1 read, 1 write, offset 3, uint32_t
+Checking 1 read, 1 write, offset 3, uint64_t
+Checking 1 read, 1 write, offset -3, uint8_t
+Checking 1 read, 1 write, offset -3, uint32_t
+Checking 1 read, 1 write, offset -3, uint64_t
+Checking 1 read, 1 write, index count down, uint8_t
+Checking 1 read, 1 write, index count down, uint32_t
+Checking 1 read, 1 write, index count down, uint64_t
+Checking 1 read, 1 write, index count down 2, uint8_t
+Checking 1 read, 1 write, index count down 2, uint32_t
+Checking 1 read, 1 write, index count down 2, uint64_t
+Checking 1 read, 1 write, 2 inductions, different steps, uint8_t
+Checking 1 read, 1 write, 2 inductions, different steps, uint32_t
+Checking 1 read, 1 write, 2 inductions, different steps, uint64_t
+Checking 1 read, 1 write, induction increment 2, uint8_t
+Checking 1 read, 1 write, induction increment 2, uint32_t
+Checking 1 read, 1 write, induction increment 2, uint64_t
+Checking 2 reads, 1 write, simple indices, uint32_t
+Checking 2 reads, 1 write, simple indices, uint8_t
+Checking 2 reads, 1 write, simple indices, uint64_t
+Checking 1 read, 2 writes, simple indices, uint8_t
+Checking 1 read, 2 writes, simple indices, uint32_t
+Checking 1 read, 2 writes, simple indices, uint64_t
 exit 0