summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libcxx/test/std/numerics/c.math/abs.pass.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/libcxx/test/std/numerics/c.math/abs.pass.cpp b/libcxx/test/std/numerics/c.math/abs.pass.cpp
index f0e4c57f8b6..33e0c7d64c4 100644
--- a/libcxx/test/std/numerics/c.math/abs.pass.cpp
+++ b/libcxx/test/std/numerics/c.math/abs.pass.cpp
@@ -41,8 +41,14 @@ void test_big()
int main(int, char**)
{
+ // On some systems char is unsigned.
+ // If that is the case, we should just test signed char twice.
+ typedef typename std::conditional<
+ std::is_signed<char>::value, char, signed char
+ >::type SignedChar;
+
test_abs<short int, typename correct_size_int<short int>::type>();
- test_abs<char, typename correct_size_int<char>::type>();
+ test_abs<SignedChar, typename correct_size_int<SignedChar>::type>();
test_abs<signed char, typename correct_size_int<signed char>::type>();
test_abs<int, typename correct_size_int<int>::type>();
OpenPOWER on IntegriCloud