summaryrefslogtreecommitdiff
path: root/unittests
Commit message (Collapse)AuthorAge
* Fix TimeValue::now() on Unix.Torok Edwin2010-01-22
| | | | | | | | | | TimeValue()::now().toEpochTime() is supposed to be the same as time(), but it wasn't, because toEpoch subtracted PosixZeroTime, but now() didn't add PosixZeroTime! Add a unittest to check this works. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94178 91177308-0d34-0410-b5e6-96231b3b80d8
* Stop building RTTI information for *most* llvm libraries. NotableChris Lattner2010-01-22
| | | | | | | | | | | | | missing ones are libsupport, libsystem and libvmcore. libvmcore is currently blocked on bugpoint, which uses EH. Once it stops using EH, we can switch it off. This #if 0's out 3 unit tests, because gtest requires RTTI information. Suggestions welcome on how to fix this. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94164 91177308-0d34-0410-b5e6-96231b3b80d8
* NamedMDNode is a collection MDNodes.Devang Patel2010-01-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92761 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a SmallBitVector class, which mimics BitVector but uses onlyDan Gohman2010-01-05
| | | | | | | | | | | | | a single pointer (PointerIntPair) member. In "small" mode, the pointer field is reinterpreted as a set of bits. In "large" mode, the pointer points to a heap-allocated object. Also, give BitVector empty and swap functions. And, add some simple unittests for BitVector and SmallBitVector. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92730 91177308-0d34-0410-b5e6-96231b3b80d8
* Silence compiler warning.Benjamin Kramer2009-12-31
| | | | | | | warning: comparison between signed and unsigned integer expressions git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92359 91177308-0d34-0410-b5e6-96231b3b80d8
* Document the edit-distance algorithm used in StringRef, switch it overDouglas Gregor2009-12-31
| | | | | | | to SmallVector, and add a unit test. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92340 91177308-0d34-0410-b5e6-96231b3b80d8
* don't unittest mdnode printing, we have disassembler tests for this.Chris Lattner2009-12-31
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92328 91177308-0d34-0410-b5e6-96231b3b80d8
* rename "elements" of metadata to "operands". "Elements" areChris Lattner2009-12-31
| | | | | | | | things that occur in types. "operands" are things that occur in values. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92322 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement support for converting to string at "natural precision", and fix someJohn McCall2009-12-24
| | | | | | | | major bugs in long-precision conversion. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92150 91177308-0d34-0410-b5e6-96231b3b80d8
* Move the two definitions of operator<< into namespace llvm, so theyDouglas Gregor2009-12-24
| | | | | | | | will be found by argument-dependent lookup. As with the previous commit, GCC is allowing ill-formed code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92146 91177308-0d34-0410-b5e6-96231b3b80d8
* Define the new operator<< for sets into namespace std, so thatDouglas Gregor2009-12-24
| | | | | | | | | argument-dependent lookup can find it. This is another case where an LLVM bug (not making operator<< visible) was masked by a GCC bug (looking in the global namespace when it shouldn't). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92144 91177308-0d34-0410-b5e6-96231b3b80d8
* Add accessors for the largest-magnitude, smallest-magnitude, andJohn McCall2009-12-24
| | | | | | | | | | smallest-normalized-magnitude values in a given FP semantics. Provide an APFloat-to-string conversion which I am quite ready to admit could be much more efficient. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92126 91177308-0d34-0410-b5e6-96231b3b80d8
* Disable JITTest.FunctionIsRecompiledAndRelinked on ARM where it's notJeffrey Yasskin2009-12-23
| | | | | | | implemented. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91963 91177308-0d34-0410-b5e6-96231b3b80d8
* Partially revert r91626. Materializing extra functions to determine whetherJeffrey Yasskin2009-12-22
| | | | | | | | | | | | they're available_externally broke VMKit, which was relying on the fact that functions would only be materialized when they were first called. We'll have to wait for http://llvm.org/PR5737 to really fix this. I also added a test for one of the F->isDeclaration() calls which wasn't covered by anything else in the test suite. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91943 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a crash in JIT::recompileAndRelinkFunction(). It doesn't pass the MCIJeffrey Yasskin2009-12-22
| | | | | | | | | | argument to runJITOnFunction(), which caused a null pointer dereference at every call. Patch by Gianluca Guida! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91939 91177308-0d34-0410-b5e6-96231b3b80d8
* Change StringRef::startswith and StringRef::endswith to versions which are aEli Friedman2009-12-21
| | | | | | | | bit more verbose, but optimize to much shorter code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91817 91177308-0d34-0410-b5e6-96231b3b80d8
* Catch more cases of a pointer being marked garbage twice. This helps whenRafael Espindola2009-12-18
| | | | | | | | debugging some leaks (PR5770 in particular). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91713 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't codegen available_externally functions. Fixes http://llvm.org/PR5735.Jeffrey Yasskin2009-12-17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91626 91177308-0d34-0410-b5e6-96231b3b80d8
* This fixes a memory leak in OpaqueType found by Google's internal heapchecker.Jeffrey Yasskin2009-12-17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91611 91177308-0d34-0410-b5e6-96231b3b80d8
* Reinstate r91208 to fix available_externally linkage for globals, withJeffrey Yasskin2009-12-13
| | | | | | | | nlewycky's fix to add -rdynamic so the JIT can look symbols up in Linux builds of the JITTests binary. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91250 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r91208. Something on Linux prevents the JIT from looking up a symbolJeffrey Yasskin2009-12-12
| | | | | | | defined in the test, and I don't have time tonight to figure it out. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91209 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix available_externally linkage for globals. It's probably still notJeffrey Yasskin2009-12-12
| | | | | | | supported by emitGlobals, but I don't have a test case for that. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91208 91177308-0d34-0410-b5e6-96231b3b80d8
* Add an implementation of the delta debugging algorithm.Daniel Dunbar2009-12-03
| | | | | | | - This is a pretty slow / memory intensive implementation, and I will likely change it to an iterative model, but it works. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90447 91177308-0d34-0410-b5e6-96231b3b80d8
* Oops. Re-disable JITTest.NoStubs on ARM and PPC since they still use stubs toJeffrey Yasskin2009-11-24
| | | | | | | make far calls work. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89733 91177308-0d34-0410-b5e6-96231b3b80d8
* * Move stub allocation inside the JITEmitter, instead of exposing aJeffrey Yasskin2009-11-23
| | | | | | | | | | | | | | | | way for each TargetJITInfo subclass to allocate its own stubs. This means stubs aren't as exactly-sized anymore, but it lets us get rid of TargetJITInfo::emitFunctionStubAtAddr(), which lets ARM and PPC support the eager JIT, fixing http://llvm.org/PR4816. * Rename the JITEmitter's stub creation functions to describe the kind of stub they create. So far, all of them create lazy-compilation stubs, but they sometimes get used when far-call stubs are needed. Fixing http://llvm.org/PR5201 will involve fixing this. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89715 91177308-0d34-0410-b5e6-96231b3b80d8
* Only run this mutex test if threading is enabled. ThisDuncan Sands2009-11-19
| | | | | | | fixes PR5395. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89385 91177308-0d34-0410-b5e6-96231b3b80d8
* Reenable Split2 StringRef test with Apple gcc.Benjamin Kramer2009-11-19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89357 91177308-0d34-0410-b5e6-96231b3b80d8
* "XFAIL" the Split2 StringReft test with Apple gcc, which miscompiles it.Daniel Dunbar2009-11-17
| | | | | | | - I plan on fixing/workarounding this, but until then I'd like the bots to stay green. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89077 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert the test from r88984. It relies on being able to mmap 16GB ofJeffrey Yasskin2009-11-16
| | | | | | | | | | | | address space (though it only uses a small fraction of that), and the buildbots disallow that. Also add a comment to the Makefile's ulimit line warning future developers that changing it won't work. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@88994 91177308-0d34-0410-b5e6-96231b3b80d8
* Make X86-64 in the Large model always emit 64-bit calls.Jeffrey Yasskin2009-11-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The large code model is documented at http://www.x86-64.org/documentation/abi.pdf and says that calls should assume their target doesn't live within the 32-bit pc-relative offset that fits in the call instruction. To do this, we turn off the global-address->target-global-address conversion in X86TargetLowering::LowerCall(). The first attempt at this broke the lazy JIT because it can separate the movabs(imm->reg) from the actual call instruction. The lazy JIT receives the address of the movabs as a relocation and needs to record the return address from the call; and then when that call happens, it needs to patch the movabs with the newly-compiled target. We could thread the call instruction into the relocation and record the movabs<->call mapping explicitly, but that seems to require at least as much new complication in the code generator as this change. To fix this, we make lazy functions _always_ go through a call stub. You'd think we'd only have to force lazy calls through a stub on difficult platforms, but that turns out to break indirect calls through a function pointer. The right fix for that is to distinguish between calls and address-of operations on uncompiled functions, but that's complex enough to leave for someone else to do. Another attempt at this defined a new CALL64i pseudo-instruction, which expanded to a 2-instruction sequence in the assembly output and was special-cased in the X86CodeEmitter's emitInstruction() function. That broke indirect calls in the same way as above. This patch also removes a hack forcing Darwin to the small code model. Without far-call-stubs, the small code model requires things of the JITMemoryManager that the DefaultJITMemoryManager can't provide. Thanks to echristo for lots of testing! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@88984 91177308-0d34-0410-b5e6-96231b3b80d8
* This test doesn't work on arm either.Benjamin Kramer2009-11-14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@88794 91177308-0d34-0410-b5e6-96231b3b80d8
* Disable the JITTest.NoStubs test for Darwin PPC. It apparently doesn't implementBill Wendling2009-11-13
| | | | | | | emitFunctionStubAtAddr. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@88708 91177308-0d34-0410-b5e6-96231b3b80d8
* Distinguish "a," from "a". The first one splits into "a" + "" and the second ↵Rafael Espindola2009-11-13
| | | | | | | | | one into "a" + 0. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@87084 91177308-0d34-0410-b5e6-96231b3b80d8
* Switch to smallvector. Also fix issue with using unsigend for MaxSplit.Rafael Espindola2009-11-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@87068 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a new split method to StringRef that puts the substrings in a vector.Rafael Espindola2009-11-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@87058 91177308-0d34-0410-b5e6-96231b3b80d8
* Use stubs when we have them, otherwise use code we already have,Eric Christopher2009-11-12
| | | | | | | | | otherwise create a stub. Add a test to make sure we don't create extraneous stubs. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86941 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix JITTest.ModuleDeletion in -Asserts mode (which turns off JITEmitDebugInfoJeffrey Yasskin2009-11-11
| | | | | | | by default). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86807 91177308-0d34-0410-b5e6-96231b3b80d8
* Add From arguments to StringRef search functions, and tweak doxyments.Daniel Dunbar2009-11-11
| | | | | | Also, add unittests for find_first_of and find_first_not_of. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86770 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix DenseMap iterator constness.Jeffrey Yasskin2009-11-10
| | | | | | | | | | | | | | | | | | | | This patch forbids implicit conversion of DenseMap::const_iterator to DenseMap::iterator which was possible because DenseMapIterator inherited (publicly) from DenseMapConstIterator. Conversion the other way around is now allowed as one may expect. The template DenseMapConstIterator is removed and the template parameter IsConst which specifies whether the iterator is constant is added to DenseMapIterator. Actually IsConst parameter is not necessary since the constness can be determined from KeyT but this is not relevant to the fix and can be addressed later. Patch by Victor Zverovich! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86636 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove dlsym stubs, with Nate Begeman's permission.Jeffrey Yasskin2009-11-09
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86606 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix the ModuleDeletion test on PPC and ARM.Jeffrey Yasskin2009-10-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85352 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert the API changes from r85295 to make it easier for people to buildJeffrey Yasskin2009-10-27
| | | | | | | against both 2.6 and HEAD. The default is still changed to eager jitting. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85330 91177308-0d34-0410-b5e6-96231b3b80d8
* Factor out redundancy from clone() implementations.Devang Patel2009-10-27
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85327 91177308-0d34-0410-b5e6-96231b3b80d8
* Change the JIT to compile eagerly by default as agreed inJeffrey Yasskin2009-10-27
| | | | | | | | http://llvm.org/PR5184, and beef up the comments to describe what both options do and the risks of lazy compilation in the presence of threads. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85295 91177308-0d34-0410-b5e6-96231b3b80d8
* Type.h doesn't need to #include LLVMContext.hChris Lattner2009-10-27
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85254 91177308-0d34-0410-b5e6-96231b3b80d8
* Automatically do the equivalent of freeMachineCodeForFunction(F) when F isJeffrey Yasskin2009-10-27
| | | | | | | | | | | | | | being destroyed. This allows users to run global optimizations like globaldce even after some functions have been jitted. This patch also removes the Function* parameter to JITEventListener::NotifyFreeingMachineCode() since it can cause that to be called when the Function is partially destroyed. This change will be even more helpful later when I think we'll want to allow machine code to actually outlive its Function. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85182 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove / use flags that are now set in the Makefile.config.Julien Lerouge2009-10-26
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85149 91177308-0d34-0410-b5e6-96231b3b80d8
* Move DataTypes.h to include/llvm/System, update all users. This breaks the lastChandler Carruth2009-10-26
| | | | | | | direct inclusion edge from System to Support. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85086 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix http://llvm.org/PR4822: allow module deletion after a function has beenJeffrey Yasskin2009-10-23
| | | | | | | | | | | | | | | compiled. When functions are compiled, they accumulate references in the JITResolver's stub maps. This patch removes those references when the functions are destroyed. It's illegal to destroy a Function when any thread may still try to call its machine code. This patch also updates r83987 to use ValueMap instead of explicit CallbackVHs and fixes a couple "do stuff inside assert()" bugs from r84522. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84975 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix stylistic and documentation problems in ValueMap found by Nick Lewycky andJeffrey Yasskin2009-10-23
| | | | | | | Evan Cheng. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84967 91177308-0d34-0410-b5e6-96231b3b80d8