summaryrefslogtreecommitdiffstats
path: root/llvm/test/tools
Commit message (Collapse)AuthorAgeFilesLines
* [sancov] skip dead files from computationsMike Aizatsky2016-12-174-8/+32
| | | | | | Differential Revision: https://reviews.llvm.org/D27863 llvm-svn: 290017
* Fix a bugs with using some Mach-O command line flags like "-arch armv7m".Kevin Enderby2016-12-163-2/+7
| | | | | | | | | | | | | | | | | | The Mach-O command line flag like "-arch armv7m" does not match the arch name part of its llvm Triple which is "thumbv7m-apple-darwin”. I think the best way to fix this is to have llvm::object::MachOObjectFile::getArchTriple() optionally return the name of the Mach-O arch flag that would be used with -arch that matches the CPUType and CPUSubType. Then change llvm::object::MachOUniversalBinary::ObjectForArch::getArchTypeName() to use that and change it to getArchFlagName() as the type name is really part of the Triple and the -arch flag name is a Mach-O thing for a specific Triple with a specific Mcpu value. rdar://29663637 llvm-svn: 290001
* Revert "[IR] Remove the DIExpression field from DIGlobalVariable."Adrian Prantl2016-12-162-2/+2
| | | | | | | | | | | | | | | | | This reverts commit 289920 (again). I forgot to implement a Bitcode upgrade for the case where a DIGlobalVariable has not DIExpression. Unfortunately it is not possible to safely upgrade these variables without adding a flag to the bitcode record indicating which version they are. My plan of record is to roll the planned follow-up patch that adds a unit: field to DIGlobalVariable into this patch before recomitting. This way we only need one Bitcode upgrade for both changes (with a version flag in the bitcode record to safely distinguish the record formats). Sorry for the churn! llvm-svn: 289982
* Pass sample pgo flags to thinlto.Dehao Chen2016-12-162-0/+27
| | | | | | | | | | | | Summary: ThinLTO needs to invoke SampleProfileLoader pass during link time in order to annotate profile correctly after module importing. Reviewers: davidxl, mehdi_amini, tejohnson Subscribers: pcc, davide, llvm-commits, mehdi_amini Differential Revision: https://reviews.llvm.org/D27790 llvm-svn: 289957
* [IR] Remove the DIExpression field from DIGlobalVariable.Adrian Prantl2016-12-162-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch implements PR31013 by introducing a DIGlobalVariableExpression that holds a pair of DIGlobalVariable and DIExpression. Currently, DIGlobalVariables holds a DIExpression. This is not the best way to model this: (1) The DIGlobalVariable should describe the source level variable, not how to get to its location. (2) It makes it unsafe/hard to update the expressions when we call replaceExpression on the DIGLobalVariable. (3) It makes it impossible to represent a global variable that is in more than one location (e.g., a variable with multiple DW_OP_LLVM_fragment-s). We also moved away from attaching the DIExpression to DILocalVariable for the same reasons. This reapplies r289902 with additional testcase upgrades. <rdar://problem/29250149> https://llvm.org/bugs/show_bug.cgi?id=31013 Differential Revision: https://reviews.llvm.org/D26769 llvm-svn: 289920
* [gold] Add datalayout to test where it was missingTeresa Johnson2016-12-152-0/+6
| | | | | | | | | Needed due to change to require datalayout (r289719). Found this in my own testing, maybe there aren't any bots using a v1.12 gold yet. llvm-svn: 289876
* Fix test/tools/lto/hide-linkonce-odr.ll after r289719Nico Weber2016-12-151-0/+1
| | | | llvm-svn: 289750
* [gold] Add datalayout to two tests where it was missing.Davide Italiano2016-12-142-0/+6
| | | | | | Reported by: thakis via chromium bots. llvm-svn: 289737
* [LTO] Reject modules without datalayout.Davide Italiano2016-12-1477-1/+142
| | | | | | | | | | | Also, udpate the ~60 failing tests in the tree which did not contain a valid datalayout. This fixes PR31123. lld will be updated in a following patch, immediately after this is committed. Differential Revision: https://reviews.llvm.org/D27082 llvm-svn: 289719
* [llvm-config] Add --ignore-libllvmChris Bieneman2016-12-131-1/+1
| | | | | | This flag forces off linking libLLVM. This should resolve some issues reported on llvm-commits. llvm-svn: 289605
* [LIT] Fix system-windowsChris Bieneman2016-12-132-2/+2
| | | | | | | | Turns out if you were on windows and your default target wasn't windows the system-windows feature wasn't getting enabled. This fixes that and updates the coff-dwarf test to rely on the new "target-windows" feature. That test was the reason why system-windows was changed to not always be enabled on Windows hosts. llvm-svn: 289503
* [llvm-config] Unsupported should be win32Chris Bieneman2016-12-121-1/+1
| | | | | | Hopefully this will fix the failing Windows bot. llvm-svn: 289497
* Revert "Disable all llvm-config tests for now, will investigate later"Chris Bieneman2016-12-121-2/+0
| | | | | | | | This reverts commit r260386. These tests all pass for me locally. I have no idea if they will pass on all configurations, so I'll watch the bots closely. llvm-svn: 289490
* [llvm-config] Fix cflags test looking for "error"Chris Bieneman2016-12-121-1/+1
| | | | | | This test is (I think) actually trying to make sure no errors are printed, but it hits on the string "error" in flags. llvm-svn: 289484
* Revert "Remove system-libs.test for now"Chris Bieneman2016-12-121-0/+5
| | | | | | This reverts commit r260281. llvm-svn: 289483
* [llvm-readobj] - Teach readobj to print PT_OPENBSD_BOOTDATA headerGeorge Rimar2016-12-061-1/+15
| | | | | | | | | | | | | These are OpenBSD specific program headers. OpenBSD commit: https://github.com/openbsd/src/commit/d39116912b9536bd77326260dc5c6e593fd4ee24 It is required for fixing PR31288. Differential revision: https://reviews.llvm.org/D27456 llvm-svn: 288831
* llvm-modextract: Call keep() on the output stream before exiting.Peter Collingbourne2016-12-011-0/+5
| | | | llvm-svn: 288435
* Fix a bug with llvm-size and the -m option with multiple files not printing ↵Kevin Enderby2016-12-012-0/+4
| | | | | | the file names. llvm-svn: 288402
* [WebAssembly] Add llvm-objdump support for wasm file formatDerek Schuff2016-11-302-0/+24
| | | | | | | | | | | This is the first part of an effort to add wasm binary support across all llvm tools. Patch by Sam Clegg Differential Revision: https://reviews.llvm.org/D26172 llvm-svn: 288251
* Add llvm-modextract tool.Peter Collingbourne2016-11-291-0/+12
| | | | | | | | | | This program is for testing features that rely on multi-module bitcode files. It takes a multi-module bitcode file, extracts one of the modules and writes it to the output file. Differential Revision: https://reviews.llvm.org/D26778 llvm-svn: 288201
* Add to llvm-objdump the -no-leading-headers option with the use of the ↵Kevin Enderby2016-11-291-0/+4
| | | | | | | | | | | | | -macho option. In some cases the leading headers of the file name, archive member and architecture slice name in the output of lvm-objdump is not wanted so the tool’s output can be directly used by scripts. This matches the -X option of the Apple otool(1) program. rdar://28491674 llvm-svn: 288199
* llvm-nm: Print correct symbol types for init and fini sectionsMeador Inge2016-11-232-0/+8
| | | | | | | | | This patch fixes a small bug where symbols defined in the INIT and FINI sections were incorrectly getting a type of 'n'. Differential Revision: https://reviews.llvm.org/D26937 llvm-svn: 287803
* llvm-nm: Don't print value or size for undefined or weak symbolsMeador Inge2016-11-232-0/+6
| | | | | | | | | | | | | | | | | Undefined and weak symbols don't have a meaningful size or value. As such, nothing should be printed for those attributes (this is already done for the address with 'U') with the BSD format. This matches what GNU nm does. Note that for the POSIX.2 format [1] zero values are still printed for the size and value. This seems in spirit with the format strings in that specification, but is debatable. [1] http://pubs.opengroup.org/onlinepubs/9699919799/ Differential Revision: https://reviews.llvm.org/D26936 llvm-svn: 287802
* llvm-readobj: Use hash tables to print dynamic symbols.Hemant Kulkarni2016-11-231-0/+28
| | | | | | | -symbols prints both .symtab and .dynsym symbols for GNU style in ELF. -dyn-symbols prints symbols looking up through hash tables. This helps validate hash tables. llvm-svn: 287786
* [llvm-cov] Avoid 0% when reporting something that's 0/0Alex Lorenz2016-11-214-0/+38
| | | | | | | | | | | | | This commit makes llvm-cov avoid showing 0% (0/0) coverage for things like file function coverage, etc. in reports and HTML output. This can happen for files like headers that have macros but no functions. This commit makes llvm-cov report - (0/0) instead. rdar://29246480 Differential Revision: https://reviews.llvm.org/D26615 llvm-svn: 287539
* General clean up of error handling in llvm-objdump to remove its use of ↵Kevin Enderby2016-11-161-0/+3
| | | | | | | | | | | | | | | | | | report_fatal_error(). No real functional change with this commit. The problem with report_fatal_error() is it does not include the tool name and the file name the for which the error message was generated. Uses of report_fatal_error() were change to report_error() or error() to get a better error and to make the code smaller and cleaner. Also changed things like error(errorToErrorCode(SOrErr.takeError())) to use report_error() with a file name and the llvm::Error (as well as the ArchitectureName if available) so the error message is printed. llvm-svn: 287163
* test: use separate input file for testSaleem Abdulrasool2016-11-162-4/+8
| | | | | | | Rather than using sed to generate the input and pipe the result to strings, use the static input instead. llvm-svn: 287079
* General clean up of Mach-O error handling in llvm-objdump.Kevin Enderby2016-11-154-0/+9
| | | | | | | | | | | | | | | | | | | | | To get a good error message for all files that could contain Mach-O files the code in llvm-objdump needs to use the archive member name and name of the architecture of a slice of a universal file in those cases where the error come from a Mach-O file in an archive or a universal file. Most of this is fixed by moving the call to checkSymbolTable() into ProcessMachO() and calling it when the operation needs the symbol table. And then calling the form of report_error() that has the ArchiveName and ArchitectureName arguments. One other place needed to call this form of report_error() also with these arguments. Also changed the code in MachODump.cpp to not use report_fatal_error() and use report_error() instead to make the code smaller and cleaner. All cases of this are for errors with the symbol table which should now never be tripped since checkSymbolTable() should be called first to get a good error message in these cases. llvm-svn: 287050
* llvm-objdump: deal with unexpected object files more gracefully.Tim Northover2016-11-152-0/+5
| | | | | | | Specifically, we don't want to segfault on release builds, so print the problem instead. llvm-svn: 287022
* llvm-strings: support the `-n` optionSaleem Abdulrasool2016-11-151-0/+24
| | | | | | | | | Permit specifying the match length (the `-n` or `--bytes` option). The deprecated `-[length]` form is not supported as an option. This allows the strings tool to display only the specified length strings rather than the hardcoded default length of >= 4. llvm-svn: 286914
* Revert "Revert "llvm-strings: support printing the filename""Saleem Abdulrasool2016-11-145-3/+18
| | | | | | | Change the dynamic files to static in the hope that it will actually fix the transient errors that Ive been unable to reproduce. llvm-svn: 286891
* Add a checkSymbolTable() method to the MachOObjectFile class.Kevin Enderby2016-11-145-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The philosophy of the error checking in libObject for Mach-O files is that the constructor will check the load commands so for their tables the offsets and sizes are properly contained in the file. But there is no checking of the entries of any of the tables. For the contents of the tables themselves the methods accessing the contents of the entries return errors as needed. In some cases this however makes it difficult or cumbersome to produce a good error message which would include the tool name, file name, archive member, and name of the architecture of a slice of a universal file the error occurred in. So idea is that there will be a method to check a table which can be called up front before using it allowing a good error message to be produced before a table is used. And if only verification of the Mach-O file and its tables are wanted a new possible method checkAllTables() could be added to call all of the methods to check all the tables at some time when such methods exist. The checkSymbolTable() is the first of such methods to check one of the Mach-O file tables. This method initially will used in llvm-objdump’s DisassembleMachO() routine before it gets the section and symbol information. As if there are problems with the symbol table currently the error is first encountered by the bool operator() in the SymbolSorter() struct which passed to std::sort(). In this case there is no context as to the file name the symbol which results a poor error message: LLVM ERROR: truncated or malformed object (bad string index: 22 for symbol at index 1) with the added call to the checkSymbolTable() method the error message includes the tool name and file name: llvm-objdump: 'macho-invalid-symbol-strx': truncated or malformed object (bad string table index: 22 past the end of string table, for symbol at index 1) llvm-svn: 286887
* Revert "llvm-strings: support printing the filename"Renato Golin2016-11-144-19/+2
| | | | | | | | | | | | Also, Revert "test: remove the archive before modifying it" Revert "test: explicitly use gnu format" This reverts commits r286778, r286729 and r286767, as they are randomly failing on many bots (AArch64, x86_64). llvm-svn: 286820
* test: remove the archive before modifying itSaleem Abdulrasool2016-11-131-0/+1
| | | | | | | The archive may already exist when not doing a clean test run. The dirty state can cause a test failure. Remove the archive first. llvm-svn: 286778
* llvm-cxxfilt: support reading from stdinSaleem Abdulrasool2016-11-132-0/+14
| | | | | | | | `c++filt` when given no arguments runs as a REPL, decoding each line as a decorated name. Unify the test structure to be more uniform, with the tests for llvm-cxxfilt living under test/tools/llvm-cxxfilt. llvm-svn: 286777
* llvm-strings: support printing the filenameSaleem Abdulrasool2016-11-133-0/+16
| | | | | | This adds support for the `-f` or `--print-file-name` option for strings. llvm-svn: 286767
* test: explicitly use gnu formatSaleem Abdulrasool2016-11-121-2/+2
| | | | | | This should fix the Darwin buildbots. llvm-svn: 286729
* llvm-strings: trivialise logic until we support more optionsSaleem Abdulrasool2016-11-121-0/+13
| | | | | | | | Until we have handling for ignoring unloaded sections, simplify the logic to the point of triviality. This fixes the scanning of archives, particularly when embedded in archives. llvm-svn: 286727
* llvm-strings: ensure that the last string is correctly printedSaleem Abdulrasool2016-11-122-0/+4
| | | | | | | We would ignore the last string that appeared if the file ended with a printable character. Ensure that we get the last string. llvm-svn: 286706
* Fix test/tools/gold/X86/thinlto_funcimport.ll on non-X86 hostsJohn Brawn2016-11-111-2/+2
| | | | | | Pass -m elf_x86_64 to gold, as is done in other tests. llvm-svn: 286593
* Add support for the ARM_THREAD_STATE64 andKevin Enderby2016-11-032-0/+19
| | | | | | | | | | | | | in llvm-objdump for Mach-O files add the printing of the ARM_THREAD_STATE64 in the same format as otool-classic(1) on darwin. To do this the 64-bit ARM general tread state needed to be defined in include/llvm/Support/MachO.h . rdar://28985800 llvm-svn: 285967
* Add the rest of the additional error checks for invalid Mach-O files whenKevin Enderby2016-11-021-9/+9
| | | | | | | | | | the offsets and sizes of an element of the Mach-O file overlaps with another element in the Mach-O file. Some other tests for malformed Mach-O files now run into these checks so their tests were also adjusted. llvm-svn: 285860
* [llvm-cov] Turn line numbers in html reports into clickable linksVedant Kumar2016-11-022-55/+55
| | | | llvm-svn: 285853
* [ThinLTO] Disable importing and other cross-module optis at -O0Teresa Johnson2016-10-312-0/+38
| | | | | | | | | | | | | | | | Summary: There is no point to importing at -O0, since we won't inline. We should also disable other cross-module optimizations. (Plan to backport this fix to the 3.9 branch to fix PR30774) Reviewers: pcc Subscribers: johanengelen, mehdi_amini Differential Revision: https://reviews.llvm.org/D25918 llvm-svn: 285648
* [ThinLTO] Correctly resolve linkonce when importing aliaseeTeresa Johnson2016-10-301-14/+29
| | | | | | | | | | | | | | | | | | | Summary: When we have an aliasee that is linkonce, while we can't convert the non-prevailing copies to available_externally, we still need to convert the prevailing copy to weak. If a reference to the aliasee is exported, not converting a copy to weak will result in undefined references when the linkonce is removed in its original module. Add a new test and update existing tests. Reviewers: mehdi_amini Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D26076 llvm-svn: 285512
* llvm-objdump: Make some error messages more consistentJustin Bogner2016-10-261-6/+6
| | | | | | | | | Most of the version of report_error were quoting the filename and printing a colon between the file name and the error message, but this one wasn't doing either of those. Fix the output to be more consistent. llvm-svn: 285252
* [XRay] Be case-insensitive for error stringsDean Michael Berris2016-10-261-1/+1
| | | | | | | On Windows, "no such file or directory" is the default error translation as opposed to the capitalized form on Linux. llvm-svn: 285174
* [XRay] Implement `llvm-xray extract`, start of the llvm-xray toolDean Michael Berris2016-10-2612-0/+34
| | | | | | | | | | | | | | | | | | | | Usage: llvm-xray extract <object file> [-o <filename or '-'>] The tool gets the XRay instrumentation map from an object file and turns it into YAML. We first support ELF64 sleds on x86_64 binaries, with provision for supporting other supported platforms and formats later. This is the first of a many-part change to fully implement the `llvm-xray` tool. We also define a subcommand registration and dispatch mechanism to be used by other further subcommand implementations for llvm-xray. Diffusion Revision: https://reviews.llvm.org/D21987 llvm-svn: 285165
* Revert "[XRay] Implement `llvm-xray extract`, start of the llvm-xray tool"Dean Michael Berris2016-10-2612-34/+0
| | | | | | Reverts r285155 -- misconfigured tests. llvm-svn: 285156
* [XRay] Implement `llvm-xray extract`, start of the llvm-xray toolDean Michael Berris2016-10-2612-0/+34
| | | | | | | | | | | | | | | | | | Usage: llvm-xray extract <object file> [-o <filename or '-'>] The tool gets the XRay instrumentation map from an object file and turns it into YAML. We first support ELF64 sleds on x86_64 binaries, with provision for supporting other supported platforms and formats later. This is the first of a many-part change to fully implement the `llvm-xray` tool. We also define a subcommand registration and dispatch mechanism to be used by other further subcommand implementations for llvm-xray. llvm-svn: 285155
OpenPOWER on IntegriCloud