summaryrefslogtreecommitdiff
path: root/unittests
Commit message (Collapse)AuthorAge
* Move CallGraphSCCPass.h into the Analysis tree; that's where theChandler Carruth2013-01-07
| | | | | | implementation lives already. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171746 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename the unittest from ArrayRecylerTest.cpp to ArrayRecyclerTest.cpp.Chandler Carruth2013-01-05
| | | | | | | Fixes the CMake build. It took me cutting and pasting this before I managed to see the missing character. =] git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171589 91177308-0d34-0410-b5e6-96231b3b80d8
* Add an ArrayRecycler class.Jakob Stoklund Olesen2013-01-05
| | | | | | | | This is similar to the existing Recycler allocator, but instead of recycling individual objects from a BumpPtrAllocator, arrays of different sizes can be allocated. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171581 91177308-0d34-0410-b5e6-96231b3b80d8
* Add time getters to the process interface for requesting the elapsedChandler Carruth2013-01-04
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | wall time, user time, and system time since a process started. For walltime, we currently use TimeValue's interface and a global initializer to compute a close approximation of total process runtime. For user time, this adds support for an somewhat more precise timing mechanism -- clock_gettime with the CLOCK_PROCESS_CPUTIME_ID clock selected. For system time, we have to do a full getrusage call to extract the system time from the OS. This is expensive but unavoidable. In passing, clean up the implementation of the old APIs and fix some latent bugs in the Windows code. This might have manifested on Windows ARM systems or other systems with strange 64-bit integer behavior. The old API for this both user time and system time simultaneously from a single getrusage call. While this results in fewer system calls, it also results in a lower precision user time and if only user time is desired, it introduces a higher overhead. It may be worthwhile to switch some of the pass timers to not track system time and directly track user and wall time. The old API also tracked walltime in a confusing way -- it just set it to the current walltime rather than providing any measure of wall time since the process started the way buth user and system time are tracked. The new API is more consistent here. The plan is to eventually implement these methods for a *child* process by using the wait3(2) system call to populate an rusage struct representing the whole subprocess execution. That way, after waiting on a child process its stats will become accurate and cheap to query. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171551 91177308-0d34-0410-b5e6-96231b3b80d8
* Add an iplist::clearAndLeakNodesUnsafely() function.Jakob Stoklund Olesen2013-01-04
| | | | | | | | | | | | The iplist::clear() function can be quite expensive because it traverses the entire list, calling deleteNode() and removeNodeFromList() on each element. If node destruction and deallocation can be handled some other way, clearAndLeakNodesUnsafely() can be used to jettison all nodes without bringing them into cache. The function name is meant to be ominous. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171540 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix how YAML I/O detects flow sequences. Nick Kledzik2013-01-04
| | | | | | | | Update test case to verify flow sequence is written as a flow sequence. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171514 91177308-0d34-0410-b5e6-96231b3b80d8
* [Support][Endian] Add support for specifying the alignment and native ↵Michael J. Spencer2013-01-02
| | | | | | | | | | | unaligned types. * Add support for specifying the alignment to use. * Add the concept of native endianness. Used for unaligned native types. The native alignment and read/write simplification is based on a patch by Richard Smith. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171406 91177308-0d34-0410-b5e6-96231b3b80d8
* Move all of the header files which are involved in modelling the LLVM IRChandler Carruth2013-01-02
| | | | | | | | | | | | | | | | | | | | | into their new header subdirectory: include/llvm/IR. This matches the directory structure of lib, and begins to correct a long standing point of file layout clutter in LLVM. There are still more header files to move here, but I wanted to handle them in separate commits to make tracking what files make sense at each layer easier. The only really questionable files here are the target intrinsic tablegen files. But that's a battle I'd rather not fight today. I've updated both CMake and Makefile build systems (I think, and my tests think, but I may have missed something). I've also re-sorted the includes throughout the project. I'll be committing updates to Clang, DragonEgg, and Polly momentarily. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171366 91177308-0d34-0410-b5e6-96231b3b80d8
* Sort a few more #include lines in tools/... unittests/... and utils/...Chandler Carruth2013-01-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171363 91177308-0d34-0410-b5e6-96231b3b80d8
* Go ahead and get rid of the old page size interface and convert all theChandler Carruth2012-12-31
| | | | | | | users over to the new one. No sense maintaining this "compatibility" layer it seems. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171331 91177308-0d34-0410-b5e6-96231b3b80d8
* Flesh out a page size accessor in the new API.Chandler Carruth2012-12-31
| | | | | | | | Implement the old API in terms of the new one. This simplifies the implementation on Windows which can now re-use the self_process's once initialization. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171330 91177308-0d34-0410-b5e6-96231b3b80d8
* [AlignOf] Add AlignedCharArray and refactor AlignedCharArrayUnion.Michael J. Spencer2012-12-31
| | | | | | | This adds AlignedCharArray<Alignment, Size>. A templated struct that contains a member named buffer of type char[Size] that is aligned to Alignment. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171319 91177308-0d34-0410-b5e6-96231b3b80d8
* Begin sketching out the process interface.Chandler Carruth2012-12-31
| | | | | | | | | | | | | | | | | | | | | | | The coding style used here is not LLVM's style because this is modeled after a Boost interface and thus done in the style of a candidate C++ standard library interface. I'll probably end up proposing it as a standard C++ library if it proves to be reasonably portable and useful. This is just the most basic parts of the interface -- getting the process ID out of it. However, it helps sketch out some of the boiler plate such as the base class, derived class, shared code, and static factory function. It also introduces a unittest so that I can incrementally ensure this stuff works. However, I've not even compiled this code for Windows yet. I'll try to fix any Windows fallout from the bots, and if I can't fix it I'll revert and get someone on Windows to help out. There isn't a lot more that is mandatory, so soon I'll switch to just stubbing out the Windows side and get Michael Spencer to help with implementation as he can test it directly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171289 91177308-0d34-0410-b5e6-96231b3b80d8
* Test that a landingpad gets the name provided when it was created (see commitDuncan Sands2012-12-21
| | | | | | | 170318). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170886 91177308-0d34-0410-b5e6-96231b3b80d8
* Add an assertion for a likely ilist::splice() contract violation.Jakob Stoklund Olesen2012-12-18
| | | | | | | | | | | | | | | | | | | | | | | The single-element ilist::splice() function supports a noop move: List.splice(I, List, I); The corresponding std::list function doesn't allow that, so add a unit test to document that behavior. This also means that List.splice(I, List, F); is somewhat surprisingly not equivalent to List.splice(I, List, F, next(F)); This patch adds an assertion to catch the illegal case I == F above. Alternatively, we could make I == F a legal noop, but that would make ilist differ even more from std::list. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170443 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix some integer constant warnings by using a suffixNick Kledzik2012-12-17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170376 91177308-0d34-0410-b5e6-96231b3b80d8
* re-enable test cases now that traits work with g++. Fix some g++ warningsNick Kledzik2012-12-17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170369 91177308-0d34-0410-b5e6-96231b3b80d8
* Temporarily disable test cases until they compile with g++ too.Nick Kledzik2012-12-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170035 91177308-0d34-0410-b5e6-96231b3b80d8
* Unbreak the build. Fallout from r170019.David Blaikie2012-12-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170033 91177308-0d34-0410-b5e6-96231b3b80d8
* Initial implementation of a utility for converting native data Nick Kledzik2012-12-12
| | | | | | | | | | | | structures to and from YAML using traits. The first client will be the test suite of lld. The documentation will show up at: http://llvm.org/docs/YamlIO.html git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170019 91177308-0d34-0410-b5e6-96231b3b80d8
* Reorganize FastMathFlags to be a wrapper around unsigned, and streamline ↵Michael Ilseman2012-12-09
| | | | | | some interfaces. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169712 91177308-0d34-0410-b5e6-96231b3b80d8
* s/AttrListPtr/AttributeSet/g to better label what this class is going to be ↵Bill Wendling2012-12-07
| | | | | | in the near future. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169651 91177308-0d34-0410-b5e6-96231b3b80d8
* Do not run tests MappedMemoryTest.BasicWrite and MultipleWrite unless bothAkira Hatanaka2012-12-05
| | | | | | | MF_READ and MF_WRITE are set. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169439 91177308-0d34-0410-b5e6-96231b3b80d8
* Copy clang/Driver/<Option parsing stuff> to llvm.Michael J. Spencer2012-12-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169344 91177308-0d34-0410-b5e6-96231b3b80d8
* Sort the #include lines for unittest/...Chandler Carruth2012-12-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169250 91177308-0d34-0410-b5e6-96231b3b80d8
* VMCoreTests/PassManagerTest.cpp: Appease msvc not to do "using llvm::Pass" ↵NAKAMURA Takumi2012-12-04
| | | | | | | | in class template. FIXME: I have not checked whether to be compiled on msvc11. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169225 91177308-0d34-0410-b5e6-96231b3b80d8
* Add 'using' declarations to suppress -Woverloaded-virtual warnings.Matt Beaumont-Gay2012-12-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169214 91177308-0d34-0410-b5e6-96231b3b80d8
* [Support] Make FileOutputBuffer work on Windows.Michael J. Spencer2012-12-03
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169167 91177308-0d34-0410-b5e6-96231b3b80d8
* Switch LLVM_USE_RVALUE_REFERENCES to LLVM_HAS_RVALUE_REFERENCES.Chandler Carruth2012-11-30
| | | | | | | | | | | | | | Rationale: 1) This was the name in the comment block. ;] 2) It matches Clang's __has_feature naming convention. 3) It matches other compiler-feature-test conventions. Sorry for the noise. =] I've also switch the comment block to use a \brief tag and not duplicate the name. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168996 91177308-0d34-0410-b5e6-96231b3b80d8
* copyFastMathFlags utility and test caseMichael Ilseman2012-11-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168943 91177308-0d34-0410-b5e6-96231b3b80d8
* Whoops, fixed bad mergeMichael Ilseman2012-11-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168816 91177308-0d34-0410-b5e6-96231b3b80d8
* Fixed bad test caseMichael Ilseman2012-11-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168815 91177308-0d34-0410-b5e6-96231b3b80d8
* Fast-math: IRBuilder test for creating instructions with fast-math flagsMichael Ilseman2012-11-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168814 91177308-0d34-0410-b5e6-96231b3b80d8
* Add backreference matching capabilities to Support/Regex, withEli Bendersky2012-11-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | appropriate unit tests. This change in itself is not expected to affect any functionality at this point, but it will serve as a stepping stone to improve FileCheck's variable matching capabilities. Luckily, our regex implementation already supports backreferences, although a bit of hacking is required to enable it. It supports both Basic Regular Expressions (BREs) and Extended Regular Expressions (EREs), without supporting backrefs for EREs, following POSIX strictly in this respect. And EREs is what we actually use (rightly). This is contrary to many implementations (including the default on Linux) of POSIX regexes, that do allow backrefs in EREs. Adding backref support to our EREs is a very simple change in the regcomp parsing code. I fail to think of significant cases where it would clash with existing things, and can bring more versatility to the regexes we write. There's always the danger of a backref in a specially crafted regex causing exponential matching times, but since we mainly use them for testing purposes I don't think it's a big problem. [it can also be placed behind a flag specific to FileCheck, if needed]. For more details, see: * http://lists.cs.uiuc.edu/pipermail/llvmdev/2012-November/055840.html * http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20121126/156878.html git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168802 91177308-0d34-0410-b5e6-96231b3b80d8
* Moving SectionMemoryManager into RuntimeDyld and adding unit tests for it.Andrew Kaylor2012-11-27
| | | | | | | | The SectionMemoryManager now supports (and requires) applying section-specific page permissions. Clients using this memory manager must call either MCJIT::finalizeObject() or SectionMemoryManager::applyPermissions() before executing JITed code. See r168718 for changes from the previous implementation. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168721 91177308-0d34-0410-b5e6-96231b3b80d8
* Implementing page permission setting in MCJIT unit test SectionMemoryManager.cppAndrew Kaylor2012-11-27
| | | | | | This commit is primarily here for the revision history. I'm about to move the SectionMemoryManager into the RuntimeDyld library, but I wanted to check the changes in here so people could see the differences in the updated implementation. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168718 91177308-0d34-0410-b5e6-96231b3b80d8
* Allow using MemoryBuffers with yaml::Stream directly.Sean Silva2012-11-19
| | | | | | | | | | The rationale is to get YAML filenames in diagnostics from yaml::Stream::printError -- currently the filename is hard-coded as "YAML" because there's no buffer information available. Patch by Kim Gräsman! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168341 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a new function to ConstantExpr - getAsInstruction. This returns its ↵James Molloy2012-11-17
| | | | | | | | | | Instruction* corollary, which may be useful if a user wishes to transform a ConstantExpr so that one of its operands is no longer constant. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168262 91177308-0d34-0410-b5e6-96231b3b80d8
* Removing utf-8 smart quote and trailing whitespaceJoe Abbey2012-11-17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168253 91177308-0d34-0410-b5e6-96231b3b80d8
* Suppressing the 'direct base ‘{anonymous}::S1’ inaccessible in ↵Joe Abbey2012-11-17
| | | | | | | | | | ‘{anonymous}::D9’ due to ambiguity' warning. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168251 91177308-0d34-0410-b5e6-96231b3b80d8
* Interface changes to allow RuntimeDyld memory managers to set memory ↵Andrew Kaylor2012-11-15
| | | | | | permissions after an object has been loaded. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168114 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove DOS line endings.Jakub Staszak2012-11-14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167968 91177308-0d34-0410-b5e6-96231b3b80d8
* do not play preprocessor tricks with 'private', use public interfaces ↵Gabor Greif2012-11-12
| | | | | | instead; this appeases the VC++ buildbots git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167724 91177308-0d34-0410-b5e6-96231b3b80d8
* add unit test for waymarking algorithm (Use::getUser)Gabor Greif2012-11-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167720 91177308-0d34-0410-b5e6-96231b3b80d8
* Provide definitions for all functions.Benjamin Kramer2012-11-10
| | | | | | | ICC refuses to compile a class in an anonymous namespace if some functions aren't defined. Fixes PR13477. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167676 91177308-0d34-0410-b5e6-96231b3b80d8
* Drop the limitation to IEEE floating point types from the fdiv of pow2 -> ↵Benjamin Kramer2012-11-08
| | | | | | | | fmul transform. This is safe for x87 long doubles and ppc double doubles too. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167582 91177308-0d34-0410-b5e6-96231b3b80d8
* MCJIT unit test: add calls to ensure that instruction caches are properly ↵Amara Emerson2012-10-31
| | | | | | invalidated before code execution. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167146 91177308-0d34-0410-b5e6-96231b3b80d8
* Port lli bug fix from r166920 to MCJIT unit test.Amara Emerson2012-10-31
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167145 91177308-0d34-0410-b5e6-96231b3b80d8
* Commit access test.Amara Emerson2012-10-31
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167144 91177308-0d34-0410-b5e6-96231b3b80d8
* Disable all old-JIT unit tests on PowerPC.Ulrich Weigand2012-10-31
| | | | | | | | | These tests were all failing since the old JIT doesn't work for PowerPC (any more), and there are no plans to attempt to fix it again (instead, work focuses on MCJIT). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167133 91177308-0d34-0410-b5e6-96231b3b80d8