[libcxx] r290445 - Add test that _LIBCPP_VERSION matches __libcpp_version

Eric Fiselier via cfe-commits cfe-commits at lists.llvm.org
Fri Dec 23 11:38:43 PST 2016


Author: ericwf
Date: Fri Dec 23 13:38:43 2016
New Revision: 290445

URL: http://llvm.org/viewvc/llvm-project?rev=290445&view=rev
Log:
Add test that _LIBCPP_VERSION matches __libcpp_version

Added:
    libcxx/trunk/test/libcxx/libcpp_version.pass.cpp

Added: libcxx/trunk/test/libcxx/libcpp_version.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/libcxx/libcpp_version.pass.cpp?rev=290445&view=auto
==============================================================================
--- libcxx/trunk/test/libcxx/libcpp_version.pass.cpp (added)
+++ libcxx/trunk/test/libcxx/libcpp_version.pass.cpp Fri Dec 23 13:38:43 2016
@@ -0,0 +1,28 @@
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// Test that the __libcpp_version file matches the value of _LIBCPP_VERSION
+
+#include <__config>
+
+#ifndef _LIBCPP_VERSION
+#error _LIBCPP_VERSION must be defined
+#endif
+
+static const int libcpp_version =
+#include <__libcpp_version>
+;
+
+static_assert(_LIBCPP_VERSION == libcpp_version,
+              "_LIBCPP_VERSION doesn't match __libcpp_version");
+
+int main() {
+
+}




More information about the cfe-commits mailing list