summaryrefslogtreecommitdiffstats
path: root/libcxx/test/std/depr/depr.c.headers
Commit message (Collapse)AuthorAgeFilesLines
* Fix _LIBCPP_HAS_ definitions for Android.Dan Albert2019-11-181-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Android added quick_exit()/at_quick_exit() in API level 21, aligned_alloc() in API level 28, and timespec_get() in API level 29, but has the other C11 features at all API levels (since they're basically just coming from clang directly). _LIBCPP_HAS_QUICK_EXIT and _LIBCPP_HAS_TIMESPEC_GET already existed, so we can reuse them. (And use _LIBCPP_HAS_TIMESPEC_GET in a few more places where _LIBCPP_HAS_C11_FEATURES has been used as a proxy. This isn't correct for Android.) _LIBCPP_HAS_ALIGNED_ALLOC is added, to cover aligned_alloc() (obviously). Add a missing std:: before aligned_alloc in a cstdlib test, and remove a couple of !defined(_WIN32)s now that we're explicitly testing TEST_HAS_ALIGNED_ALLOC rather than TEST_HAS_C11_FEATURES. Reviewers: danalbert, EricWF, mclow.lists Reviewed By: danalbert Subscribers: srhines, christof, libcxx-commits Tags: #libc Differential Revision: https://reviews.llvm.org/D69929
* AIX system headers need stdint.h and inttypes.h to be re-enterableXing Xue2019-06-201-0/+268
| | | | | | | | | | | | | | | | | Summary: AIX system headers need stdint.h and inttypes.h to be re-enterable when macro _STD_TYPES_T is defined so that limit macro definitions such as UINT32_MAX can be found. This patch attempts to allow that on AIX. Reviewers: hubert.reinterpretcast, jasonliu, mclow.lists, EricWF Reviewed by: hubert.reinterpretcast, mclow.lists Subscribers: jfb, jsji, christof, cfe-commits, libcxx-commits, llvm-commits Tags: #LLVM, #clang, #libc++ Differential Revision: https://reviews.llvm.org/D59253 llvm-svn: 363939
* [libc++] Add missing #include in <cwchar> testsLouis Dionne2019-06-131-0/+1
| | | | | | | Thanks to Mikhail Maltsev for the patch. Differential Revision: https://reviews.llvm.org/D63289 llvm-svn: 363290
* Add include for 'test_macros.h' to all the tests that were missing them. ↵Marshall Clow2019-05-3120-0/+39
| | | | | | Thanks to Zoe for the (big, but simple) patch. NFC intended. llvm-svn: 362252
* Fix implementation of ::abs and std::abs LWG 2192.Eric Fiselier2019-04-232-6/+87
| | | | | | | | | | | | | | | | | | | Summary: All overloads of `::abs` and `std::abs` must be present in both `<cmath>` and `<cstdlib>`. This is problematic to implement because C defines `fabs` in `math.h` and `labs` in `stdlib.h`. This introduces a circular dependency between the two headers. This patch implements that requirement by moving `abs` into `math.h` and making `stdlib.h` include `math.h`. In order to get the underlying C declarations from the "real" `stdlib.h` inside our `math.h` we need some trickery. Specifically we need to make `stdlib.h` include next itself. Suggestions for a cleaner implementation are welcome. Reviewers: mclow.lists, ldionne Reviewed By: ldionne Subscribers: krytarowski, fedor.sergeev, dexonsmith, jdoerfert, jsji, libcxx-commits Differential Revision: https://reviews.llvm.org/D60097 llvm-svn: 359020
* Add fenv.h headerEric Fiselier2019-02-111-11/+11
| | | | | | | | | | | | | | | | | Summary: Some implementations of fenv.h use macros to define the functions they provide. This can cause problems when `std::fegetround()` is spelled in source. This patch adds a `fenv.h` header to libc++ for the sole purpose of turning those macros into real functions. Reviewers: rsmith, mclow.lists, ldionne Reviewed By: rsmith Subscribers: mgorny, christof, libcxx-commits Differential Revision: https://reviews.llvm.org/D57729 llvm-svn: 353767
* Support tests in freestandingJF Bastien2019-02-0426-26/+78
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Freestanding is *weird*. The standard allows it to differ in a bunch of odd manners from regular C++, and the committee would like to improve that situation. I'd like to make libc++ behave better with what freestanding should be, so that it can be a tool we use in improving the standard. To do that we need to try stuff out, both with "freestanding the language mode" and "freestanding the library subset". Let's start with the super basic: run the libc++ tests in freestanding, using clang as the compiler, and see what works. The easiest hack to do this: In utils/libcxx/test/config.py add: self.cxx.compile_flags += ['-ffreestanding'] Run the tests and they all fail. Why? Because in freestanding `main` isn't special. This "not special" property has two effects: main doesn't get mangled, and main isn't allowed to omit its `return` statement. The first means main gets mangled and the linker can't create a valid executable for us to test. The second means we spew out warnings (ew) and the compiler doesn't insert the `return` we omitted, and main just falls of the end and does whatever undefined behavior (if you're luck, ud2 leading to non-zero return code). Let's start my work with the basics. This patch changes all libc++ tests to declare `main` as `int main(int, char**` so it mangles consistently (enabling us to declare another `extern "C"` main for freestanding which calls the mangled one), and adds `return 0;` to all places where it was missing. This touches 6124 files, and I apologize. The former was done with The Magic Of Sed. The later was done with a (not quite correct but decent) clang tool: https://gist.github.com/jfbastien/793819ff360baa845483dde81170feed This works for most tests, though I did have to adjust a few places when e.g. the test runs with `-x c`, macros are used for main (such as for the filesystem tests), etc. Once this is in we can create a freestanding bot which will prevent further regressions. After that, we can start the real work of supporting C++ freestanding fairly well in libc++. <rdar://problem/47754795> Reviewers: ldionne, mclow.lists, EricWF Subscribers: christof, jkorous, dexonsmith, arphaman, miyuki, libcxx-commits Differential Revision: https://reviews.llvm.org/D57624 llvm-svn: 353086
* Update more file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-1926-104/+78
| | | | | | | | | | | | | | | | | | to reflect the new license. These used slightly different spellings that defeated my regular expressions. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351648
* Fix FP comparisons when SSE isn't availableEric Fiselier2018-12-171-15/+24
| | | | llvm-svn: 349387
* [test] [depr.c.headers] XFAIL uchar.h on NetBSDMichal Gorny2018-12-121-0/+1
| | | | llvm-svn: 348973
* [libcxx] [test] Don't detect Windows' UCRT with TEST_COMPILER_C1XXBilly Robert O'Neal III2018-10-201-3/+1
| | | | | | The test is trying to avoid saying aligned_alloc on Windows' UCRT, which does not (and can not) implement aligned_alloc. However, it's testing for c1xx, meaning clang on Windows will fail this test when using the UCRT. llvm-svn: 344829
* [libc++] Disable failing C11 feature tests for <cfloat> and <float.h>Louis Dionne2018-08-151-3/+3
| | | | | | | | | | | | | | Summary: Those tests are breaking the test bots. A Bugzilla has been filed to make sure those tests are re-enabled: https://bugs.llvm.org/show_bug.cgi?id=38572 Reviewers: mclow.lists, EricWF Subscribers: krytarowski, christof, dexonsmith, cfe-commits Differential Revision: https://reviews.llvm.org/D50748 llvm-svn: 339742
* [libc++] Add missing #include in C11 features testsLouis Dionne2018-08-141-0/+2
| | | | | | | | | | | | | | | | | | Summary: These #includes are quite important, since otherwise any #if TEST_STD_VER > 14 && defined(TEST_HAS_C11_FEATURES) checks are always false, and so we don't actually test for C11 support in the standard library. Reviewers: mclow.lists, EricWF Subscribers: christof, dexonsmith, cfe-commits Differential Revision: https://reviews.llvm.org/D50674 llvm-svn: 339675
* Final bit of P0063 - make sure that aligned_alloc is available when the ↵Marshall Clow2018-07-311-0/+10
| | | | | | underlying C library supports it llvm-svn: 338457
* Test for the presence of a bunch of new macros for c++17. These macros come ↵Marshall Clow2018-07-311-0/+42
| | | | | | from C11. Part of P0063 llvm-svn: 338454
* Implement LWG3034: P0767R1 breaks previously-standard-layout typesMarshall Clow2018-03-211-0/+2
| | | | llvm-svn: 328064
* One more test for P0767:Marshall Clow2018-03-061-0/+8
| | | | llvm-svn: 326802
* Placate unused variable warnings uncovered by improvements to clang's ↵Benjamin Kramer2017-10-142-0/+2
| | | | | | -Wunused-variable llvm-svn: 315809
* XFAIL tests on SLES11Brian Cain2017-09-081-0/+1
| | | | | | | XFAIL some failing tests for SLES11 (older glibc), also replace spaces in linux distro w/dashes. llvm-svn: 312774
* Fix libc++ test to pass in C++03 modeMehdi Amini2017-03-031-1/+1
| | | | | | Was hitting: "error: scalar initializer cannot be empty" llvm-svn: 296889
* test: silence warnings on clang under clang-clSaleem Abdulrasool2017-02-181-1/+1
| | | | | | | When running under clang-cl mode, we do not define `__GNUC__`, resulting in the test failing. llvm-svn: 295560
* Remove mblen(), mbtowc() and wctomb() from the thread-unsafe functions.Ed Schouten2016-12-301-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Back in r240527 I added a knob to prevent thread-unsafe functions from being exposed. mblen(), mbtowc() and wctomb() were also added to this list, as the latest issue of POSIX doesn't require these functions to be thread-safe. It turns out that the only circumstance in which these functions are not thread-safe is in case they are used in combination with state-dependent character sets (e.g., Shift-JIS). According to Austin Group Bug 708, these character sets "[...] are mostly a relic of the past and which were never supported on most POSIX systems". Though in many cases the use of these functions can be prevented by using the reentrant counterparts, they are the only functions that allow you to query whether the locale's character set is state-dependent. This means that omitting these functions removes actual functionality. Let's be a bit less pedantic and drop the guards around these functions. Links: http://austingroupbugs.net/view.php?id=708 http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2037.htm Reviewed by: ericwf Differential Revision: https://reviews.llvm.org/D21436 llvm-svn: 290748
* [libcxx] [test] D26314: Fix MSVC warning C4189 "local variable is ↵Stephan T. Lavavej2016-11-141-42/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | initialized but not referenced". test/std/depr/depr.c.headers/inttypes_h.pass.cpp test/std/input.output/file.streams/c.files/cinttypes.pass.cpp test/std/input.output/iostream.forward/iosfwd.pass.cpp Add test() to avoid a bunch of void-casts, although we still need a few. test/std/input.output/iostream.format/quoted.manip/quoted.pass.cpp skippingws was unused (it's unclear to me whether this was mistakenly copy-pasted from round_trip() below). test/std/localization/locale.categories/category.collate/locale.collate/types.pass.cpp test/std/localization/locale.categories/category.ctype/facet.ctype.special/types.pass.cpp test/std/localization/locale.categories/category.ctype/locale.codecvt/types_char.pass.cpp test/std/localization/locale.categories/category.ctype/locale.codecvt/types_wchar_t.pass.cpp test/std/localization/locale.categories/category.ctype/locale.ctype/types.pass.cpp test/std/localization/locale.categories/facet.numpunct/locale.numpunct/types.pass.cpp test/std/localization/locales/locale.global.templates/use_facet.pass.cpp When retrieving facets, the references are unused. test/std/localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.members/put_long.pass.cpp test/std/localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.members/put_unsigned_long.pass.cpp "std::ios_base::iostate err = ios.goodbit;" was completely unused here. test/std/localization/locale.categories/category.time/locale.time.get/time_base.pass.cpp test/std/numerics/c.math/ctgmath.pass.cpp test/std/numerics/rand/rand.device/entropy.pass.cpp test/std/numerics/rand/rand.device/eval.pass.cpp test/std/strings/basic.string/string.modifiers/string_copy/copy.pass.cpp test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char16_t/eof.pass.cpp test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char32_t/eof.pass.cpp test/std/thread/futures/futures.promise/dtor.pass.cpp test/std/thread/futures/futures.task/futures.task.members/dtor.pass.cpp test/std/thread/thread.condition/thread.condition.condvar/wait_for_pred.pass.cpp These variables are verifying types but are otherwise unused. test/std/strings/basic.string/string.capacity/reserve.pass.cpp old_cap was unused (it's unclear to me whether it was intended to be used). test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char/eq.pass.cpp test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char16_t/eq.pass.cpp test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char16_t/lt.pass.cpp test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char32_t/eq.pass.cpp test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char32_t/lt.pass.cpp test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/eq.pass.cpp test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/lt.pass.cpp These tests contained unused characters. llvm-svn: 286847
* Remove all _LIBCPP_VERSION tests from under test/stdEric Fiselier2016-10-083-12/+0
| | | | llvm-svn: 283644
* Avoid applying unary minus to unsigned integers. Patch from STL@microsoft.comEric Fiselier2016-06-301-4/+4
| | | | llvm-svn: 274203
* Replace __cplusplus comparisons and dialect __has_feature checks with ↵Eric Fiselier2016-06-141-1/+3
| | | | | | | | | TEST_STD_VER. This is a huge cleanup that helps make the libc++ test suite more portable. Patch from STL@microsoft.com. Thanks STL! llvm-svn: 272716
* Silence more unused variable warnings. Patch from STL@microsoft.comEric Fiselier2016-06-141-0/+8
| | | | llvm-svn: 272617
* Tolerate incorrect return type for 'isinf' and 'isnan' in tests.Eric Fiselier2016-05-273-63/+48
| | | | | | | | | | | | | | | | | | Summary: GLIBC recently removed the incorrect `int isinf(double)` and `int isnan(double)` overloads in C++11 and greater. This causes previously `XFAIL: linux` tests to start passing. Since there is no longer a way to 'XFAIL' the tests I choose to simply tolerate this bug. See https://sourceware.org/bugzilla/show_bug.cgi?id=19439 Reviewers: rsmith, mclow.lists, EricWF Subscribers: jroelofs, cfe-commits Differential Revision: http://reviews.llvm.org/D19835 llvm-svn: 271060
* Cleanup warnings and remove use of __builtin_va_list in depr.c.headersEric Fiselier2016-05-025-20/+9
| | | | llvm-svn: 268294
* Void cast runtime-unused variables. Patch from STL@microsoft.comEric Fiselier2016-05-022-1/+8
| | | | llvm-svn: 268284
* Move extern C include test into test/libcxxEric Fiselier2016-04-291-43/+0
| | | | llvm-svn: 267983
* Guard Clang and GCC specific pragmas. Patch from STL@microsoft.comEric Fiselier2016-04-282-0/+6
| | | | llvm-svn: 267836
* Fix overload sets of strchr, strpbrk, strrchr, memchr and strstr fromRichard Smith2016-02-102-10/+15
| | | | | | | | | | | | | | | | | <string.h> and wcschr, wcspbrk, wcsrchr, wmemchr, and wcsstr from <wchar.h> to provide a const-correct overload set even when the underlying C library does not. This change adds a new macro, _LIBCPP_PREFERRED_OVERLOAD, which (if defined) specifies that a given overload is a better match than an otherwise equally good function declaration without the overload. This is implemented in modern versions of Clang via __attribute__((enable_if)), and not elsewhere. We use this new macro to define overloads in the global namespace for these functions that displace the overloads provided by the C library, unless we believe the C library is already providing the correct signatures. llvm-svn: 260337
* Silence a -Wmissing-braces warning in the tests; mbstate_t is defined ↵Marshall Clow2015-11-251-0/+8
| | | | | | differently on different C libraries. llvm-svn: 254050
* [libcxx] Fixup a few fumbles in the initial no-exceptions XFAILs list.Asiri Rathnayake2015-11-121-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The initial buildbot run found a few missing bits in the initial XFAIL list for the no-exceptions libc++ variant. These discrepancies are as follows: [1] Following two tests need XFAILs on the no-exceptions library variant. My local runs had these two disabled for other reasons (unsupported): - localization/locales/locale/locale.cons/char_pointer.pass.cpp - numerics/complex.number/complex.ops/complex_divide_complex.pass.cpp [2] These three does not need XFAILs, they were failing on my local runs for other reasons: - depr/depr.c.headers/uchar_h.pass.cpp - input.output/iostreams.base/ios/basic.ios.members/copyfmt.pass.cpp - .../category.collate/locale.collate.byname/transform.pass.cpp (these are failing on my box for the default build as well) The current patch fixes both the cases above. Additionally, I've run the following scan to make sure I've covered all the cases: > grep ' catch \| try \| throw ' -R . | perl -pe 's|(.*?):.*|\1|' | sort | \ uniq > 1.txt > grep 'libcpp-no-exceptions' -R . | perl -pe 's|(.*?):.*|\1|' | sort | \ uniq > 2.txt > diff 1.txt 2.txt This showed up a few extra interesting cases: [3] These two tests do not use try/catch/throw statements, but they fail at runtime. Need to be investigated, I've left the XFAILs in. - std/thread/futures/futures.shared_future/dtor.pass.cpp - std/thread/futures/futures.unique_future/dtor.pass.cpp [4] These tests use a macro named TEST_HAS_NO_EXCEPTIONS to conditionally exclude try/catch/throw statements when running without exceptions. I'm not entirely sure why this was needed (AFAIK, we didn't have a no-exceptions library build before). The macro's defintion is quite similar to that of _LIBCPP_NO_EXCEPTIONS. I will investigate if this can be reused for my test fixes or if it should be replaced with _LIBCPP_NO_EXCEPTIONS. - std/experimental/any/* Change-Id: I9ad1e0edd78f305406eaa0ab148b1ab693f7e26a llvm-svn: 252870
* std:: qualify ptrdiff_t in the test. Thanks to Walter for the catchMarshall Clow2015-11-101-2/+2
| | | | llvm-svn: 252613
* Make it possible to build a no-exceptions variant of libcxx.Asiri Rathnayake2015-11-101-0/+1
| | | | | | | | | | | | Fixes a small omission in libcxx that prevents libcxx being built when -DLIBCXX_ENABLE_EXCEPTIONS=0 is specified. This patch adds XFAILS to all those tests that are currently failing on the new -fno-exceptions library variant. Follow-up patches will update the tests (progressively) to cope with the new library variant. Change-Id: I4b801bd8d8e4fe7193df9e55f39f1f393a8ba81a llvm-svn: 252598
* Fix use of libc++ <foo.h> headers from within an 'extern "C"' context in C++98.Richard Smith2015-10-131-0/+43
| | | | | | Previously, this resulted in us declaring a template for static_assert emulation within the 'extern "C"' context, which is ill-formed. llvm-svn: 250247
* Revert r249931 - Remove same_decls.pass.cpp because it fails on OS X and in ↵Eric Fiselier2015-10-101-517/+0
| | | | | | C++03 mode. llvm-svn: 249938
* Get some of wchar_h.pass.cpp working on apple.Eric Fiselier2015-10-101-10/+16
| | | | llvm-svn: 249936
* Unrevert r249889, and XFAIL the test for Darwin, where the libc apparently ↵Richard Smith2015-10-101-11/+24
| | | | | | doesn't provide a correct overload set for some functions. llvm-svn: 249932
* Add a test that we declare the right set of C library function signatures in ::Richard Smith2015-10-101-0/+517
| | | | | | and std::, and that the names in :: and std:: are declaring the same entity. llvm-svn: 249931
* Revert r249889 due to bot failure.Manman Ren2015-10-101-18/+11
| | | | llvm-svn: 249926
* Split <wchar.h> out of <cwchar>.Richard Smith2015-10-091-11/+18
| | | | llvm-svn: 249889
* Split <stdlib.h> out of <cstdlib>.Richard Smith2015-10-091-0/+24
| | | | llvm-svn: 249800
* Split <stdio.h> out of <cstdio>.Richard Smith2015-10-091-0/+20
| | | | | | As with <stddef.h>, skip our custom header if __need_FILE or __need___FILE is defined. llvm-svn: 249798
* Fix test failure in C++98 mode due to imperfect static_assert emulation.Richard Smith2015-10-081-1/+1
| | | | llvm-svn: 249780
* Split <stddef.h> out of <cstddef>.Richard Smith2015-10-081-0/+22
| | | | | | | | | | | | | | There are a bunch of macros (__need_size_t etc) that request just one piece of <stddef.h>; if any one of these is defined, we just directly include the underlying header. Note that <stddef.h> provides a ::nullptr_t. We don't want that available to includers of <cstddef>, so instead of following the usual pattern where <cfoo> includes <foo.h> then pulls things from :: into std:: with using-declarations, we implement <stddef.h> and <cstddef> separately; both include <__nullptr> for the definition of std::nullptr_t. llvm-svn: 249761
* Split <setjmp.h> out of <csetjmp>.Richard Smith2015-10-081-0/+4
| | | | llvm-svn: 249743
* Split <math.h> out of <cmath>.Richard Smith2015-10-083-22/+884
| | | | llvm-svn: 249742
OpenPOWER on IntegriCloud