llvm-project/libcxx/test
Howard Hinnant 575e4e3650 Richard Smith: It was pointed out to me off-list that libc++'s non-compiler-builtin
implementation of std::is_polymorphic does this:

template <class _Tp> struct __is_polymorphic1 : public _Tp {};

... and that g++ rejects this if _Tp has an inaccessible virtual destructor
(because __is_polymorphic1<_Tp> would have a deleted virtual destructor
overriding _Tp's non-deleted destructor). Clang was failing to reject this;
I've fixed that in r178563, but that causes libc++'s corresponding test
case to fail with both clang and gcc when using the fallback
implementation. The fallback code also incorrectly rejects final types.

The attached patch fixes the fallback implementation of is_polymorphic; we
now use dynamic_cast's detection of polymorphic class types rather than
trying to determine if adding a virtual function makes the type larger:

  enable_if<sizeof((_Tp*)dynamic_cast<const volatile
void*>(declval<_Tp*>())) != 0, ...>

Two things of note here:
* the (_Tp*) cast is necessary to work around bugs in Clang and g++ where
we otherwise don't instantiate the dynamic_cast (filed as PR15656)
* the 'const volatile' is here to treat is_polymorphic<cv T> as true for a
polymorphic class type T -- my reading of the standard suggests this is
incorrect, but it matches our builtin __is_polymorphic and gcc

llvm-svn: 178576
2013-04-02 21:25:06 +00:00
..
algorithms Move common header files into a 'support' directory; make 'testit' include -I to that directory; rename 'iterators.h' to 'iterator_test.h'; remove hard-coded paths to include files from more than 350 source files 2013-01-05 03:21:01 +00:00
atomics atomic_bool was missing (just a typedef to atomic<bool>). 2013-01-04 18:58:50 +00:00
containers Some debug test cases for list. 2013-04-02 19:53:32 +00:00
depr [tests] XFAIL a few things that require libc (?) support missing on Darwin. 2013-02-05 22:10:25 +00:00
diagnostics Fix http://llvm.org/bugs/show_bug.cgi?id=11428. Fix provided by Alberto Ganesh Barbati 2011-12-02 19:36:40 +00:00
input.output Test cleanup with respect to use of deprecated tmpnam function. Also Windows port for these tests to use _tempnam. The bulk of this patch was donated anonymously. I've tested it on OS X and accept responsibility for it. If I've broken anyone's platform by switching from tmpnam to mktemp for the generation of temporary file names, just let me know. Should be easy to fix in test/support/platform_support.h 2013-03-22 20:05:40 +00:00
iterators Move common header files into a 'support' directory; make 'testit' include -I to that directory; rename 'iterators.h' to 'iterator_test.h'; remove hard-coded paths to include files from more than 350 source files 2013-01-05 03:21:01 +00:00
language.support [tests] XFAIL a few things that require libc (?) support missing on Darwin. 2013-02-05 22:10:25 +00:00
localization Removed raw references to __APPLE__; now just check to see if it is defined. 2013-03-18 17:45:34 +00:00
numerics Marshall Clow found some divide-by-zero warnings with UBSan in rand's binomial_distribution test. This eliminates the divide-by-zeros and describes in comments the numerical difficulties the test is having. Each of the problematic tests are exploring edge cases of the distribution. 2013-03-23 19:29:45 +00:00
re This is a start at making the libc++ test suite friendlier to the -fnoexceptions flag. Although this is not a complete solution, it does reduce the number of test failures on OS X from 467 to 128 on OS X when -fno-exceptions is enabled, and does not impact the number of failures at all when -fno-exceptions is not enabled. The bulk of this code was donated anonymously. 2013-03-23 17:27:16 +00:00
strings This is a start at making the libc++ test suite friendlier to the -fnoexceptions flag. Although this is not a complete solution, it does reduce the number of test failures on OS X from 467 to 128 on OS X when -fno-exceptions is enabled, and does not impact the number of failures at all when -fno-exceptions is not enabled. The bulk of this code was donated anonymously. 2013-03-23 17:27:16 +00:00
support Test cleanup with respect to use of deprecated tmpnam function. Also Windows port for these tests to use _tempnam. The bulk of this patch was donated anonymously. I've tested it on OS X and accept responsibility for it. If I've broken anyone's platform by switching from tmpnam to mktemp for the generation of temporary file names, just let me know. Should be easy to fix in test/support/platform_support.h 2013-03-22 20:05:40 +00:00
thread Fixed race conditions in thread tests; exposed by UBSan 2013-03-26 15:28:33 +00:00
utilities Richard Smith: It was pointed out to me off-list that libc++'s non-compiler-builtin 2013-04-02 21:25:06 +00:00
CMakeLists.txt Allow libc++ to be built with CMake from within the LLVM tree. The libc++ part is just some renaming as the variable was already in use, conflicting with something else in the LLVM tree. Contributed by Ruben Van Boxem. 2012-03-19 15:40:23 +00:00
lit.cfg [tests] Add support for a link_flags lit parameter. 2013-02-12 19:28:51 +00:00
lit.site.cfg.in Add CMake build and fix major Linux blockers. 2010-12-10 19:47:54 +00:00
nothing_to_do.pass.cpp license change 2010-11-16 22:09:02 +00:00
testit Fixed race conditions in thread tests; exposed by UBSan 2013-03-26 15:28:33 +00:00