aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Lebar <jlebar@google.com>2018-06-30 00:32:53 +0000
committerJustin Lebar <jlebar@google.com>2018-06-30 00:32:53 +0000
commita3804aa30e2337f92348433362c441dc79c06ee4 (patch)
tree80d1e230aa0605a95b8ba24821ee0244eca40920
parent3bf4dc47b03cd04269ed9fef3449c90aca933b76 (diff)
[CUDA] Add tests that, in C++14 mode, min/max are constexpr.
Reviewers: rsmith, tra Subscribers: llvm-commits, cfe-commits, sanjoy, lahwaacz Differential Revision: https://reviews.llvm.org/D48152 git-svn-id: https://llvm.org/svn/llvm-project/test-suite/trunk@336030 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--External/CUDA/algorithm.cu4
1 files changed, 4 insertions, 0 deletions
diff --git a/External/CUDA/algorithm.cu b/External/CUDA/algorithm.cu
index e2d08db6..82956bb9 100644
--- a/External/CUDA/algorithm.cu
+++ b/External/CUDA/algorithm.cu
@@ -42,6 +42,8 @@ __device__ void cpp14_tests() {
assert(std::minmax(1, 0).second == 1);
assert(std::minmax({0, 10, -10, 100}, std::less<int>()).first == -10);
assert(std::minmax({0, 10, -10, 100}, std::less<int>()).second == 100);
+ constexpr auto min = std::min(1, 2);
+ constexpr auto max = std::max(1, 2);
#endif
}
@@ -56,6 +58,8 @@ __host__ __device__ void cpp14_tests_hd() {
assert(std::minmax(1, 0).second == 1);
assert(std::minmax({0, 10, -10, 100}, std::less<int>()).first == -10);
assert(std::minmax({0, 10, -10, 100}, std::less<int>()).second == 100);
+ constexpr auto min = std::min(1, 2);
+ constexpr auto max = std::max(1, 2);
#endif
}