]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/libs/align/test/align_overflow_test.cpp
import quincy beta 17.1.0
[ceph.git] / ceph / src / boost / libs / align / test / align_overflow_test.cpp
diff --git a/ceph/src/boost/libs/align/test/align_overflow_test.cpp b/ceph/src/boost/libs/align/test/align_overflow_test.cpp
new file mode 100644 (file)
index 0000000..bb9f797
--- /dev/null
@@ -0,0 +1,25 @@
+/*
+Copyright 2020 Glen Joseph Fernandes
+(glenjofe@gmail.com)
+
+Distributed under the Boost Software License, Version 1.0.
+(http://www.boost.org/LICENSE_1_0.txt)
+*/
+#include <boost/align/align.hpp>
+#include <boost/core/lightweight_test.hpp>
+
+int main()
+{
+    static const std::size_t n = -1;
+    {
+        void* p = reinterpret_cast<void*>(5);
+        std::size_t s = 3072;
+        BOOST_TEST(!boost::alignment::align(1024, n, p, s));
+    }
+    {
+        void* p = reinterpret_cast<void*>(1);
+        std::size_t s = -1;
+        BOOST_TEST(!boost::alignment::align(2, n, p, s));
+    }
+    return boost::report_errors();
+}