[polly] r279824 - Avoid the use of large unsigned values in isl unit test

Tobias Grosser via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 26 08:42:39 PDT 2016


Author: grosser
Date: Fri Aug 26 10:42:38 2016
New Revision: 279824

URL: http://llvm.org/viewvc/llvm-project?rev=279824&view=rev
Log:
Avoid the use of large unsigned values in isl unit test

isl_val_int_from_ui takes an 'unsigned long' which has on 32-bit and LLP64
windows systems only 32 bit. Hence, make sure we do not use it with constants
that are larger than 32 bit.

Reported-by: Michael Kruse <llvm at meinersbur.de>

Modified:
    polly/trunk/unittests/Isl/IslTest.cpp

Modified: polly/trunk/unittests/Isl/IslTest.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/unittests/Isl/IslTest.cpp?rev=279824&r1=279823&r2=279824&view=diff
==============================================================================
--- polly/trunk/unittests/Isl/IslTest.cpp (original)
+++ polly/trunk/unittests/Isl/IslTest.cpp Fri Aug 26 10:42:38 2016
@@ -185,7 +185,9 @@ TEST(Isl, IslValToAPInt) {
   }
 
   {
-    auto *IslLargeNum = isl_val_int_from_ui(IslCtx, (1ull << 60) - 1);
+    auto *IslLargeNum = isl_val_int_from_ui(IslCtx, 60);
+    IslLargeNum = isl_val_2exp(IslLargeNum);
+    IslLargeNum = isl_val_sub_ui(IslLargeNum, 1);
     auto APLargeNum = APIntFromVal(IslLargeNum);
     EXPECT_EQ((1ull << 60) - 1, APLargeNum);
     EXPECT_EQ(61u, APLargeNum.getBitWidth());




More information about the llvm-commits mailing list