diff options
author | Tobias Grosser <tobias@grosser.es> | 2017-02-23 12:48:42 +0000 |
---|---|---|
committer | Tobias Grosser <tobias@grosser.es> | 2017-02-23 12:48:42 +0000 |
commit | 59d23bbdc665c9d62bd9e6d598bfbaa73960ed7e (patch) | |
tree | 20015891ef7900e7284561d80b0f05a25809f1b1 /polly/lib/External/isl/isl_test_int.c | |
parent | d410fc8f280fd9ab72af9257bf1831890bccc39e (diff) | |
download | bcm5719-llvm-59d23bbdc665c9d62bd9e6d598bfbaa73960ed7e.tar.gz bcm5719-llvm-59d23bbdc665c9d62bd9e6d598bfbaa73960ed7e.zip |
Update isl to isl-0.18-282-g12465a5
Besides a variety of smaller cleanups, this update also contains a correctness
fix to isl coalesce which resolves a crash in Polly.
llvm-svn: 295966
Diffstat (limited to 'polly/lib/External/isl/isl_test_int.c')
-rw-r--r-- | polly/lib/External/isl/isl_test_int.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/polly/lib/External/isl/isl_test_int.c b/polly/lib/External/isl/isl_test_int.c index 9ae30ade411..a3d60bc179b 100644 --- a/polly/lib/External/isl/isl_test_int.c +++ b/polly/lib/External/isl/isl_test_int.c @@ -466,6 +466,17 @@ static void int_test_abs_cmp(isl_int expected, isl_int lhs, isl_int rhs) assert(-exp == sgn(isl_int_abs_cmp(rhs, lhs))); } +/* If "expected" is equal to 1, then check that "rhs" divides "lhs". + * If "expected" is equal to 0, then check that "rhs" does not divide "lhs". + */ +static void int_test_divisible(isl_int expected, isl_int lhs, isl_int rhs) +{ + int exp; + + exp = isl_int_get_si(expected); + assert(isl_int_is_divisible_by(lhs, rhs) == exp); +} + struct { void (*fn)(isl_int, isl_int, isl_int); char *expected, *lhs, *rhs; @@ -596,6 +607,22 @@ struct { { &int_test_abs_cmp, "-1", "5", "9223372036854775807" }, { &int_test_cmps, "1", "5", "-9223372036854775809" }, { &int_test_abs_cmp, "-1", "5", "-9223372036854775809" }, + + { &int_test_divisible, "1", "0", "0" }, + { &int_test_divisible, "0", "1", "0" }, + { &int_test_divisible, "0", "2", "0" }, + { &int_test_divisible, "0", "2147483647", "0" }, + { &int_test_divisible, "0", "9223372036854775807", "0" }, + { &int_test_divisible, "1", "0", "1" }, + { &int_test_divisible, "1", "1", "1" }, + { &int_test_divisible, "1", "2", "1" }, + { &int_test_divisible, "1", "2147483647", "1" }, + { &int_test_divisible, "1", "9223372036854775807", "1" }, + { &int_test_divisible, "1", "0", "2" }, + { &int_test_divisible, "0", "1", "2" }, + { &int_test_divisible, "1", "2", "2" }, + { &int_test_divisible, "0", "2147483647", "2" }, + { &int_test_divisible, "0", "9223372036854775807", "2" }, }; /* Tests the isl_int_* function to give the expected results. Tests are |