diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2015-09-06 18:46:46 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2015-09-06 18:46:46 +0000 |
commit | 61b9a7258a7693d7f3674a5a1daf7b036ff1d382 (patch) | |
tree | ec41ed70ffca97240e76f9a78bb2dedba28f310c /test/std/language.support/support.runtime | |
parent | f857581820d15e410e9945d2fcd5f7163be25a96 (diff) |
Notes
Diffstat (limited to 'test/std/language.support/support.runtime')
12 files changed, 398 insertions, 0 deletions
diff --git a/test/std/language.support/support.runtime/csetjmp.pass.cpp b/test/std/language.support/support.runtime/csetjmp.pass.cpp new file mode 100644 index 0000000000000..dc034ce099e2e --- /dev/null +++ b/test/std/language.support/support.runtime/csetjmp.pass.cpp @@ -0,0 +1,24 @@ +//===----------------------------------------------------------------------===// +// +// 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 <csetjmp> + +#include <csetjmp> +#include <type_traits> + +#ifndef setjmp +#error setjmp not defined +#endif + +int main() +{ + std::jmp_buf jb; + static_assert((std::is_same<decltype(std::longjmp(jb, 0)), void>::value), + "std::is_same<decltype(std::longjmp(jb, 0)), void>::value"); +} diff --git a/test/std/language.support/support.runtime/csignal.pass.cpp b/test/std/language.support/support.runtime/csignal.pass.cpp new file mode 100644 index 0000000000000..717347df7f005 --- /dev/null +++ b/test/std/language.support/support.runtime/csignal.pass.cpp @@ -0,0 +1,57 @@ +//===----------------------------------------------------------------------===// +// +// 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 <csignal> + +#include <csignal> +#include <type_traits> + +#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<decltype(std::signal(0, (func)0)), func>::value), ""); + static_assert((std::is_same<decltype(std::raise(0)), int>::value), ""); +} diff --git a/test/std/language.support/support.runtime/cstdarg.pass.cpp b/test/std/language.support/support.runtime/cstdarg.pass.cpp new file mode 100644 index 0000000000000..059ad2f4ff91e --- /dev/null +++ b/test/std/language.support/support.runtime/cstdarg.pass.cpp @@ -0,0 +1,35 @@ +//===----------------------------------------------------------------------===// +// +// 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 <cstdarg> + +#include <cstdarg> + +#ifndef va_arg +#error va_arg not defined +#endif + +#if __cplusplus >= 201103L +# ifndef va_copy +# error va_copy is not defined when c++ >= 11 +# endif +#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/test/std/language.support/support.runtime/cstdbool.pass.cpp b/test/std/language.support/support.runtime/cstdbool.pass.cpp new file mode 100644 index 0000000000000..f52c1556feb01 --- /dev/null +++ b/test/std/language.support/support.runtime/cstdbool.pass.cpp @@ -0,0 +1,32 @@ +//===----------------------------------------------------------------------===// +// +// 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 <cstdbool> + +#include <cstdbool> + +#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/test/std/language.support/support.runtime/cstdlib.pass.cpp b/test/std/language.support/support.runtime/cstdlib.pass.cpp new file mode 100644 index 0000000000000..073949122b010 --- /dev/null +++ b/test/std/language.support/support.runtime/cstdlib.pass.cpp @@ -0,0 +1,88 @@ +//===----------------------------------------------------------------------===// +// +// 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 <cstdlib> + +#include <cstdlib> +#include <type_traits> + +#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<decltype(std::atof("")), double>::value), ""); + static_assert((std::is_same<decltype(std::atoi("")), int>::value), ""); + static_assert((std::is_same<decltype(std::atol("")), long>::value), ""); + static_assert((std::is_same<decltype(std::atoll("")), long long>::value), ""); + static_assert((std::is_same<decltype(std::getenv("")), char*>::value), ""); + static_assert((std::is_same<decltype(std::strtod("", endptr)), double>::value), ""); + static_assert((std::is_same<decltype(std::strtof("", endptr)), float>::value), ""); + static_assert((std::is_same<decltype(std::strtold("", endptr)), long double>::value), ""); + static_assert((std::is_same<decltype(std::strtol("", endptr,0)), long>::value), ""); + static_assert((std::is_same<decltype(std::strtoll("", endptr,0)), long long>::value), ""); + static_assert((std::is_same<decltype(std::strtoul("", endptr,0)), unsigned long>::value), ""); + static_assert((std::is_same<decltype(std::strtoull("", endptr,0)), unsigned long long>::value), ""); + static_assert((std::is_same<decltype(std::rand()), int>::value), ""); + static_assert((std::is_same<decltype(std::srand(0)), void>::value), ""); + static_assert((std::is_same<decltype(std::calloc(0,0)), void*>::value), ""); + static_assert((std::is_same<decltype(std::free(0)), void>::value), ""); + static_assert((std::is_same<decltype(std::malloc(0)), void*>::value), ""); + static_assert((std::is_same<decltype(std::realloc(0,0)), void*>::value), ""); + static_assert((std::is_same<decltype(std::abort()), void>::value), ""); + static_assert((std::is_same<decltype(std::atexit(0)), int>::value), ""); + static_assert((std::is_same<decltype(std::exit(0)), void>::value), ""); + static_assert((std::is_same<decltype(std::_Exit(0)), void>::value), ""); + static_assert((std::is_same<decltype(std::getenv("")), char*>::value), ""); + static_assert((std::is_same<decltype(std::system("")), int>::value), ""); + static_assert((std::is_same<decltype(std::bsearch(0,0,0,0,0)), void*>::value), ""); + static_assert((std::is_same<decltype(std::qsort(0,0,0,0)), void>::value), ""); + static_assert((std::is_same<decltype(std::abs(0)), int>::value), ""); + static_assert((std::is_same<decltype(std::abs((long)0)), long>::value), ""); + static_assert((std::is_same<decltype(std::abs((long long)0)), long long>::value), ""); + static_assert((std::is_same<decltype(std::labs((long)0)), long>::value), ""); + static_assert((std::is_same<decltype(std::llabs((long long)0)), long long>::value), ""); + static_assert((std::is_same<decltype(std::div(0,0)), std::div_t>::value), ""); + static_assert((std::is_same<decltype(std::div(0L,0L)), std::ldiv_t>::value), ""); + static_assert((std::is_same<decltype(std::div(0LL,0LL)), std::lldiv_t>::value), ""); + static_assert((std::is_same<decltype(std::ldiv(0L,0L)), std::ldiv_t>::value), ""); + static_assert((std::is_same<decltype(std::lldiv(0LL,0LL)), std::lldiv_t>::value), ""); + wchar_t* pw = 0; + const wchar_t* pwc = 0; + char* pc = 0; +#ifndef _LIBCPP_HAS_NO_THREAD_UNSAFE_C_FUNCTIONS + static_assert((std::is_same<decltype(std::mblen("",0)), int>::value), ""); + static_assert((std::is_same<decltype(std::mbtowc(pw,"",0)), int>::value), ""); + static_assert((std::is_same<decltype(std::wctomb(pc,L' ')), int>::value), ""); +#endif + static_assert((std::is_same<decltype(std::mbstowcs(pw,"",0)), std::size_t>::value), ""); + static_assert((std::is_same<decltype(std::wcstombs(pc,pwc,0)), std::size_t>::value), ""); +} diff --git a/test/std/language.support/support.runtime/ctime.pass.cpp b/test/std/language.support/support.runtime/ctime.pass.cpp new file mode 100644 index 0000000000000..8c5d2811d8a9e --- /dev/null +++ b/test/std/language.support/support.runtime/ctime.pass.cpp @@ -0,0 +1,42 @@ +//===----------------------------------------------------------------------===// +// +// 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 <ctime> + +#include <ctime> +#include <type_traits> + +#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<decltype(std::clock()), std::clock_t>::value), ""); + static_assert((std::is_same<decltype(std::difftime(t,t)), double>::value), ""); + static_assert((std::is_same<decltype(std::mktime(&tm)), std::time_t>::value), ""); + static_assert((std::is_same<decltype(std::time(&t)), std::time_t>::value), ""); +#ifndef _LIBCPP_HAS_NO_THREAD_UNSAFE_C_FUNCTIONS + static_assert((std::is_same<decltype(std::asctime(&tm)), char*>::value), ""); + static_assert((std::is_same<decltype(std::ctime(&t)), char*>::value), ""); + static_assert((std::is_same<decltype(std::gmtime(&t)), std::tm*>::value), ""); + static_assert((std::is_same<decltype(std::localtime(&t)), std::tm*>::value), ""); +#endif + char* c1 = 0; + const char* c2 = 0; + static_assert((std::is_same<decltype(std::strftime(c1,s,c2,&tm)), std::size_t>::value), ""); +} diff --git a/test/std/language.support/support.runtime/version_csetjmp.pass.cpp b/test/std/language.support/support.runtime/version_csetjmp.pass.cpp new file mode 100644 index 0000000000000..7e37716d01459 --- /dev/null +++ b/test/std/language.support/support.runtime/version_csetjmp.pass.cpp @@ -0,0 +1,20 @@ +//===----------------------------------------------------------------------===// +// +// 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. +// +//===----------------------------------------------------------------------===// + +// <csetjmp> + +#include <csetjmp> + +#ifndef _LIBCPP_VERSION +#error _LIBCPP_VERSION not defined +#endif + +int main() +{ +} diff --git a/test/std/language.support/support.runtime/version_csignal.pass.cpp b/test/std/language.support/support.runtime/version_csignal.pass.cpp new file mode 100644 index 0000000000000..be1045f1eb3b1 --- /dev/null +++ b/test/std/language.support/support.runtime/version_csignal.pass.cpp @@ -0,0 +1,20 @@ +//===----------------------------------------------------------------------===// +// +// 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. +// +//===----------------------------------------------------------------------===// + +// <csignal> + +#include <csignal> + +#ifndef _LIBCPP_VERSION +#error _LIBCPP_VERSION not defined +#endif + +int main() +{ +} diff --git a/test/std/language.support/support.runtime/version_cstdarg.pass.cpp b/test/std/language.support/support.runtime/version_cstdarg.pass.cpp new file mode 100644 index 0000000000000..f3ca9389b15d2 --- /dev/null +++ b/test/std/language.support/support.runtime/version_cstdarg.pass.cpp @@ -0,0 +1,20 @@ +//===----------------------------------------------------------------------===// +// +// 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. +// +//===----------------------------------------------------------------------===// + +// <cstdarg> + +#include <cstdarg> + +#ifndef _LIBCPP_VERSION +#error _LIBCPP_VERSION not defined +#endif + +int main() +{ +} diff --git a/test/std/language.support/support.runtime/version_cstdbool.pass.cpp b/test/std/language.support/support.runtime/version_cstdbool.pass.cpp new file mode 100644 index 0000000000000..0415227e58ead --- /dev/null +++ b/test/std/language.support/support.runtime/version_cstdbool.pass.cpp @@ -0,0 +1,20 @@ +//===----------------------------------------------------------------------===// +// +// 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. +// +//===----------------------------------------------------------------------===// + +// <cstdbool> + +#include <cstdbool> + +#ifndef _LIBCPP_VERSION +#error _LIBCPP_VERSION not defined +#endif + +int main() +{ +} diff --git a/test/std/language.support/support.runtime/version_cstdlib.pass.cpp b/test/std/language.support/support.runtime/version_cstdlib.pass.cpp new file mode 100644 index 0000000000000..db419524f5783 --- /dev/null +++ b/test/std/language.support/support.runtime/version_cstdlib.pass.cpp @@ -0,0 +1,20 @@ +//===----------------------------------------------------------------------===// +// +// 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. +// +//===----------------------------------------------------------------------===// + +// <cstdlib> + +#include <cstdlib> + +#ifndef _LIBCPP_VERSION +#error _LIBCPP_VERSION not defined +#endif + +int main() +{ +} diff --git a/test/std/language.support/support.runtime/version_ctime.pass.cpp b/test/std/language.support/support.runtime/version_ctime.pass.cpp new file mode 100644 index 0000000000000..ce0bf2cf1853c --- /dev/null +++ b/test/std/language.support/support.runtime/version_ctime.pass.cpp @@ -0,0 +1,20 @@ +//===----------------------------------------------------------------------===// +// +// 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. +// +//===----------------------------------------------------------------------===// + +// <ctime> + +#include <ctime> + +#ifndef _LIBCPP_VERSION +#error _LIBCPP_VERSION not defined +#endif + +int main() +{ +} |