summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZoe Carver <z.zoelec2@gmail.com>2019-08-20 17:09:00 +0000
committerZoe Carver <z.zoelec2@gmail.com>2019-08-20 17:09:00 +0000
commit86d560ff1b7101506329331fc392a2d67323d298 (patch)
tree8e0a5c7dacd2e2f106124fdb9978436a9ec92531
parent2e897a94f587d035271793c71f189f1f14445c5b (diff)
downloadbcm5719-llvm-86d560ff1b7101506329331fc392a2d67323d298.tar.gz
bcm5719-llvm-86d560ff1b7101506329331fc392a2d67323d298.zip
[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. llvm-svn: 369413
-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