Vendor import of libc++ release_60 branch r325330:

https://llvm.org/svn/llvm-project/libcxx/branches/release_60@325330
This commit is contained in:
Dimitry Andric 2018-02-16 19:10:44 +00:00
parent 40e3ad2a19
commit 6100a9db7d
3 changed files with 14 additions and 8 deletions

View file

@ -135,6 +135,9 @@ if (LIBCXX_CXX_ABI STREQUAL "default")
elseif (APPLE)
set(LIBCXX_CXX_ABI_LIBNAME "libcxxabi")
set(LIBCXX_CXX_ABI_SYSTEM 1)
elseif (${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
set(LIBCXX_CXX_ABI_LIBNAME "libcxxrt")
set(LIBCXX_CXX_ABI_INCLUDE_PATHS "/usr/include/c++/v1")
else()
set(LIBCXX_CXX_ABI_LIBNAME "default")
endif()

View file

@ -32,12 +32,13 @@ int main()
#ifndef TEST_HAS_NO_EXCEPTIONS
try {
#endif
std::string str(2147483648, 'a');
SB sb;
sb.str(str);
assert(sb.pubpbase() <= sb.pubpptr());
std::string str(2147483648, 'a');
SB sb;
sb.str(str);
assert(sb.pubpbase() <= sb.pubpptr());
#ifndef TEST_HAS_NO_EXCEPTIONS
}
catch (const std::bad_alloc &) {}
}
catch (const std::length_error &) {} // maybe the string can't take 2GB
catch (const std::bad_alloc &) {} // maybe we don't have enough RAM
#endif
}

View file

@ -55,7 +55,8 @@ class NotEmpty
virtual ~NotEmpty();
};
union Union {};
union EmptyUnion {};
struct NonEmptyUnion {int x; unsigned y;};
struct bit_zero
{
@ -84,6 +85,7 @@ int main()
{
test_has_not_has_unique_object_representations<void>();
test_has_not_has_unique_object_representations<Empty>();
test_has_not_has_unique_object_representations<EmptyUnion>();
test_has_not_has_unique_object_representations<NotEmpty>();
test_has_not_has_unique_object_representations<bit_zero>();
test_has_not_has_unique_object_representations<Abstract>();
@ -97,7 +99,7 @@ int main()
test_has_unique_object_representations<unsigned>();
test_has_unique_object_representations<Union>();
test_has_unique_object_representations<NonEmptyUnion>();
test_has_unique_object_representations<char[3]>();
test_has_unique_object_representations<char[]>();