1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 19:12:56 +02:00
Commit Graph

92 Commits

Author SHA1 Message Date
Vlad Tsyrklevich
d0a2c19b62 Reland 'Classify llvm-cfi-verify.'
Summary: Move llvm-cfi-verify into a class in preparation for CFI analysis to come.

Reviewers: vlad.tsyrklevich

Reviewed By: vlad.tsyrklevich

Subscribers: mgorny, llvm-commits, pcc, kcc

Differential Revision: https://reviews.llvm.org/D38379

llvm-svn: 315504
2017-10-11 20:35:01 +00:00
Vlad Tsyrklevich
79b810fb12 Revert "Classify llvm-cfi-verify."
This reverts commit r315363. It has a simple build failure, but more
importantly I want to confirm that unit tests run in check-all to make
sure that they don't silently break in the future.

llvm-svn: 315370
2017-10-10 21:21:13 +00:00
Vlad Tsyrklevich
ffef765e1f Classify llvm-cfi-verify.
Summary: Move llvm-cfi-verify into a class in preparation for CFI analysis to come.

Reviewers: vlad.tsyrklevich

Reviewed By: vlad.tsyrklevich

Subscribers: mgorny, llvm-commits, pcc, kcc

Differential Revision: https://reviews.llvm.org/D38379

llvm-svn: 315363
2017-10-10 20:59:08 +00:00
Justin Bogner
c5917e5476 Re-apply "Introduce FuzzMutate library"
Same as r311392 with some fixes for library dependencies. Thanks to
Chapuni for helping work those out!

Original commit message:

This introduces the FuzzMutate library, which provides structured
fuzzing for LLVM IR, as described in my EuroLLVM 2017 talk. Most of
the basic mutators to inject and delete IR are provided, with support
for most basic operations.

llvm-svn: 311402
2017-08-21 22:57:06 +00:00
Justin Bogner
f20e6862f6 Revert "Re-apply "Introduce FuzzMutate library""
The dependencies for the new library seem to be misconfigured on some
linux configs:

  http://bb.pgr.jp/builders/llvm-i686-linux-RA/builds/5435/steps/build_all/logs/stdio

This reverts r311392.

llvm-svn: 311393
2017-08-21 22:28:47 +00:00
Justin Bogner
4ecbed71c1 Re-apply "Introduce FuzzMutate library"
Redo r311356 with a fix to avoid std::uniform_int_distribution<bool>.
The bool specialization is undefined according to the standard, even
though libc++ seems to have it.

Original commit message:

This introduces the FuzzMutate library, which provides structured
fuzzing for LLVM IR, as described in my [EuroLLVM 2017 talk][1]. Most
of the basic mutators to inject and delete IR are provided, with
support for most basic operations.

llvm-svn: 311392
2017-08-21 22:25:04 +00:00
Justin Bogner
f2d13596d0 Revert "Introduce FuzzMutate library"
Looks like this fails to build with libstdc++.

This reverts r311356

llvm-svn: 311358
2017-08-21 17:57:12 +00:00
Justin Bogner
480fdf7d03 Introduce FuzzMutate library
This introduces the FuzzMutate library, which provides structured
fuzzing for LLVM IR, as described in my [EuroLLVM 2017 talk][1]. Most
of the basic mutators to inject and delete IR are provided, with
support for most basic operations.

I will follow up with the instruction selection fuzzer, which is
implemented in terms of this library.

[1]: http://llvm.org/devmtg/2017-03//2017/02/20/accepted-sessions.html#2

llvm-svn: 311356
2017-08-21 17:44:36 +00:00
Zachary Turner
c5632126fc Move Object format code to lib/BinaryFormat.
This creates a new library called BinaryFormat that has all of
the headers from llvm/Support containing structure and layout
definitions for various types of binary formats like dwarf, coff,
elf, etc as well as the code for identifying a file from its
magic.

