Commit Graph

97 Commits

Author SHA1 Message Date
Howard Hinnant c1c87c15f2 __list::ends_with_template was giving the wrong answer for empty lists. And __parse_unnamed_type_name wasn't properly handling the list of paramters and was not safe against incorrectly mangled lambdas (running past last).
llvm-svn: 169022
2012-11-30 18:43:50 +00:00
Micah Villmow fb89f27a8f Move TargetData to DataLayout.
llvm-svn: 165397
2012-10-08 16:29:26 +00:00
Howard Hinnant 757640b156 Fixes apple: #12020687. This was a problem in the demangler with template
substitution forward references.  That is, sometimes a mangled name refers to
a substitution that hasn't yet been defined.  The demangler was derferencing a
null pointer in this case because it wasn't properly guarded against a
forward reference.  Test case added to catch this problem.

llvm-svn: 161267
2012-08-03 22:02:07 +00:00
Howard Hinnant b2a9cee678 Erik Olofsson: This patch adds support for lambda demangling. I fixed this because it crashed lldb when it tried to demangle the added test.
Not sure how it should identify the lambda so that might need changing from the current 'lambdax'::  Howard:  Please patch CREDITS.TXT.

llvm-svn: 161125
2012-08-01 18:56:46 +00:00
Richard Smith 4c50ea27bf Add missing #include <stdlib.h> into test which uses ::exit.
llvm-svn: 160039
2012-07-11 09:37:56 +00:00
Howard Hinnant ba2e8aeda5 Fix bug in cxa_demangle involving template substitution.
llvm-svn: 155994
2012-05-02 15:38:11 +00:00
Howard Hinnant 31dea02601 corrected namespace in test
llvm-svn: 149635
2012-02-02 22:00:52 +00:00
Marshall Clow a27b0cd8ee added const nullptr tests
llvm-svn: 149552
2012-02-01 22:27:24 +00:00
Marshall Clow e71ddf2fcb removed duplicated tests - Howard was quicker than me.
llvm-svn: 149545
2012-02-01 21:49:28 +00:00
Marshall Clow 62e0f4abf6 Added tests for catching const/non-const nullptr
llvm-svn: 149542
2012-02-01 21:37:24 +00:00
Howard Hinnant 60eaa49036 Add test for pointer qualification conversion.
llvm-svn: 149541
2012-02-01 21:25:40 +00:00
Howard Hinnant c325fa7705 Add some tests to test catching nullptr with pointers and member pointers. Tests are only activated if #if __has_feature(cxx_nullptr).
llvm-svn: 149536
2012-02-01 21:01:52 +00:00
Howard Hinnant 2d6810fbd6 Quash a TODO related to catching pointer-to-member. These tests fail on my copy of gcc-4.2. But I believe the tests to be correct (and they pass for libc++abi). I've enquired on the C++ standards mailing list for a clarification in case I'm wrong. So far I've gotten one response that agrees with me.
llvm-svn: 149534
2012-02-01 20:53:21 +00:00
Howard Hinnant a21f8c2acf Quash TODO regarding catch by function type. Add tests to back it up.
llvm-svn: 149530
2012-02-01 19:42:45 +00:00
Howard Hinnant 26ffb64177 Quash TODO regarding catch by array type. Add tests to back it up.
llvm-svn: 149527
2012-02-01 19:21:28 +00:00
Howard Hinnant 3b22c6c395 Here's a test for catching pointers.
llvm-svn: 149459
2012-02-01 00:22:38 +00:00
Howard Hinnant 372e2f4bd4 More test cases concentrating on catching class types.
llvm-svn: 149453
2012-01-31 23:52:20 +00:00
Howard Hinnant eedecf51bb Some unwinding test cases
llvm-svn: 149436
2012-01-31 21:58:58 +00:00
Howard Hinnant 3d97931a86 Drop the stress a notch on dynamic_cast_stress.cpp. Otherwise it occasionally causes clang to crash. Put a noexcept(false) on a throwing destructor in test_vector1.cpp. The test now passes for both C++03 and C++11 modes. Add testit script. All tests are now PASSING :-)
llvm-svn: 149413
2012-01-31 20:10:33 +00:00
Howard Hinnant f8d292eb08 Correct test bug.
llvm-svn: 149412
2012-01-31 20:01:06 +00:00
Howard Hinnant 805036cc83 Minor header fixups for test.
llvm-svn: 149156
2012-01-28 00:30:38 +00:00
Howard Hinnant 44e3703639 Silence a warning.
llvm-svn: 149155
2012-01-28 00:29:27 +00:00
Howard Hinnant 73ab1864ef Marshall Clow reminded me that fallback_malloc.cpp was broken out for testing purposes. We've agreed to simply rename fallback_malloc.cpp to fallback_malloc.ipp. Thanks Marshall.
llvm-svn: 148863
2012-01-24 21:41:27 +00:00
Howard Hinnant 242566e552 Change header to generic, instead of implementation specific
llvm-svn: 148646
2012-01-22 01:19:20 +00:00
Howard Hinnant b24c9441d1 One more small optimization: Where possible, for loops that do a search and then try to break out of the loop early, eliminate the attempt to break out of the loop after the last search. And with that, I'm declaring __dynamic_cast done. Though if anyone sees any problems, has suggestions for improvements, or wants to contribute some test cases, that is certainly welcome feedback.
llvm-svn: 148246
2012-01-16 18:21:05 +00:00
Howard Hinnant 44a2895a03 Comment smithing. Changed some casts from C-style to C++. And added timings to all of the tests.
llvm-svn: 148241
2012-01-16 17:06:51 +00:00
Howard Hinnant 77fb8ab9f2 I think this is getting close on __dynamic_cast. There's been quite a bit of code rearrangement, renaming, and better commenting. This exercise has exposed and fixed a few more bugs. I've also added several more tests (there's definitely a need for more tests here).
llvm-svn: 148227
2012-01-16 00:13:46 +00:00
Howard Hinnant 50f7eeec9d Enclosed is a stress test for dynamic_cast. It stresses both libc++abi, and clang itself. It creates a ridiculously large class hierarchy using variadic templates. You can specify both the width and depth of the class hierarchy. And you can specify whether the cast is to the actual run time type, or to an intermediate layer in the class. About 1/3 of the time I compile this, it crashes the compiler. There seems to be an uninitialized area of memory, and I'm probably blowing past an assumption on class hierarchy size within clang (and understandably so). I can get it work most of the time with a class hierarchy width of 20 and a depth of 7. I'm making timings with both -O3 and -Os, using both cast to root and cast to intermediate, on both libc++abi, and gcc's dynamic_cast. I've put the results in a comment/table at the bottom of the test.
llvm-svn: 148083
2012-01-13 01:22:31 +00:00
Howard Hinnant b1ca881191 Oops, forgot to svn add the new test.
llvm-svn: 148047
2012-01-12 21:08:25 +00:00
Howard Hinnant b7d59ec6e1 Put debug print statments under a flag so that I can get a first glimpse at performance. So far I haven't noticed any performance difference between this new __dynamic_cast and gcc's implementation. But I've barely started looking. Also adding a couple of tests which come straight out of the standard.
llvm-svn: 148046
2012-01-12 21:06:12 +00:00
Howard Hinnant af07bfdb67 Fixed a couple of bugs, updated many comments, and am including a comprehensive test for when there are only 3 types in place. I need to do something similar for 4 and maybe more types, but I'm not sure how comprehensive I can make the test at 4 and above types.
llvm-svn: 148038
2012-01-12 19:48:14 +00:00
Howard Hinnant bf8a39bb94 Fixed several bugs, implemented support for vector types, and cleaned out dead code.
llvm-svn: 146677
2011-12-15 20:02:15 +00:00
Howard Hinnant 7a084fdd39 Fix size calculation for pointer to member function
llvm-svn: 146463
2011-12-13 01:23:16 +00:00
Howard Hinnant 8de583abf2 Added support for <special-name> ::= TC <first type> <number> _ <second type> # construction vtable for second-in-first, and for <special-name> ::= GR <object name> # reference temporary for object
llvm-svn: 146274
2011-12-09 20:07:56 +00:00
Howard Hinnant 987afbeede Add/update copyright notices
llvm-svn: 145949
2011-12-06 18:01:47 +00:00
Howard Hinnant dc82cca6bf Updated heuristic regulating small string buffer
llvm-svn: 145543
2011-12-01 00:08:59 +00:00
Howard Hinnant 26a9d23657 demangler: Drop preceeding () from function types, but not from pointers and references to function types
llvm-svn: 137469
2011-08-12 17:33:10 +00:00
Marshall Clow e2dcb75b2e Memory manangement routines for exception objects
llvm-svn: 135587
2011-07-20 15:04:39 +00:00
Marshall Clow 1df50ca6a2 Exception handling stuctures, and thread-local variables for exception handling
llvm-svn: 135586
2011-07-20 14:53:53 +00:00
Howard Hinnant 471e111324 In cxa_demangle.cpp, rewrite __parse_unresolved_name to reflect updated understanding and sync with updated clang mangling. Also fix think-o in __parse_encoding enabling the parsing of trailing .eh and .b.
llvm-svn: 133632
2011-06-22 19:27:39 +00:00
Marshall Clow 92091dbe41 Clean up the vector tests
llvm-svn: 132921
2011-06-13 17:57:10 +00:00
Marshall Clow 280ddee8bd Implement vector new and delete functionality
llvm-svn: 132832
2011-06-10 03:40:19 +00:00
Howard Hinnant 575498b52f tabs to spaces
llvm-svn: 132729
2011-06-07 19:56:49 +00:00
Nick Lewycky 6fde150697 Add more tests for cxa_guard methods. This includes our first two tests using
actual threads!

There's no build file for libcxxabi, so I'll tell you that I built it with this:
$ g++-4.6 -pthread -std=gnu++0x test_guard.cpp ../src/cxa_guard.o -o test_guard

llvm-svn: 132644
2011-06-04 18:01:24 +00:00
Marshall Clow f8da5b22af Tests for bad_typeid and bad_cast
llvm-svn: 132545
2011-06-03 13:54:37 +00:00
Howard Hinnant 4a88971ac1 Introduce cxa_virtual.cpp and cxa_guard.cpp. Contributed by Nick Lewycky, Howard Hinnant and John McCall
llvm-svn: 132009
2011-05-24 22:01:16 +00:00
Howard Hinnant d3da57f99b initial import
llvm-svn: 130921
2011-05-05 15:27:28 +00:00