Fix a stupid inversion. This function is very rarely used and was
mostly to help split patches up, which is why it didn't get picked
up during initial testing.
2017-12-20 Richard Sandiford <richard.sandiford@linaro.org>
gcc/
* poly-int.h (multiple_p): Fix handling of two non-poly_ints.
gcc/testsuite/
* gcc.dg/plugin/poly-int-tests.h (test_nonpoly_multiple_p): New
function.
(test_nonpoly_type): Call it.
From-SVN: r255860
+2017-12-20 Richard Sandiford <richard.sandiford@linaro.org>
+
+ * poly-int.h (multiple_p): Fix handling of two non-poly_ints.
+
2017-12-20 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
* doc/invoke.texi (ARM Options): Document accepted extension options
inline typename if_nonpoly2<Ca, Cb, bool>::type
multiple_p (Ca a, Cb b)
{
- return a % b != 0;
+ return a % b == 0;
}
/* Return true if A is a (polynomial) multiple of B. */
+2017-12-20 Richard Sandiford <richard.sandiford@linaro.org>
+
+ * gcc.dg/plugin/poly-int-tests.h (test_nonpoly_multiple_p): New
+ function.
+ (test_nonpoly_type): Call it.
+
2017-12-20 Jakub Jelinek <jakub@redhat.com>
PR c++/83490
wi::uhwi (210, 16)));
}
+/* Test multiple_p for non-polynomial T. */
+
+template<typename T>
+static void
+test_nonpoly_multiple_p ()
+{
+ ASSERT_TRUE (multiple_p (T (6), T (2)));
+ ASSERT_TRUE (multiple_p (T (6), T (3)));
+ ASSERT_FALSE (multiple_p (T (6), T (4)));
+ ASSERT_FALSE (multiple_p (T (7), T (4)));
+ ASSERT_TRUE (multiple_p (T (8), T (4)));
+}
+
/* Test known_size_p for non-polynomial T. */
template<typename T>
static void
test_nonpoly_type ()
{
+ test_nonpoly_multiple_p<T> ();
test_nonpoly_known_size_p<T> ();
}