Differential Revision: https://reviews.llvm.org/D33843

llvm-svn: 304864
2017-06-07 03:48:56 +00:00
Dean Michael Berris
cc37553db4 [XRay] A graph Class for the llvm-xray graph
Summary:
In preparation for graph comparison and filtering, this is a library for
representing graphs in LLVM. This will enable easier encapsulation and reuse
of graphs in llvm-xray.

Depends on D28999, D28225

Reviewers: dblaikie, dberris

Reviewed By: dberris

Subscribers: mgorny, llvm-commits

Differential Revision: https://reviews.llvm.org/D29005

llvm-svn: 294717
2017-02-10 06:36:08 +00:00
Dean Michael Berris
dd1f0a3f3a Revert "[XRay] A graph Class for the llvm-xray graph"
Broke tests, reverting.

llvm-svn: 294714
2017-02-10 06:05:46 +00:00
Dean Michael Berris
cadcaaab9b [XRay] A graph Class for the llvm-xray graph
Summary:
In preparation for graph comparison and filtering, this is a library for
representing graphs in LLVM. This will enable easier encapsulation and reuse
of graphs in llvm-xray.

Depends on D28999, D28225

Reviewers: dblaikie, dberris

Reviewed By: dberris

Subscribers: mgorny, llvm-commits

Differential Revision: https://reviews.llvm.org/D29005

llvm-svn: 294713
2017-02-10 05:40:37 +00:00
Chandler Carruth
8ae77dbc0f [gtest] Fix the way we disable a warning for unittests.
I somehow wrote this fix and then lost it prior to commit. Really sorry
about the noise. This should fix some issues with hacking add_definition
to do things with warning flags.

llvm-svn: 291033
2017-01-04 23:40:06 +00:00
Chandler Carruth
43eb155cf2 [gtest] Upgrade googletest to version 1.8.0, minimizing local changes.
This required re-working the streaming support and lit's support for
'--gtest_list_tests' but otherwise seems to be a clean upgrade.

Differential Revision: https://reviews.llvm.org/D28154

llvm-svn: 291029
2017-01-04 23:06:03 +00:00
Kuba Brecka
763ff400ea Fix llvm-symbolizer to correctly sort a symbol array and calculate symbol sizes
Sometimes, llvm-symbolizer gives wrong results due to incorrect sizes of some symbols. The reason for that was an incorrectly sorted array in computeSymbolSizes. The comparison function used subtraction of unsigned types, which is incorrect. Let's change this to return explicit -1 or 1.

Differential Revision: https://reviews.llvm.org/D26537

llvm-svn: 287028
2016-11-15 21:07:03 +00:00
Jonas Hahnfeld
c9c3a6dfea [CMake] Disable rpath for UnitTests
This was broken since rL285714.

Differential Revision: https://reviews.llvm.org/D26246

llvm-svn: 285881
2016-11-03 06:58:16 +00:00
Diana Picus
2f31822cdb Add AArch64 unit tests
Add unit tests for checking a few tricky instruction sizes. Also remove the old
tests for the instruction sizes, which were clunky and brittle.

Since this is the first set of target-specific unit tests, we need to add some
CMake plumbing. In the future, adding unit tests for a given target will be as
simple as creating a directory with the same name as the target under
unittests/Target. The tests are only run if the target is enabled in
LLVM_TARGETS_TO_BUILD.

Differential Revision: https://reviews.llvm.org/D24548

llvm-svn: 283990
2016-10-12 09:00:44 +00:00
Diana Picus
6ffe0abe96 [CMake] Use CMake's default RPATH for the unit tests
In the top-level CMakeLists.txt, we set CMAKE_BUILD_WITH_INSTALL_RPATH to ON,
and then for the unit tests we set it to <test>/../../lib. This works for tests
that live in unittest/<whatever>, but not for those that live in subdirectories
e.g. unittest/Transforms/IPO or unittest/ExecutionEngine/Orc. When building
with BUILD_SHARED_LIBRARIES, such tests don't manage to find their libraries.

