summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorLouis Dionne <ldionne@apple.com>2019-09-04 13:35:03 +0000
committerDan Albert <danalbert@google.com>2019-09-13 18:07:32 -0700
commit44a8861f2c85a8f46107a541c5d610c1d3b464fe (patch)
tree9adb575b38fe3f450e91c613c86630b960b84b9b /test
parent34d1dd71fa4c096107dde636e5c723c32a20d387 (diff)
downloadlibcxx-44a8861f2c85a8f46107a541c5d610c1d3b464fe.tar.gz
[libc++] Move __clamp_to_integral to <cmath>, and harden against min()/max() macros
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@370900 91177308-0d34-0410-b5e6-96231b3b80d8 (cherry picked from commit 87e6185621d332d2ef8695b94778663380c83bb9) Bug: https://bugs.chromium.org/p/chromium/issues/detail?id=994957 Bug: http://b/139690488 Change-Id: Ice92a8ea6f675be069a70c5ad1003cf99b4fc474 (cherry picked from commit 82e0483c4a47233ed2f7bab545b32e5ddd474e59)
Diffstat (limited to 'test')
-rw-r--r--test/libcxx/numerics/c.math/undef_min_max.pass.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/libcxx/numerics/c.math/undef_min_max.pass.cpp b/test/libcxx/numerics/c.math/undef_min_max.pass.cpp
new file mode 100644
index 000000000..ba1696eb2
--- /dev/null
+++ b/test/libcxx/numerics/c.math/undef_min_max.pass.cpp
@@ -0,0 +1,19 @@
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC diagnostic ignored "-W#warnings"
+#endif
+
+#define min THIS IS A NASTY MACRO!
+#define max THIS IS A NASTY MACRO!
+
+#include <cmath>
+
+#include "test_macros.h"
+
+int main(int, char**) { return 0; }