summaryrefslogtreecommitdiff
path: root/unittests
Commit message (Collapse)AuthorAge
...
* Fix MCDataAtom never calling remap when adding data.Rafael Espindola2013-10-16
| | | | | | | | | | | | | | | | This patch fixes a small mistake in MCDataAtom::addData() where it doesn't ever call remap(): - if (Data.size() > Begin - End - 1) + if (Data.size() > End + 1 - Begin) remap(Begin, End + 1); This is currently not visible because of another bug is the disassembler, so the patch includes a unit test. Patch by Stephen Checkoway. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192823 91177308-0d34-0410-b5e6-96231b3b80d8
* Assert on duplicate registration. Don't depend on function pointer equality.Rafael Espindola2013-10-16
| | | | | | | | | | | | | | | | | | | | Before this patch we would assert when building llvm as multiple shared libraries (cmake's BUILD_SHARED_LIBS). The problem was the line if (T.AsmStreamerCtorFn == Target::createDefaultAsmStreamer) which returns false because of -fvisibility-inlines-hidden. It is easy to fix just this one case, but I decided to try to also make the registration more strict. It looks like the old logic for ignoring followup registration was just a temporary hack that outlived its usefulness. This patch converts the ifs to asserts, fixes the few cases that were registering twice and makes sure all the asserts compare with null. Thanks for Joerg for reporting the problem and reviewing the patch. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192803 91177308-0d34-0410-b5e6-96231b3b80d8
* Use ASSERT_EQ rather than ASSERT_TRUE for better unit test failures.David Blaikie2013-10-15
| | | | | | | Also minor using namespace move so it's not hard-up against the function definition and outside the namespace as is usual. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192744 91177308-0d34-0410-b5e6-96231b3b80d8
* Silencing an MSVC warning.Aaron Ballman2013-10-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192042 91177308-0d34-0410-b5e6-96231b3b80d8
* MCJIT: skip some more new multi-module tests on unsupported platforms.Tim Northover2013-10-02
| | | | | | This should fix the i386 Darwin build-bot. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191840 91177308-0d34-0410-b5e6-96231b3b80d8
* This threads SectionName through the allocateCodeSection/allocateDataSection ↵Filip Pizlo2013-10-02
| | | | | | | | | | | | | | | | | | | | APIs, both in C++ and C land. It's useful for the memory managers that are allocating a section to know what the name of the section is. At a minimum, this is useful for low-level debugging - it's customary for JITs to be able to tell you what memory they allocated, and as part of any such dump, they should be able to tell you some meta-data about what each allocation is for. This allows clients that supply their own memory managers to do this. Additionally, we also envision the SectionName being useful for passing meta-data from within LLVM to an LLVM client. This changes both the C and C++ APIs, and all of the clients of those APIs within LLVM. I'm assuming that it's safe to change the C++ API because that API is allowed to change. I'm assuming that it's safe to change the C API because we haven't shipped the API in a release yet (LLVM 3.3 doesn't include the MCJIT memory management C API). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191804 91177308-0d34-0410-b5e6-96231b3b80d8
* Add non-blocking Wait() for launched processesTareq A. Siraj2013-10-01
| | | | | | | | | | | | | | | | | | - New ProcessInfo class to encapsulate information about child processes. - Generalized the Wait() to support non-blocking wait on child processes. - ExecuteNoWait() now returns a ProcessInfo object with information about the launched child. Users will be able to use this object to perform non-blocking wait. - ExecuteNoWait() now accepts an ExecutionFailed param that tells if execution failed or not. These changes will allow users to implement basic process parallel tools. Differential Revision: http://llvm-reviews.chandlerc.com/D1728 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191763 91177308-0d34-0410-b5e6-96231b3b80d8
* Tests for MCJIT multiple module supportAndrew Kaylor2013-10-01
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191723 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix getOrInsertGlobal dropping the address space.Matt Arsenault2013-09-30
| | | | | | | | Currently it will insert an illegal bitcast. Arguably, the address space argument should be added for the creation case. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191702 91177308-0d34-0410-b5e6-96231b3b80d8
* IRBuilder: Add RAII objects to reset insertion points or fast math flags.Benjamin Kramer2013-09-30
| | | | | | | | Inspired by the object from the SLPVectorizer. This found a minor bug in the debug loc restoration in the vectorizer where the location of a following instruction was attached instead of the location from the original instruction. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191673 91177308-0d34-0410-b5e6-96231b3b80d8
* Plug a memory leak in a unit test. Stack allocation is sufficient here.Benjamin Kramer2013-09-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191638 91177308-0d34-0410-b5e6-96231b3b80d8
* SourceMgr diagnotics printing: fix a bug where printing a fixit for a sourceDmitri Gribenko2013-09-27
| | | | | | | | range that includes a tab character will cause out-of-bounds access to the fixit string. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191563 91177308-0d34-0410-b5e6-96231b3b80d8
* Make SourceMgr::PrintMessage() testable and add unit testsDmitri Gribenko2013-09-27
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191558 91177308-0d34-0410-b5e6-96231b3b80d8
* Fixed typo in CreateProcessTrailingSlash testTareq A. Siraj2013-09-20
| | | | | | | | | --gtest_filter was filtering an invalid name for the test. Differential Revision: http://llvm-reviews.chandlerc.com/D1733 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191100 91177308-0d34-0410-b5e6-96231b3b80d8
* Re-submit r190469: YAMLIO: Fix string quoting logic.Rui Ueyama2013-09-11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190485 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "YAMLIO: Fix string quoting logic." (r190469)Hans Wennborg2013-09-11
| | | | | | It was turning the buildbots red. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190480 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove trailing whitespaceRui Ueyama2013-09-11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190472 91177308-0d34-0410-b5e6-96231b3b80d8
* YAMLIO: Fix string quoting logic.Rui Ueyama2013-09-11
| | | | | | | | YAMLIO printed a string as is without quotes unless it contains a newline character. That did not suffice. We also need to quote a string if it starts with a backquote, quote, double quote or atsign, or it's the empty string. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190469 91177308-0d34-0410-b5e6-96231b3b80d8
* Try to unbreak mingw32 buildbot.Rui Ueyama2013-09-10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190438 91177308-0d34-0410-b5e6-96231b3b80d8
* Add getenv() wrapper that works on multibyte environment variable.Rui Ueyama2013-09-10
| | | | | | | | | | | | | | | | | | On Windows, character encoding of multibyte environment variable varies depending on settings. The only reliable way to handle it I think is to use GetEnvironmentVariableW(). GetEnvironmentVariableW() works on wchar_t string, which is on Windows UTF16 string. That's not ideal because we use UTF-8 as the internal encoding in LLVM. This patch defines a wrapper function which takes and returns UTF-8 string for GetEnvironmentVariableW(). The wrapper function does not do any conversion and just forwards the argument to getenv() on Unix. Differential Revision: http://llvm-reviews.chandlerc.com/D1612 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190423 91177308-0d34-0410-b5e6-96231b3b80d8
* Update CMake file to fix buildbots.Bob Wilson2013-09-09
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190331 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert patches to add case-range support for PR1255.Bob Wilson2013-09-09
| | | | | | | | | | | | | | | | | The work on this project was left in an unfinished and inconsistent state. Hopefully someone will eventually get a chance to implement this feature, but in the meantime, it is better to put things back the way the were. I have left support in the bitcode reader to handle the case-range bitcode format, so that we do not lose bitcode compatibility with the llvm 3.3 release. This reverts the following commits: 155464, 156374, 156377, 156613, 156704, 156757, 156804 156808, 156985, 157046, 157112, 157183, 157315, 157384, 157575, 157576, 157586, 157612, 157810, 157814, 157815, 157880, 157881, 157882, 157884, 157887, 157901, 158979, 157987, 157989, 158986, 158997, 159076, 159101, 159100, 159200, 159201, 159207, 159527, 159532, 159540, 159583, 159618, 159658, 159659, 159660, 159661, 159703, 159704, 160076, 167356, 172025, 186736 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190328 91177308-0d34-0410-b5e6-96231b3b80d8
* MemoryBufer: add a test: check that a file with size that is a multiple of theDmitri Gribenko2013-09-04
| | | | | | | page size can be null terminated correctly by MemoryBuffer. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189965 91177308-0d34-0410-b5e6-96231b3b80d8
* Move generic isPrint and columnWidth implementations to a separate ↵Alexander Kornienko2013-09-04
| | | | | | | | | | | | | | | | | | | | | header/source to allow using both generic and system-dependent versions on win32. Summary: This is needed so we can use generic columnWidthUTF8 in clang-format on win32 simultaneously with a separate system-dependent implementations of isPrint/columnWidth in TextDiagnostic.cpp to avoid attempts to print Unicode characters using narrow-character interfaces (which is not supported on Windows, and we'll have to figure out how to handle this). Reviewers: jordan_rose Reviewed By: jordan_rose CC: llvm-commits, klimek Differential Revision: http://llvm-reviews.chandlerc.com/D1559 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189952 91177308-0d34-0410-b5e6-96231b3b80d8
* It's a very large constant. Say so.Eric Christopher2013-09-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189899 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix copy and pasto with CMake files for unittest.Eric Christopher2013-09-03
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189863 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a hashing routine that handles hashing types. Add a test forEric Christopher2013-09-03
| | | | | | hashing the contents of DW_FORM_data1 on top of a type with attributes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189862 91177308-0d34-0410-b5e6-96231b3b80d8
* Alphabetize.Eric Christopher2013-09-03
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189848 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a Python-like join function to merge a list of strings with aJoerg Sonnenberger2013-09-03
| | | | | | | separator between each two elements. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189846 91177308-0d34-0410-b5e6-96231b3b80d8
* Change default # of digits for APFloat::toStringEli Friedman2013-08-29
| | | | | | | | | | | | | | | | | This is a re-commit of r189442; I'll follow up with clang changes. The previous default was almost, but not quite enough digits to represent a floating-point value in a manner which preserves the representation when it's read back in. The larger default is much less confusing. I spent some time looking into printing exactly the right number of digits if a precision isn't specified, but it's kind of complicated, and I'm not really sure I understand what APFloat::toString is supposed to output for FormatPrecision != 0 (or maybe the current API specification is just silly, not sure which). I have a WIP patch if anyone is interested. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189624 91177308-0d34-0410-b5e6-96231b3b80d8
* Option parsing: support case-insensitive option matching.Rui Ueyama2013-08-28
| | | | | | Re-submitting r189416 with fix for Windows build on where strcasecmp is not defined. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189501 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r189442 "Change default # of digits for APFloat::toString"Ted Kremenek2013-08-28
| | | | | | This is breaking numerous Clang tests on the buildbot. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189447 91177308-0d34-0410-b5e6-96231b3b80d8
* Change default # of digits for APFloat::toStringEli Friedman2013-08-28
| | | | | | | | | | | | | | | The previous default was almost, but not quite enough digits to represent a floating-point value in a manner which preserves the representation when it's read back in. The larger default is much less confusing. I spent some time looking into printing exactly the right number of digits if a precision isn't specified, but it's kind of complicated, and I'm not really sure I understand what APFloat::toString is supposed to output for FormatPrecision != 0 (or maybe the current API specification is just silly, not sure which). I have a WIP patch if anyone is interested. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189442 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "Option parsing: support case-insensitive option matching." as it ↵Rui Ueyama2013-08-28
| | | | | | | | broke Windows buildbot. This reverts r189416. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189424 91177308-0d34-0410-b5e6-96231b3b80d8
* Option parsing: support case-insensitive option matching.Rui Ueyama2013-08-27
| | | | | | | | | | | | | | Link.exe's command line options are case-insensitive. This patch adds a new attribute to OptTable to let the option parser to compare options, ignoring case. Command lines are generally case-insensitive on Windows. CL.exe is an exception. So this new attribute should be useful for other commands running on Windows. Differential Revision: http://llvm-reviews.chandlerc.com/D1485 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189416 91177308-0d34-0410-b5e6-96231b3b80d8
* [Win32] mapped_file_region: Fix a bug in CreateFileMapping() that Size must ↵NAKAMURA Takumi2013-08-22
| | | | | | contain Offset when Offset >= 65536. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189021 91177308-0d34-0410-b5e6-96231b3b80d8
* Whitespace.NAKAMURA Takumi2013-08-22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189020 91177308-0d34-0410-b5e6-96231b3b80d8
* Suppress MemoryBufferTest.cpp on win32 for now. Investigating.NAKAMURA Takumi2013-08-22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189001 91177308-0d34-0410-b5e6-96231b3b80d8
* MemoryBufferTest.cpp: Tweak offset corresponding to the case that PageSize ↵NAKAMURA Takumi2013-08-22
| | | | | | | | is greater than 8000. PageSize, aka AllocationGranularity, is 65536 on Win32 (and Cygwin). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188999 91177308-0d34-0410-b5e6-96231b3b80d8
* Basic unit tests for PointerUnionDavid Blaikie2013-08-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188933 91177308-0d34-0410-b5e6-96231b3b80d8
* Introduce SpecialCaseList::isIn overload for GlobalAliases.Peter Collingbourne2013-08-19
| | | | | | Differential Revision: http://llvm-reviews.chandlerc.com/D1437 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188688 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove SpecialCaseList::findCategory.Peter Collingbourne2013-08-19
| | | | | | It turned out that I didn't need this for DFSan. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188646 91177308-0d34-0410-b5e6-96231b3b80d8
* Removing a spurious semi-colon; this macro expands into a namespace.Aaron Ballman2013-08-16
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188525 91177308-0d34-0410-b5e6-96231b3b80d8
* Tighten up the yamilizer so it stops eliding empty sequences if the embedded ↵Aaron Ballman2013-08-15
| | | | | | | | empty sequence is the first key/value in a map which is itself in a sequence. Patch with help from Nick Kledzik. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188508 91177308-0d34-0410-b5e6-96231b3b80d8
* Expose CRC-32 implementation from zlibAlexey Samsonov2013-08-14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188380 91177308-0d34-0410-b5e6-96231b3b80d8
* Options: explicit handling of --Hans Wennborg2013-08-13
| | | | | | | | | | | Clients of the option parsing library should handle it explicitly using a KIND_REMAINING_ARGS option. Clang and lld have been updated in r188316 and r188318, respectively. Also fix -Wsign-compare warning in the option parsing test. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188323 91177308-0d34-0410-b5e6-96231b3b80d8
* Options: Add new option kind that consumes remaining argumentsHans Wennborg2013-08-13
| | | | | | | | | | | | | | | | This adds KIND_REMAINING_ARGS, a class of options that consume all remaining arguments on the command line. This will be used to support /link in clang-cl, which is used to forward all remaining arguments to the linker. It also allows us to remove the hard-coded handling of "--", allowing clients (clang and lld) to implement that functionality themselves with this new option class. Differential Revision: http://llvm-reviews.chandlerc.com/D1387 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188314 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix an oversight in isPotentiallyReachable where we wouldn't do any CFG-walkingNick Lewycky2013-08-13
| | | | | | | | | | | | | to find loops if the From and To instructions were in the same block. Refactor the code a little now that we need to fill to start the CFG-walking algorithm with more than one starting basic block sometimes. Special thanks to Andrew Trick for catching an error in my understanding of natural loops in code review. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188236 91177308-0d34-0410-b5e6-96231b3b80d8
* Fixes a bug when iterating on pathsTareq A. Siraj2013-08-12
| | | | | | | | | | This fixes the incorrect implementation of iterating on file/directory paths. Differential Review: http://llvm-reviews.chandlerc.com/D1277 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188183 91177308-0d34-0410-b5e6-96231b3b80d8
* Relax conditions of test added in r188156 to fix it on WindowsAlexey Samsonov2013-08-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188157 91177308-0d34-0410-b5e6-96231b3b80d8