Since the tests are run from the build directory, it makes sense to set their
RPATH for the build tree, rather than the install tree. This is the default in
CMake since 2.6, so all we have to do is set CMAKE_BUILD_WITH_INSTALL_RPATH to
OFF for the unit tests.

llvm-svn: 280791
2016-09-07 08:37:15 +00:00
Rafael Espindola
12fd371a27 Move ObjectYAML code to a new library.
It is only ever used by obj2yaml and yaml2obj. No point in linking it
everywhere.

llvm-svn: 262368
2016-03-01 19:15:06 +00:00
NAKAMURA Takumi
509933800e Make a stub version of MITests, instead of reverting.
Lit tends to find out-of-date unittests in the build tree.

FIXME: It may be reverted several days after.
llvm-svn: 261194
2016-02-18 07:37:17 +00:00
Matthias Braun
3109aeee9b Revert "LiveIntervalAnalysis: Remove LiveVariables requirement" and LiveIntervalTest
The commit breaks stage2 compilation on PowerPC. Reverting for now while
this is analyzed. I also have to revert the LiveIntervalTest for now as
that depends on this commit.

Revert "LiveIntervalAnalysis: Remove LiveVariables requirement"
This reverts commit r260806.
Revert "Remove an unnecessary std::move to fix -Wpessimizing-move warning."
This reverts commit r260931.
Revert "Fix typo in LiveIntervalTest"
This reverts commit r260907.
Revert "Add unittest for LiveIntervalAnalysis::handleMove()"
This reverts commit r260905.

llvm-svn: 261189
2016-02-18 05:21:43 +00:00
Matthias Braun
45a7406c5e Add unittest for LiveIntervalAnalysis::handleMove()
llvm-svn: 260905
2016-02-15 19:25:34 +00:00
Alex Lorenz
65e82992a2 AsmParser: Require a terminating null character when creating memory buffer.
This commit modifies the memory buffer creation in the AsmParser library so 
that it requires a terminating null character. The LLLexer in the AsmParser
library checks for EOF only when it sees a null character, thus it would
be best to require it when creating a memory buffer so that the memory
buffer constructor can verify that a terminating null character is indeed
present.

Reviewers: Duncan P. N. Exon Smith, Matthias Braun

Differential Revision: http://reviews.llvm.org/D9883

llvm-svn: 237833
2015-05-20 20:41:27 +00:00
Justin Bogner
ce308f54ec InstrProf: Add some unit tests for CoverageMapping
The llvm-level tests for coverage mapping need a binary input file,
which means they're hard to understand, hard to update, and it's
difficult to add new ones. By adding some unit tests that build up the
coverage data structures in C++, we can write more meaningful and
targeted tests.

llvm-svn: 228084
2015-02-04 00:15:12 +00:00
Chandler Carruth
7d048853b7 [cmake] Start making LLVM_LIBDIR_SUFFIX effective by adding it to
*numerous* places where it was missing in the CMake build. The primary
change here is that the suffix is now actually used for all of the lib
directories in the LLVM project's CMake. The various subprojects still
need similar treatment.

This is the first of a series of commits to try to make LLVM's cmake
effective in a multilib Linux installation. I don't think many people
are seriously using this variable so I'm hoping the fallout will be
minimal. A somewhat unfortunate consequence of the nature of these
commits is that until I land all of them, they will in part make the
brokenness of our multilib support more apparant. At the end, things
should actually work.

llvm-svn: 224919
2014-12-29 11:16:19 +00:00
Rafael Espindola
90be969cdb Invert the MC -> Object dependency.
Now that we have a lib/MC/MCAnalysis, the dependency was there just because
of two helper classes. Move the two over to MC.

This will allow IRObjectFile to parse inline assembly.

