From 3e519524c118651123eecf60c2bbc5d65ad9bac3 Mon Sep 17 00:00:00 2001 From: Howard Hinnant Date: Tue, 11 May 2010 19:42:16 +0000 Subject: libcxx initial import llvm-svn: 103490 --- .../support.runtime/csetjmp.pass.cpp | 24 ++++++ .../support.runtime/csignal.pass.cpp | 57 ++++++++++++++ .../support.runtime/cstdarg.pass.cpp | 33 +++++++++ .../support.runtime/cstdbool.pass.cpp | 32 ++++++++ .../support.runtime/cstdlib.pass.cpp | 86 ++++++++++++++++++++++ .../support.runtime/ctime.pass.cpp | 40 ++++++++++ .../support.runtime/version_csetjmp.pass.cpp | 20 +++++ .../support.runtime/version_csignal.pass.cpp | 20 +++++ .../support.runtime/version_cstdarg.pass.cpp | 20 +++++ .../support.runtime/version_cstdbool.pass.cpp | 20 +++++ .../support.runtime/version_cstdlib.pass.cpp | 20 +++++ .../support.runtime/version_ctime.pass.cpp | 20 +++++ 12 files changed, 392 insertions(+) create mode 100644 libcxx/test/language.support/support.runtime/csetjmp.pass.cpp create mode 100644 libcxx/test/language.support/support.runtime/csignal.pass.cpp create mode 100644 libcxx/test/language.support/support.runtime/cstdarg.pass.cpp create mode 100644 libcxx/test/language.support/support.runtime/cstdbool.pass.cpp create mode 100644 libcxx/test/language.support/support.runtime/cstdlib.pass.cpp create mode 100644 libcxx/test/language.support/support.runtime/ctime.pass.cpp create mode 100644 libcxx/test/language.support/support.runtime/version_csetjmp.pass.cpp create mode 100644 libcxx/test/language.support/support.runtime/version_csignal.pass.cpp create mode 100644 libcxx/test/language.support/support.runtime/version_cstdarg.pass.cpp create mode 100644 libcxx/test/language.support/support.runtime/version_cstdbool.pass.cpp create mode 100644 libcxx/test/language.support/support.runtime/version_cstdlib.pass.cpp create mode 100644 libcxx/test/language.support/support.runtime/version_ctime.pass.cpp (limited to 'libcxx/test/language.support/support.runtime') diff --git a/libcxx/test/language.support/support.runtime/csetjmp.pass.cpp b/libcxx/test/language.support/support.runtime/csetjmp.pass.cpp new file mode 100644 index 00000000000..c57bab986a3 --- /dev/null +++ b/libcxx/test/language.support/support.runtime/csetjmp.pass.cpp @@ -0,0 +1,24 @@ +//===----------------------------------------------------------------------===// +// +// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// test + +#include +#include + +#ifndef setjmp +#error setjmp not defined +#endif + +int main() +{ + std::jmp_buf jb; + static_assert((std::is_same<__typeof__(std::longjmp(jb, 0)), void>::value), + "std::is_same<__typeof__(std::longjmp(jb, 0)), void>::value"); +} diff --git a/libcxx/test/language.support/support.runtime/csignal.pass.cpp b/libcxx/test/language.support/support.runtime/csignal.pass.cpp new file mode 100644 index 00000000000..0dcabb0e53e --- /dev/null +++ b/libcxx/test/language.support/support.runtime/csignal.pass.cpp @@ -0,0 +1,57 @@ +//===----------------------------------------------------------------------===// +// +// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// test + +#include +#include + +#ifndef SIG_DFL +#error SIG_DFL not defined +#endif + +#ifndef SIG_ERR +#error SIG_ERR not defined +#endif + +#ifndef SIG_IGN +#error SIG_IGN not defined +#endif + +#ifndef SIGABRT +#error SIGABRT not defined +#endif + +#ifndef SIGFPE +#error SIGFPE not defined +#endif + +#ifndef SIGILL +#error SIGILL not defined +#endif + +#ifndef SIGINT +#error SIGINT not defined +#endif + +#ifndef SIGSEGV +#error SIGSEGV not defined +#endif + +#ifndef SIGTERM +#error SIGTERM not defined +#endif + +int main() +{ + std::sig_atomic_t sig; + typedef void (*func)(int); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); +} diff --git a/libcxx/test/language.support/support.runtime/cstdarg.pass.cpp b/libcxx/test/language.support/support.runtime/cstdarg.pass.cpp new file mode 100644 index 00000000000..f25bdb6a82d --- /dev/null +++ b/libcxx/test/language.support/support.runtime/cstdarg.pass.cpp @@ -0,0 +1,33 @@ +//===----------------------------------------------------------------------===// +// +// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// test + +#include + +#ifndef va_arg +#error va_arg not defined +#endif + +#ifndef va_copy +#error va_copy not defined +#endif + +#ifndef va_end +#error va_end not defined +#endif + +#ifndef va_start +#error va_start not defined +#endif + +int main() +{ + std::va_list va; +} diff --git a/libcxx/test/language.support/support.runtime/cstdbool.pass.cpp b/libcxx/test/language.support/support.runtime/cstdbool.pass.cpp new file mode 100644 index 00000000000..7d4dcd25a71 --- /dev/null +++ b/libcxx/test/language.support/support.runtime/cstdbool.pass.cpp @@ -0,0 +1,32 @@ +//===----------------------------------------------------------------------===// +// +// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// test + +#include + +#ifndef __bool_true_false_are_defined +#error __bool_true_false_are_defined not defined +#endif + +#ifdef bool +#error bool should not be defined +#endif + +#ifdef true +#error true should not be defined +#endif + +#ifdef false +#error false should not be defined +#endif + +int main() +{ +} diff --git a/libcxx/test/language.support/support.runtime/cstdlib.pass.cpp b/libcxx/test/language.support/support.runtime/cstdlib.pass.cpp new file mode 100644 index 00000000000..3e42f8c8fc9 --- /dev/null +++ b/libcxx/test/language.support/support.runtime/cstdlib.pass.cpp @@ -0,0 +1,86 @@ +//===----------------------------------------------------------------------===// +// +// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// test + +#include +#include + +#ifndef EXIT_FAILURE +#error EXIT_FAILURE not defined +#endif + +#ifndef EXIT_SUCCESS +#error EXIT_SUCCESS not defined +#endif + +#ifndef MB_CUR_MAX +#error MB_CUR_MAX not defined +#endif + +#ifndef NULL +#error NULL not defined +#endif + +#ifndef RAND_MAX +#error RAND_MAX not defined +#endif + +int main() +{ + std::size_t s = 0; + std::div_t d; + std::ldiv_t ld; + std::lldiv_t lld; + char** endptr = 0; + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + wchar_t* pw = 0; + const wchar_t* pwc = 0; + char* pc = 0; + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); +} diff --git a/libcxx/test/language.support/support.runtime/ctime.pass.cpp b/libcxx/test/language.support/support.runtime/ctime.pass.cpp new file mode 100644 index 00000000000..4b205762ecc --- /dev/null +++ b/libcxx/test/language.support/support.runtime/ctime.pass.cpp @@ -0,0 +1,40 @@ +//===----------------------------------------------------------------------===// +// +// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// test + +#include +#include + +#ifndef NULL +#error NULL not defined +#endif + +#ifndef CLOCKS_PER_SEC +#error CLOCKS_PER_SEC not defined +#endif + +int main() +{ + std::clock_t c = 0; + std::size_t s = 0; + std::time_t t = 0; + std::tm tm = {0}; + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + char* c1 = 0; + const char* c2 = 0; + static_assert((std::is_same::value), ""); +} diff --git a/libcxx/test/language.support/support.runtime/version_csetjmp.pass.cpp b/libcxx/test/language.support/support.runtime/version_csetjmp.pass.cpp new file mode 100644 index 00000000000..6607f7d5bac --- /dev/null +++ b/libcxx/test/language.support/support.runtime/version_csetjmp.pass.cpp @@ -0,0 +1,20 @@ +//===----------------------------------------------------------------------===// +// +// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// + +#include + +#ifndef _LIBCPP_VERSION +#error _LIBCPP_VERSION not defined +#endif + +int main() +{ +} diff --git a/libcxx/test/language.support/support.runtime/version_csignal.pass.cpp b/libcxx/test/language.support/support.runtime/version_csignal.pass.cpp new file mode 100644 index 00000000000..5d4a38eb9bd --- /dev/null +++ b/libcxx/test/language.support/support.runtime/version_csignal.pass.cpp @@ -0,0 +1,20 @@ +//===----------------------------------------------------------------------===// +// +// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// + +#include + +#ifndef _LIBCPP_VERSION +#error _LIBCPP_VERSION not defined +#endif + +int main() +{ +} diff --git a/libcxx/test/language.support/support.runtime/version_cstdarg.pass.cpp b/libcxx/test/language.support/support.runtime/version_cstdarg.pass.cpp new file mode 100644 index 00000000000..16e2e9e099e --- /dev/null +++ b/libcxx/test/language.support/support.runtime/version_cstdarg.pass.cpp @@ -0,0 +1,20 @@ +//===----------------------------------------------------------------------===// +// +// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// + +#include + +#ifndef _LIBCPP_VERSION +#error _LIBCPP_VERSION not defined +#endif + +int main() +{ +} diff --git a/libcxx/test/language.support/support.runtime/version_cstdbool.pass.cpp b/libcxx/test/language.support/support.runtime/version_cstdbool.pass.cpp new file mode 100644 index 00000000000..2eab23b4436 --- /dev/null +++ b/libcxx/test/language.support/support.runtime/version_cstdbool.pass.cpp @@ -0,0 +1,20 @@ +//===----------------------------------------------------------------------===// +// +// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// + +#include + +#ifndef _LIBCPP_VERSION +#error _LIBCPP_VERSION not defined +#endif + +int main() +{ +} diff --git a/libcxx/test/language.support/support.runtime/version_cstdlib.pass.cpp b/libcxx/test/language.support/support.runtime/version_cstdlib.pass.cpp new file mode 100644 index 00000000000..7de716942fc --- /dev/null +++ b/libcxx/test/language.support/support.runtime/version_cstdlib.pass.cpp @@ -0,0 +1,20 @@ +//===----------------------------------------------------------------------===// +// +// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// + +#include + +#ifndef _LIBCPP_VERSION +#error _LIBCPP_VERSION not defined +#endif + +int main() +{ +} diff --git a/libcxx/test/language.support/support.runtime/version_ctime.pass.cpp b/libcxx/test/language.support/support.runtime/version_ctime.pass.cpp new file mode 100644 index 00000000000..659d85e8be3 --- /dev/null +++ b/libcxx/test/language.support/support.runtime/version_ctime.pass.cpp @@ -0,0 +1,20 @@ +//===----------------------------------------------------------------------===// +// +// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// + +#include + +#ifndef _LIBCPP_VERSION +#error _LIBCPP_VERSION not defined +#endif + +int main() +{ +} -- cgit v1.2.3