[libc++] fix test for unsigned char
On some systems char is unsigned.
If that is the case, we will now
test signed char twice in std::abs.
NFC. Fixes the build bots.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@369413 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/std/numerics/c.math/abs.pass.cpp b/test/std/numerics/c.math/abs.pass.cpp
index f0e4c57..33e0c7d 100644
--- a/test/std/numerics/c.math/abs.pass.cpp
+++ b/test/std/numerics/c.math/abs.pass.cpp
@@ -41,8 +41,14 @@
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>();