llvm-svn: 212248
2014-07-03 02:01:39 +00:00
NAKAMURA Takumi
3f665c3db5 [CMake] Enable llvm/unittests/LinkerTests. It had not been enabled since r199354.
llvm-svn: 207536
2014-04-29 15:52:36 +00:00
Rafael Espindola
ee6be2e1d1 Correctly set rpath for unittests.
This lets us run the unittest from the command line without setting
LD_LIBRARY_PATH.

llvm-svn: 202509
2014-02-28 16:11:03 +00:00
Peter Collingbourne
80068b8c2c Introduce line editor library.
This library will be used by clang-query. I can imagine LLDB becoming another
client of this library, so I think LLVM is a sensible place for it to live.
It wraps libedit, and adds tab completion support.

The code is loosely based on the line editor bits in LLDB, with a few
improvements:

 - Polymorphism for retrieving the list of tab completions, based on
   the concept pattern from the new pass manager.

 - Tab completion doesn't corrupt terminal output if the input covers
   multiple lines. Unfortunately this can only be done in a truly horrible
   way, as far as I can tell. But since the alternative is to implement our
   own line editor (which I don't think LLVM should be in the business of
   doing, at least for now) I think it may be acceptable.

 - Includes a fallback for the case where the user doesn't have libedit
   installed.

Note that this uses C stdio, mainly because libedit also uses C stdio.

Differential Revision: http://llvm-reviews.chandlerc.com/D2200

llvm-svn: 200595
2014-01-31 23:46:14 +00:00
Rafael Espindola
85842b6045 No point in having a "#if 0"ed unittest.
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.

llvm-svn: 197654
2013-12-19 03:44:13 +00:00
NAKAMURA Takumi
b74598e93b ArchiveFileDescriptorTests: Resurrect part of r197600, but make it invalidated, to appease buildbots.
Please revert this several hours later ;)

llvm-svn: 197635
2013-12-19 00:41:03 +00:00
Owen Anderson
db064198c8 Revert r197600 while I sort out why it's failing on Windows.
llvm-svn: 197602
2013-12-18 19:25:51 +00:00
Owen Anderson
0fdac3c752 Add a unit test for loading an object file via a file descriptor. Patch by Pete Cooper.
llvm-svn: 197600
2013-12-18 19:20:29 +00:00
Rafael Espindola
f1aa4d7d7f Fix MCDataAtom never calling remap when adding data.
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.

llvm-svn: 192823
2013-10-16 18:26:16 +00:00
Eric Christopher
9bd85fb4ef Add a hashing routine that handles hashing types. Add a test for
hashing the contents of DW_FORM_data1 on top of a type with attributes.

llvm-svn: 189862
2013-09-03 21:57:57 +00:00
Eric Christopher
8d0a520dc2 Alphabetize.
llvm-svn: 189848
2013-09-03 20:51:14 +00:00
Sean Silva
dbfeeb71d5 Make BinaryRef output correctly in case of empty data.
Previously, it would simply output nothing, but it should output an
empty string `""`.

llvm-svn: 185894
2013-07-09 00:54:46 +00:00
Alexey Samsonov
542f535116 Create a stub for DWARF parser unittests
Moves one DWARF-specific header to include/llvm/DebugInfo from lib/.
Add a short unittest for r179095.

llvm-svn: 179678
2013-04-17 08:29:02 +00:00
Chandler Carruth
bcfdf656b1 Rename the VMCore unittest tree to IR. Somehow was missed when doing the
library rename.

llvm-svn: 171747
2013-01-07 15:35:46 +00:00
Michael J. Spencer
c0bd8f95ce Copy clang/Driver/<Option parsing stuff> to llvm.
llvm-svn: 169344
2012-12-05 00:29:32 +00:00
Chandler Carruth
f372f64b71 Completely refactor the structuring of unittest CMake files to match the
Makefiles, the CMake files in every other part of the LLVM tree, and
sanity.

