Files
android_external_libcxx/test/libcxx/version.pass.cpp
Eric Fiselier 6994470189 Add __libcpp_version file and __libcpp_library_version function.
This patch does two seperate things. First it adds a file called
"__libcpp_version" which only contains the current libc++ version
(currently 4000). This file is not intended for use as a header. This file
is used by Clang in order to easily determine the installed libc++ version.
This allows Clang to enable/disable certain language features only when the
library supports them.

The second change is the addition of _LIBCPP_LIBRARY_VERSION macro, which
returns the version of the installed dylib since it may be different than
the headers.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@285382 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-28 06:06:50 +00:00

30 lines
815 B
C++

// -*- 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 the _LIBCPP_VERSION and _LIBCPP_LIBRARY_VERSION macros
#include <__config>
#ifndef _LIBCPP_VERSION
#error _LIBCPP_VERSION must be defined
#endif
#ifndef _LIBCPP_LIBRARY_VERSION
#error _LIBCPP_LIBRARY_VERSION must be defined
#endif
#include <cassert>
int main() {
assert(_LIBCPP_VERSION == _LIBCPP_LIBRARY_VERSION);
assert(std::__libcpp_library_version);
assert(_LIBCPP_LIBRARY_VERSION == std::__libcpp_library_version());
}