summaryrefslogtreecommitdiff
path: root/unittests
Commit message (Collapse)AuthorAge
* Avoid using PathV1.h in Program.h.Rafael Espindola2013-06-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183940 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove the program class.Rafael Espindola2013-06-12
| | | | | | | It was only used to implement ExecuteAndWait and ExecuteNoWait. Expose just those two functions and make Execute and Wait implementations details. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183864 91177308-0d34-0410-b5e6-96231b3b80d8
* Move PathV2.h to Path.hRafael Espindola2013-06-11
| | | | | | | Most clients have already been moved from Path V1 to V2. The ones using V1 now include PathV1.h explicitly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183801 91177308-0d34-0410-b5e6-96231b3b80d8
* sys::process::get_id() now returns the process ID instead of a process ↵Aaron Ballman2013-06-08
| | | | | | handle on Windows. Patch thanks to Kim Gräsman! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183621 91177308-0d34-0410-b5e6-96231b3b80d8
* BitVector: Do the right thing in all() when Size is a multiple of BITWORD_SIZE.Benjamin Kramer2013-06-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183525 91177308-0d34-0410-b5e6-96231b3b80d8
* Optimize BitVector::all().Benjamin Kramer2013-06-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183521 91177308-0d34-0410-b5e6-96231b3b80d8
* IEEE-754R 5.7.2 General Operations is* operations (except for isCanonical).Michael Gottesman2013-06-04
| | | | | | | | | | | | | | | Specifically the following work was done: 1. If the operation was not implemented, I implemented it. 2. If the operation was already implemented, I just moved its location in the APFloat header into the IEEE-754R 5.7.2 section. If the name was incorrect, I put in a comment giving the true IEEE-754R name. Also unittests have been added for all of the functions which did not already have a unittest. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183179 91177308-0d34-0410-b5e6-96231b3b80d8
* Try to avoid "integer literal too big" warnings from older GCCs.Benjamin Kramer2013-06-01
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183081 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for adding the contents of a StringRef to the MD5 hash.Eric Christopher2013-05-31
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183054 91177308-0d34-0410-b5e6-96231b3b80d8
* Convert more unsigned char -> uint8_t.Eric Christopher2013-05-31
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183053 91177308-0d34-0410-b5e6-96231b3b80d8
* [APFloat] Added a unittest for APFloat::getZero.Michael Gottesman2013-05-31
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183028 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove unused member.Rafael Espindola2013-05-30
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182958 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement IEEE-754R 2008 nextUp/nextDown functions in the guise of the ↵Michael Gottesman2013-05-30
| | | | | | | | function APFloat::next(bool nextDown). rdar://13852078 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182945 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a comment and some tests including the NULL byte.Eric Christopher2013-05-30
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182900 91177308-0d34-0410-b5e6-96231b3b80d8
* Added a unittest for APFloat::getSmallestNormalized.Michael Gottesman2013-05-30
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182897 91177308-0d34-0410-b5e6-96231b3b80d8
* Added code to the unittest for APFloat::getSmallest to double check that we ↵Michael Gottesman2013-05-30
| | | | | | | | | consider the result to be denormal. I additionally changed certain checks to use EXPECT_FALSE instead of a boolean complement with EXPECT_TRUE. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182896 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a unittest for APFloat::getSmallest.Michael Gottesman2013-05-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182894 91177308-0d34-0410-b5e6-96231b3b80d8
* [APInt] Implement tcDecrement as a counterpart to tcIncrement. This is for ↵Michael Gottesman2013-05-28
| | | | | | | | use in APFloat IEEE-754R 2008 nextUp/nextDown function. rdar://13852078 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182801 91177308-0d34-0410-b5e6-96231b3b80d8
* Add to testsuite.Eric Christopher2013-05-24
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182693 91177308-0d34-0410-b5e6-96231b3b80d8
* ArrayRef-ize MD5 and clean up a few variable names.Eric Christopher2013-05-24
| | | | | | | Add a stringize method to make dumping a bit easier, and add a testcase exercising a few different paths. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182692 91177308-0d34-0410-b5e6-96231b3b80d8
* [Support] Remove Count{Leading,Trailing}Zeros_{32,64}.Michael J. Spencer2013-05-24
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182690 91177308-0d34-0410-b5e6-96231b3b80d8
* [Support][MathExtras] Fix literal type issues.Michael J. Spencer2013-05-24
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182679 91177308-0d34-0410-b5e6-96231b3b80d8
* [Support] Add type generic bit utilities to MathExtras.hMichael J. Spencer2013-05-24
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182667 91177308-0d34-0410-b5e6-96231b3b80d8
* Expose the RTDyldMemoryManager through the C API. This allows clients of Filip Pizlo2013-05-22
| | | | | | | | | | the C API to provide their own way of allocating JIT memory (both code and data) and finalizing memory permissions (page protections, cache flush). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182448 91177308-0d34-0410-b5e6-96231b3b80d8
* Roll out r182407 and r182408 because they broke builds.Filip Pizlo2013-05-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182409 91177308-0d34-0410-b5e6-96231b3b80d8
* Expose the RTDyldMemoryManager through the C API. This allows clients of Filip Pizlo2013-05-21
| | | | | | | | | | the C API to provide their own way of allocating JIT memory (both code and data) and finalizing memory permissions (page protections, cache flush). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182408 91177308-0d34-0410-b5e6-96231b3b80d8
* Alternative fix for problem addressed in r182233Ulrich Weigand2013-05-21
| | | | | | | | | | | | | | | | | | | Revision r182233 partially reverted the change in r181200 to simplify JIT unif test #ifdefs, because that change caused a link error on some host operating systems where the export list requires the following symbols to be defined: JITTest_AvailableExternallyFunction JITTest_AvailableExternallyGlobal As discussed on the list, the commit reverts r182233 (and re-installs the full r181200 change), and instead fixes the link problem by moving those two symbols to the top of the file and unconditionally defining them. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182367 91177308-0d34-0410-b5e6-96231b3b80d8
* Partially revert change in r181200 that tried to simplify JIT unit test #ifdefs.Bob Wilson2013-05-20
| | | | | | | | | | | | | | The export list for this test requires the following symbols to be available: JITTest_AvailableExternallyFunction JITTest_AvailableExternallyGlobal The change in r181200 commented them out, which caused the test to fail to link, at least on Darwin. I have only reverted the change for arm, since I can't test the other targets and since it sounds like that change was fixing real problems for those other targets. It should be possible to rearrange the code to keep those definitions outside the #ifdefs, but that should be done by someone who can reproduce the problems that r181200 was trying to fix. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182233 91177308-0d34-0410-b5e6-96231b3b80d8
* SubArch support in MCJIT unittestRenato Golin2013-05-19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182220 91177308-0d34-0410-b5e6-96231b3b80d8
* AArch64: enable MCJIT unittestsTim Northover2013-05-19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182217 91177308-0d34-0410-b5e6-96231b3b80d8
* Minor changes to the MCJITTest unittests to use the correct API for finalizingDavid Tweed2013-05-17
| | | | | | | | the JIT object (including XFAIL an ARM test that now needs fixing). Also renames internal function for consistency. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182085 91177308-0d34-0410-b5e6-96231b3b80d8
* Use only explicit bool conversion operatorsDavid Blaikie2013-05-15
| | | | | | | | | | | | | | | | | | | | | | | BitVector/SmallBitVector::reference::operator bool remain implicit since they model more exactly a bool, rather than something else that can be boolean tested. The most common (non-buggy) case are where such objects are used as return expressions in bool-returning functions or as boolean function arguments. In those cases I've used (& added if necessary) a named function to provide the equivalent (or sometimes negative, depending on convenient wording) test. One behavior change (YAMLParser) was made, though no test case is included as I'm not sure how to reach that code path. Essentially any comparison of llvm::yaml::document_iterators would be invalid if neither iterator was at the end. This helped uncover a couple of bugs in Clang - test cases provided for those in a separate commit along with similar changes to `operator bool` instances in Clang. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@181868 91177308-0d34-0410-b5e6-96231b3b80d8
* SectionMemoryManager shouldn't be a JITMemoryManager. Previously, the Filip Pizlo2013-05-14
| | | | | | | | | | | | | | | | | | | EngineBuilder interface required a JITMemoryManager even if it was being used to construct an MCJIT. But the MCJIT actually wants a RTDyldMemoryManager. Consequently, the SectionMemoryManager, which is meant for MCJIT, derived from the JITMemoryManager and then stubbed out a bunch of JITMemoryManager methods that weren't relevant to the MCJIT. This patch fixes the situation: it teaches the EngineBuilder that RTDyldMemoryManager is a supertype of JITMemoryManager, and that it's appropriate to pass a RTDyldMemoryManager instead of a JITMemoryManager if we're using the MCJIT. This allows us to remove the stub methods from SectionMemoryManager, and make SectionMemoryManager a direct subtype of RTDyldMemoryManager. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@181820 91177308-0d34-0410-b5e6-96231b3b80d8
* Get the unittests compiling when building with cmake and the settingDuncan Sands2013-05-14
| | | | | | | -DLLVM_ENABLE_THREADS=false. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@181788 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a bug that APFloat::fusedMultiplyAdd() mistakenly evaluate "14.5f * ↵Shuxin Yang2013-05-13
| | | | | | -14.5f + 225.0f" to 225.0f. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@181715 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix MCJITCAPITest.cpp unit test on Windows.Andrew Kaylor2013-05-10
| | | | | | MCJIT on Windows requires an explicit target triple with "-elf" appended to generate objects in ELF format. The common test framework was setting up this triple, but it wasn't passed to the C API in the test. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@181614 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove exception handling support from the old JIT.Rafael Espindola2013-05-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@181354 91177308-0d34-0410-b5e6-96231b3b80d8
* Implemented public interface for modifying registered (not positional or ↵Andrew Trick2013-05-06
| | | | | | | | sink options) command line options at runtime. Patch by Dan Liew! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@181254 91177308-0d34-0410-b5e6-96231b3b80d8
* Support command line option categories.Andrew Trick2013-05-06
| | | | | | Patch by Dan Liew! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@181253 91177308-0d34-0410-b5e6-96231b3b80d8
* [SystemZ] Set up JIT/MCJIT test casesUlrich Weigand2013-05-06
| | | | | | | | | | | | | This patch adds the necessary configuration bits and #ifdef's to set up the JIT/MCJIT test cases for SystemZ. Like other recent targets, we do fully support MCJIT, but do not support the old JIT at all. Set up the lit config files accordingly, and disable old-JIT unit tests. Patch by Richard Sandiford. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@181207 91177308-0d34-0410-b5e6-96231b3b80d8
* Simplify JIT unit test #ifdefsUlrich Weigand2013-05-06
| | | | | | | | | | | | | | | | | | | | | Several platforms need to disable all old-JIT unit tests, since they only support the new MCJIT. This currently done via #ifdef'ing out those tests in the ExecutionEngine/JIT/*.cpp files. As those #ifdef's have grown historically, we now have a number of repeated directives which -in total- cover nearly the whole file, but leave a couple of helper functions out. When building the tests with clang itself, those helper functions now cause spurious "unused function" warnings. To fix those warnings, and also to remove the duplicate #ifdef conditions and make it easier to disable the tests for a new target, this patch consolidates the #ifdefs into a single one per file, which covers all the tests including all helper routines. Tested on PowerPC and SystemZ. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@181200 91177308-0d34-0410-b5e6-96231b3b80d8
* Add missing PatternMatch.cpp to CMakeLists.txtArnold Schwaighofer2013-05-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@181147 91177308-0d34-0410-b5e6-96231b3b80d8
* PatternMatch: Matcher for (un)ordered floating point min/maxArnold Schwaighofer2013-05-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support for matching 'ordered' and 'unordered' floating point min/max constructs. In LLVM we can express min/max functions as a combination of compare and select. We have support for matching such constructs for integers but not for floating point. In floating point math there is no total order because of the presence of 'NaN'. Therefore, we have to be careful to preserve the original fcmp semantics when interpreting floating point compare select combinations as a minimum or maximum function. The resulting 'ordered/unordered' floating point maximum function has to select the same value as the select/fcmp combination it is based on. ordered_max(x,y) = max(x,y) iff x and y are not NaN, y otherwise unordered_max(x,y) = max(x,y) iff x and y are not NaN, x otherwise ordered_min(x,y) = min(x,y) iff x and y are not NaN, y otherwise unordered_min(x,y) = min(x,y) iff x and y are not NaN, x otherwise This matches the behavior of the underlying select(fcmp(olt/ult/.., L, R), L, R) construct. Any code using this predicate has to preserve this semantics. A follow-up patch will use this to implement floating point min/max reductions in the vectorizer. radar://13723044 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@181143 91177308-0d34-0410-b5e6-96231b3b80d8
* This exposes more MCJIT options via the C API:Filip Pizlo2013-05-01
| | | | | | | | | | | | | | | | | | | | | | | CodeModel: It's now possible to create an MCJIT instance with any CodeModel you like. Previously it was only possible to create an MCJIT that used CodeModel::JITDefault. EnableFastISel: It's now possible to turn on the fast instruction selector. The CodeModel option required some trickery. The problem is that previously, we were ensuring future binary compatibility in the MCJITCompilerOptions by mandating that the user bzero's the options struct and passes the sizeof() that he saw; the bindings then bzero the remaining bits. This works great but assumes that the bitwise zero equivalent of any field is a sensible default value. But this is not the case for LLVMCodeModel, or its internal equivalent, llvm::CodeModel::Model. In both of those, the default for a JIT is CodeModel::JITDefault (or LLVMCodeModelJITDefault), which is not bitwise zero. Hence this change introduces LLVMInitializeMCJITCompilerOptions(), which will initialize the user's options struct with defaults. The user will use this in the same way that they would have previously used memset() or bzero(). MCJITCAPITest.cpp illustrates the change, as does the comment in ExecutionEngine.h. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@180893 91177308-0d34-0410-b5e6-96231b3b80d8
* Wrap some lines to bring MCJITCAPITest into conformance with the 80 column ↵Filip Pizlo2013-05-01
| | | | | | limit. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@180839 91177308-0d34-0410-b5e6-96231b3b80d8
* Try to fix ProgramTest on FreeBSDReid Kleckner2013-04-30
| | | | | | | This seemed like the cleanest way to find the test executable. Also fix the file mode. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@180770 91177308-0d34-0410-b5e6-96231b3b80d8
* Exposing MCJIT through C APIAndrew Kaylor2013-04-29
| | | | | | | | | | Re-submitting with fix for OCaml dependency problems (removing dependency on SectionMemoryManager when it isn't used). Patch by Fili Pizlo git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@180720 91177308-0d34-0410-b5e6-96231b3b80d8
* Re-enabling MCJIT object caching with memory leak fixedAndrew Kaylor2013-04-25
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@180575 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "Adding object caching support to MCJIT"Rafael Espindola2013-04-25
| | | | | | | | | | This reverts commit 07f03923137a91e3cca5d7fc075a22f8c9baf33a. Looks like it broke the valgrind bot: http://lab.llvm.org:8011/builders/llvm-x86_64-linux-vg_leak/builds/649 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@180249 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "Exposing MCJIT through C API"Rafael Espindola2013-04-25
| | | | | | | | | | This reverts commit 8c31b298149ca3c3f2bbd9e8aa9a01c4d91f3d74. It looks like this commit broke some bots: http://lab.llvm.org:8011/builders/llvm-ppc64-linux2/builds/5209 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@180248 91177308-0d34-0410-b5e6-96231b3b80d8