This should also restore the output tree structure of all the unit
tests, sorry for breaking that, and thanks for letting me know.

The fundamental change is to put a CMakeLists.txt file in the unittest
directory, with a single test binary produced from it. This has several
advantages:

- No more weird directory stripping in the unittest macro, allowing it
  to be used more readily in other projects.
- No more directory prefixes on all the source files.
- Allows correct and precise use of LLVM's per-directory dependency
  system.
- Allows use of the checking logic for source files that have not been
  added to the CMake build. This uncovered a file being skipped with
  CMake in LLVM and one in Clang's unit tests.
- Makes Specifying conditional compilation or other custom logic for JIT
  tests easier.

It did require adding the concept of an explicit 'optional' source file
to the CMake build so that the missing-file check can skip cases where
the file is *supposed* to be missing. =]

This is another chunk of refactoring the CMake build in order to make it
usable for other clients like CompilerRT / ASan / TSan.

Note that this is interdependent with a Clang CMake change.

llvm-svn: 158909
2012-06-21 09:51:26 +00:00
Chandler Carruth
99fb206e0c Factor the logic for setting up a GoogleTest unit test executable into
a helper function in CMake. This will allow us to share all of this
logic with Clang, and eventually CompilerRT.

llvm-svn: 158896
2012-06-21 05:16:58 +00:00
Chandler Carruth
3bcf96d48a Simplify the naming pattern in the unittests' CMake file
llvm-svn: 158893
2012-06-21 02:02:48 +00:00
Chandler Carruth
0def3927a9 Remove one of the LLVM-specific CMake hacks in favor of standard CMake
facilities.

This was only used in one place in LLVM, and was used pervasively (but
with different code!) in Clang. It has no advantages over the standard
CMake facilities and in some cases disadvantages.

llvm-svn: 158889
2012-06-21 01:35:09 +00:00
Benjamin Kramer
b72efb3341 Add missing unittest files to the cmake build.
llvm-svn: 158647
2012-06-17 14:42:49 +00:00
Benjamin Kramer
3ff7fe9de6 Update CMake build.
llvm-svn: 158601
2012-06-16 10:53:58 +00:00
Chandler Carruth
7b9797e637 Add support to the alignment support header for conjuring a character
array of a suitable size and alignment for any of a number of different
types to be stored into the character array.

The mechanisms for producing an explicitly aligned type are fairly
complex because this operation is poorly supported on all compilers.
We've spent a fairly significant amount of time experimenting with
different implementations inside of Google, and the one using explicitly
expanded templates has been the most robust.

Credit goes to Nick Lewycky for writing the first 20 versions or so of
this logic we had inside of Google. I based this on the only one to
actually survive. In case anyone is worried, yes we are both explicitly
re-contributing and re-licensing it for LLVM. =]

Once the issues with actually specifying the alignment are finished, it
turns out that most compilers don't in turn align anything the way they
are instructed. Testing of this logic against both Clang and GCC
indicate that the alignment constraints are largely ignored by both
compilers! I've come up with and used a work-around by wrapping each
alignment-hinted type directly in a struct, and using that struct to
align the character array through a union. This elaborate hackery is
terrifying, but I've included testing that caught a terrifying number of
bugs in every other technique I've tried.

All of this in order to implement a poor C++98 programmers emulation of
C++11 unrestricted unions in classes such as SmallDenseMap.

llvm-svn: 158597
2012-06-16 08:52:57 +00:00
Justin Holewinski
10ecba6fa8 Fix gtest build issue on Visual Studio 2012 RC
llvm-svn: 158046
2012-06-06 03:11:20 +00:00
Manuel Klimek
47de8bd0ef Goodbye, JSONParser...
llvm-svn: 154930
2012-04-17 17:21:17 +00:00
Michael J. Spencer
2f9beb2374 Add YAML parser to Support.
llvm-svn: 153977
2012-04-03 23:09:22 +00:00