summaryrefslogtreecommitdiff
path: root/unittests
Commit message (Collapse)AuthorAge
* Update getLazyBitcodeModule to use ErrorOr for error handling.Rafael Espindola2014-01-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199125 91177308-0d34-0410-b5e6-96231b3b80d8
* [PM] Split DominatorTree into a concrete analysis result object whichChandler Carruth2014-01-13
| | | | | | | | | | | | | | | | | | | | | | | can be used by both the new pass manager and the old. This removes it from any of the virtual mess of the pass interfaces and lets it derive cleanly from the DominatorTreeBase<> template. In turn, tons of boilerplate interface can be nuked and it turns into a very straightforward extension of the base DominatorTree interface. The old analysis pass is now a simple wrapper. The names and style of this split should match the split between CallGraph and CallGraphWrapperPass. All of the users of DominatorTree have been updated to match using many of the same tricks as with CallGraph. The goal is that the common type remains the resulting DominatorTree rather than the pass. This will make subsequent work toward the new pass manager significantly easier. Also in numerous places things became cleaner because I switched from re-running the pass (!!! mid way through some other passes run!!!) to directly recomputing the domtree. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199104 91177308-0d34-0410-b5e6-96231b3b80d8
* [cleanup] Move the Dominators.h and Verifier.h headers into the IRChandler Carruth2014-01-13
| | | | | | | | | | | | | | | | | | directory. These passes are already defined in the IR library, and it doesn't make any sense to have the headers in Analysis. Long term, I think there is going to be a much better way to divide these matters. The dominators code should be fully separated into the abstract graph algorithm and have that put in Support where it becomes obvious that evn Clang's CFGBlock's can use it. Then the verifier can manually construct dominance information from the Support-driven interface while the Analysis library can provide a pass which both caches, reconstructs, and supports a nice update API. But those are very long term, and so I don't want to leave the really confusing structure until that day arrives. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199082 91177308-0d34-0410-b5e6-96231b3b80d8
* [PM] Rename the IR printing pass header to a more generic and correctChandler Carruth2014-01-12
| | | | | | | | name to match the source file which I got earlier. Update the include sites. Also modernize the comments in the header to use the more recommended doxygen style. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199041 91177308-0d34-0410-b5e6-96231b3b80d8
* [PM] Add names to passes under the new pass manager, and a debug outputChandler Carruth2014-01-11
| | | | | | | | | | mode that can be used to debug the execution of everything. No support for analyses here, that will come later. This already helps show parts of the opt commandline integration that isn't working. Tests of that will start using it as the bugs are fixed. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199004 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove remove_all. A compiler has no need for recursively deleting a directory.Rafael Espindola2014-01-10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198955 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a unit test for the copy constructor.Rafael Espindola2014-01-09
| | | | | | | | I would not normally add tests like these, but the copy constructor is not used at all in our codebase with c++11, so having this tests might prevent breaking the c++03 build again. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198886 91177308-0d34-0410-b5e6-96231b3b80d8
* Use getError and remove the error_code operator.Rafael Espindola2014-01-08
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198799 91177308-0d34-0410-b5e6-96231b3b80d8
* Move the LLVM IR asm writer header files into the IR directory, as theyChandler Carruth2014-01-07
| | | | | | | | | | | | | | | | | are part of the core IR library in order to support dumping and other basic functionality. Rename the 'Assembly' include directory to 'AsmParser' to match the library name and the only functionality left their -- printing has been in the core IR library for quite some time. Update all of the #includes to match. All of this started because I wanted to have the layering in good shape before I started adding support for printing LLVM IR using the new pass infrastructure, and commandline support for the new pass infrastructure. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198688 91177308-0d34-0410-b5e6-96231b3b80d8
* Re-sort all of the includes with ./utils/sort_includes.py so thatChandler Carruth2014-01-07
| | | | | | | | | | subsequent changes are easier to review. About to fix some layering issues, and wanted to separate out the necessary churn. Also comment and sink the include of "Windows.h" in three .inc files to match the usage in Memory.inc. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198685 91177308-0d34-0410-b5e6-96231b3b80d8
* Add in a unittest for the one-use pattern matcher.Chandler Carruth2014-01-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198552 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support to the pattern match library for matching NSW and NUWChandler Carruth2014-01-05
| | | | | | | | | | | instructions. I needed this for a quick experiment I was making, and while I've no idea if that will ever get committed, I didn't want to throw away the pattern match code and for anyone else to have to write it again. I've added unittests to make sure this works correctly. In fun news, this also uncovered the IRBuilder bug. Doh! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198541 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a bug in IRBuilder that's been there for who knows how long. ItChandler Carruth2014-01-05
| | | | | | | | failed to correctly propagate the NUW and NSW flags to the constant folder for two instructions. I've added a unittest to cover flag propagation for the rest of the instructions and constant expressions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198538 91177308-0d34-0410-b5e6-96231b3b80d8
* Use a shorter name for the IRBuilder member. This will help the testsChandler Carruth2014-01-05
| | | | | | I'm adding next be a lot more readable. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198534 91177308-0d34-0410-b5e6-96231b3b80d8
* Simplify the PatternMatch unittest by giving it a module, function, andChandler Carruth2014-01-05
| | | | | | | | | basic block to hold instructions, and managing all of their lifetimes in a fixture. This makes it easy to sink the expectations into the test cases themselves which also makes things a bit more explicit and clearer IMO. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198532 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix break introduced in r198377 due to using a local type as a template ↵David Blaikie2014-01-03
| | | | | | parameter. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198379 91177308-0d34-0410-b5e6-96231b3b80d8
* Test coverage for non-default-constructible elements in a StringMapDavid Blaikie2014-01-02
| | | | | | | | | This functionality was enabled by r198374. Here's a test to ensure it works and we don't regress it. Based on a patch by Maciej Piechotka. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198377 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove StringMapEntryInitializer support.David Blaikie2014-01-02
| | | | | | | It was never specialized so let's just remove that unused configurability and always do the default. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198374 91177308-0d34-0410-b5e6-96231b3b80d8
* Make llvm::Regex non-copyable but movable.David Blaikie2014-01-02
| | | | | | Based on a patch by Maciej Piechotka. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198334 91177308-0d34-0410-b5e6-96231b3b80d8
* Use LLVM_STATIC_ASSERT rather than a hand-rolled implementation.David Blaikie2014-01-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198330 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename 'assert' to something less loaded in CompileAssertHasTypeAlp Toker2014-01-01
| | | | | | Suggested by Aaron Ballman. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198288 91177308-0d34-0410-b5e6-96231b3b80d8
* Silence g++ 4.9 build issue in unit testsAlp Toker2014-01-01
| | | | | | Stopgap measure until we can just use static_assert(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198273 91177308-0d34-0410-b5e6-96231b3b80d8
* Port r198087 and r198089 (strip dead code by default) from make to cmake.Nico Weber2013-12-30
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198198 91177308-0d34-0410-b5e6-96231b3b80d8
* Attempt to fix JIT unit tests after r198087.Nico Weber2013-12-27
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198089 91177308-0d34-0410-b5e6-96231b3b80d8
* Introduce a simple line-by-line iterator type into the Support library.Chandler Carruth2013-12-27
| | | | | | | | | | | | | | | | | | | This is an iterator which you can build around a MemoryBuffer. It will iterate through the non-empty, non-comment lines of the buffer as a forward iterator. It should be small and reasonably fast (although it could be made much faster if anyone cares, I don't really...). This will be used to more simply support the text-based sample profile file format, and is largely based on the original patch by Diego. I've re-worked the style of it and separated it from the work of producing a MemoryBuffer from a file which both simplifies the interface and makes it easier to test. The style of the API follows the C++ standard naming conventions to fit in better with iterators in general, much like the Path and FileSystem interfaces follow standard-based naming conventions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198068 91177308-0d34-0410-b5e6-96231b3b80d8
* unittests/Support/ProcessTest.cpp: Don't use "windows.h". Use <windows.h> ↵NAKAMURA Takumi2013-12-25
| | | | | | instead. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198011 91177308-0d34-0410-b5e6-96231b3b80d8
* Makefile.unittest: cleanup may fail. Add '-' in the action.NAKAMURA Takumi2013-12-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197777 91177308-0d34-0410-b5e6-96231b3b80d8
* Make sys::ThreadLocal<> zero-initialized on non-thread builds (PR18205)Hans Wennborg2013-12-19
| | | | | | | | | | | | | According to the docs, ThreadLocal<>::get() should return NULL if no object has been set. This patch makes that the case also for non-thread builds and adds a very basic unit test to check it. (This was causing PR18205 because PrettyStackTraceHead didn't get zero- initialized and we'd crash trying to read past the end of that list. We didn't notice this so much on Linux since we'd crash after printing all the entries, but on Mac we print into a SmallString, and would crash before printing that.) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197718 91177308-0d34-0410-b5e6-96231b3b80d8
* Introduce clean-ups in llvm/unittests/Makefile.unittest, to sweep stray *Tests.NAKAMURA Takumi2013-12-19
| | | | | | | | | Stray *Tests might stay after reverting. FIXME: Could we apply this feature to clang/unittests? FIXME: Implement this feature to CMake. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197661 91177308-0d34-0410-b5e6-96231b3b80d8
* No point in having a "#if 0"ed unittest.Rafael Espindola2013-12-19
| | | | | | | It is also not clear what the value of the test was. The API is used from existing tools and can (and is) tested with lit. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197654 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a buffer overrun detected by AddressSanitizer.Anna Zaks2013-12-19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197647 91177308-0d34-0410-b5e6-96231b3b80d8
* ArchiveFileDescriptorTests: Fix CMake build. Each unit test is expected to ↵NAKAMURA Takumi2013-12-19
| | | | | | have suffix "*Tests" for lit gtest runner to seek one. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197636 91177308-0d34-0410-b5e6-96231b3b80d8
* ArchiveFileDescriptorTests: Resurrect part of r197600, but make it ↵NAKAMURA Takumi2013-12-19
| | | | | | | | invalidated, to appease buildbots. Please revert this several hours later ;) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197635 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r197600 while I sort out why it's failing on Windows.Owen Anderson2013-12-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197602 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a unit test for loading an object file via a file descriptor. Patch by ↵Owen Anderson2013-12-18
| | | | | | Pete Cooper. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197600 91177308-0d34-0410-b5e6-96231b3b80d8
* [block-freq] Add a right shift to BlockFrequency that saturates at 1.Michael Gottesman2013-12-14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197302 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove APInt::extractBit since it is already implemented via operator[]. ↵Michael Gottesman2013-12-13
| | | | | | Change tests for extractBit to test operator[]. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197277 91177308-0d34-0410-b5e6-96231b3b80d8
* [block-freq] Add the method APInt::nearestLogBase2().Michael Gottesman2013-12-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197272 91177308-0d34-0410-b5e6-96231b3b80d8
* [block-freq] Add the APInt method extractBit.Michael Gottesman2013-12-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197271 91177308-0d34-0410-b5e6-96231b3b80d8
* Use a: and s: instead of a0: and s0: in the DataLayout strings.Rafael Espindola2013-12-13
| | | | | | They are equivalent and the size of 'a' and 's' is unused. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197259 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove some dead codeRichard Barton2013-12-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197144 91177308-0d34-0410-b5e6-96231b3b80d8
* Swap around EXPECT_EQ() arguments orders for more natural gtest Failure messagesAlp Toker2013-12-12
| | | | | | | | | Somewhat counterintuitively the first arg in gtest is treated as the expectation. No change to the tests themselves. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197124 91177308-0d34-0410-b5e6-96231b3b80d8
* Add missing escape characters to the new Regex::escape() functionAlp Toker2013-12-12
| | | | | | | | | The old AddFixedStringToRegEx() it was based on got away with this for the longest time, but the problem became easy to spot after the cleanup in r197096. Also add a quick unit test to cover regex escaping. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197121 91177308-0d34-0410-b5e6-96231b3b80d8
* Darwin: update default iOS version to 5.0Tim Northover2013-12-10
| | | | | | | | | | | | Defaulting to iOS 3.0 when LLVM has to guess the version is no longer a useful option and can give surprising results (like tail calls being disabled). 5.0 seems like a reasonable compromise as a platform that's still interesting to some people. rdar://problem/15567348 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196912 91177308-0d34-0410-b5e6-96231b3b80d8
* [CMake] Update LLVM_LINK_COMPONENTS for each CMakeLists.txt.NAKAMURA Takumi2013-12-10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196908 91177308-0d34-0410-b5e6-96231b3b80d8
* Add JIT to LINK_COMPONENTS in MCJITTests/Makefile.NAKAMURA Takumi2013-12-10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196907 91177308-0d34-0410-b5e6-96231b3b80d8
* [asan] rewrite asan's stack frame layoutKostya Serebryany2013-12-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Rewrite asan's stack frame layout. First, most of the stack layout logic is moved into a separte file to make it more testable and (potentially) useful for other projects. Second, make the frames more compact by using adaptive redzones (smaller for small objects, larger for large objects). Third, try to minimized gaps due to large alignments (this is hypothetical since today we don't see many stack vars aligned by more than 32). The frames indeed become more compact, but I'll still need to run more benchmarks before committing, but I am sking for review now to get early feedback. This change will be accompanied by a trivial change in compiler-rt tests to match the new frame sizes. Reviewers: samsonov, dvyukov Reviewed By: samsonov CC: llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D2324 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196568 91177308-0d34-0410-b5e6-96231b3b80d8
* Use present fast-math flags when applicable in CreateBinOpMichael Ilseman2013-12-05
| | | | | | | | | | We were previously not adding fast-math flags through CreateBinOp() when it happened to be making a floating point binary operator. This patch updates it to do so similarly to directly calling CreateF*(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196438 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix dominator descendants for unreachable blocks.Diego Novillo2013-12-02
| | | | | | | | | | | | | When a block is unreachable, asking its dom tree descendants should return the empty set. However, the computation of the descendants was causing a segmentation fault because the dom tree node we get from the basic block is initially NULL. Fixed by adding a test for a valid dom tree node before we iterate. The patch also adds some unit tests to the existing dom tree tests. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196099 91177308-0d34-0410-b5e6-96231b3b80d8
* [CMake] Also OptionTests can be free from add_dependencies() with ↵NAKAMURA Takumi2013-11-28
| | | | | | add_public_tablegen_target(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195928 91177308-0d34-0410-b5e6-96231b3b80d8