[PATCH] D48152: [CUDA] Add tests that, in C++14 mode, min/max are constexpr.

Justin Lebar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 13 14:30:49 PDT 2018


jlebar created this revision.
jlebar added reviewers: rsmith, tra.
Herald added a subscriber: llvm-commits.

Repository:
  rT test-suite

https://reviews.llvm.org/D48152

Files:
  External/CUDA/algorithm.cu


Index: External/CUDA/algorithm.cu
===================================================================
--- External/CUDA/algorithm.cu
+++ External/CUDA/algorithm.cu
@@ -42,6 +42,8 @@
   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 @@
   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
 }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D48152.151249.patch
Type: text/x-patch
Size: 768 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180613/8d426b6f/attachment.bin>


More information about the llvm-commits mailing list