libcxx initial import

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@103490 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Howard Hinnant
2010-05-11 19:42:16 +00:00
commit bc8d3f97eb
3893 changed files with 1209942 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
//===----------------------------------------------------------------------===//
//
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
// test bad_cast
#include <typeinfo>
#include <type_traits>
#include <cassert>
int main()
{
static_assert((std::is_base_of<std::exception, std::bad_cast>::value),
"std::is_base_of<std::exception, std::bad_cast>::value");
static_assert(std::is_polymorphic<std::bad_cast>::value,
"std::is_polymorphic<std::bad_cast>::value");
std::bad_cast b;
std::bad_cast b2 = b;
b2 = b;
const char* w = b2.what();
assert(w);
}

View File

@@ -0,0 +1,27 @@
//===----------------------------------------------------------------------===//
//
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
// test bad_typeid
#include <typeinfo>
#include <type_traits>
#include <cassert>
int main()
{
static_assert((std::is_base_of<std::exception, std::bad_typeid>::value),
"std::is_base_of<std::exception, std::bad_typeid>::value");
static_assert(std::is_polymorphic<std::bad_typeid>::value,
"std::is_polymorphic<std::bad_typeid>::value");
std::bad_typeid b;
std::bad_typeid b2 = b;
b2 = b;
const char* w = b2.what();
assert(w);
}

View File

@@ -0,0 +1,26 @@
//===----------------------------------------------------------------------===//
//
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
// test type_info
#include <typeinfo>
#include <cstring>
#include <cassert>
int main()
{
const std::type_info& t1 = typeid(int);
const std::type_info& t2 = typeid(int);
assert(t1 == t2);
const std::type_info& t3 = typeid(short);
assert(t1 != t3);
assert(!t1.before(t2));
assert(strcmp(t1.name(), t2.name()) == 0);
assert(strcmp(t1.name(), t3.name()) != 0);
}

View File

@@ -0,0 +1,23 @@
//===----------------------------------------------------------------------===//
//
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
// test type_info
#include <typeinfo>
#include <cstring>
#include <cassert>
int main()
{
const std::type_info& t1 = typeid(int);
const std::type_info& t2 = typeid(int);
const std::type_info& t3 = typeid(short);
assert(t1.hash_code() == t2.hash_code());
assert(t1.hash_code() != t3.hash_code());
}

View File

@@ -0,0 +1,20 @@
//===----------------------------------------------------------------------===//
//
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
// <typeinfo>
#include <typeinfo>
#ifndef _LIBCPP_VERSION
#error _LIBCPP_VERSION not defined
#endif
int main()
{
}