summaryrefslogtreecommitdiff
path: root/test/tools
Commit message (Collapse)AuthorAge
* Do not XFAIL test/tools/llvm-cov tests on powerpc64leUlrich Weigand2014-06-18
| | | | | | | | | | | | | All tests in test/tools/llvm-cov fail on big-endian targets and are supposed to be XFAILed there. However, including "powerpc64" in the XFAIL line is now incorrect, since that matches both powerpc64- and powerpc64le- targets, and the tests pass on the latter. Update the XFAIL lines to use powerpc64- instead (like mips64-). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211172 91177308-0d34-0410-b5e6-96231b3b80d8
* [llvm-readobj][ELF] New `-mips-plt-got` command line option to outputSimon Atanasyan2014-06-18
| | | | | | | | MIPS GOT section. Patch reviewed by Rafael Espindola. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211150 91177308-0d34-0410-b5e6-96231b3b80d8
* Reduce verbiage of lit.local.cfg filesAlp Toker2014-06-09
| | | | | | We can just split targets_to_build in one place and make it immutable. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210496 91177308-0d34-0410-b5e6-96231b3b80d8
* ProfileData: Allow multiple profiles in RawInstrProfReaderJustin Bogner2014-05-16
| | | | | | | | | | | | | | | | | | | Allow multiple raw profiles to coexist in a single .profraw file, given the following conditions: - Zero padding at the end of or between profiles will be skipped. - Each profile must start with a valid header. - Mixing endianness or pointer sizes in concatenated profiles files is not allowed. This is needed to handle cases where a program's shared libraries are profiled as well as the main executable itself, as we'll need to emit each executable's counters. Combining the tables in the runtime would be expensive for the instrumented program. rdar://16918688 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@208938 91177308-0d34-0410-b5e6-96231b3b80d8
* [Test] Trim unnecessary .c and .cpp from config.suffix in lit.local.cfgAdam Nemet2014-05-12
| | | | | | | | | | | | | | Tested by comparing make check VERBOSE=1 before and after to make sure no tests are missed. (VERBOSE=1 prints the list of tests.) Only one test :( remains where .cpp is required: tools/llvm-cov/range_based_for.cpp:// RUN: llvm-cov range_based_for.cpp | FileCheck %s --check-prefix=STDOUT The topic was discussed in this thread: http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20140428/214905.html git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@208621 91177308-0d34-0410-b5e6-96231b3b80d8
* [llvm-readobj] Print values of FLAGS and MIPS_FLAGS dynamic table tagsSimon Atanasyan2014-05-11
| | | | | | in a human readable form. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@208489 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-cov: Handle missing source files as GCOV doesJustin Bogner2014-05-07
| | | | | | | | | | | If the source files referenced by a gcno file are missing, gcov outputs a coverage file where every line is simply /*EOF*/. This also occurs for lines in the coverage that are past the end of a file that is found. This change mimics gcov. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@208149 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-cov: Implement --no-outputJustin Bogner2014-05-07
| | | | | | | | In gcov, there's a -n/--no-output option, which disables the writing of any .gcov files, so that it emits only the summary info on stdout. This implements the same behaviour in llvm-cov. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@208148 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-cov: Fix handling of line zero appearing in a line tableJustin Bogner2014-05-02
| | | | | | | | | | | | | Reading line tables in llvm-cov was pretty broken, but would happen to work as long as no line in the table was 0. It's not clear to me whether a line of zero *should* show up in these tables, but deciding to read a string in the middle of the line table is certainly the wrong thing to do if it does. I've also added some comments, as trying to figure out what this block of code was doing was fairly unpleasant. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207866 91177308-0d34-0410-b5e6-96231b3b80d8
* ProfileData: Treat missing function counts as malformedJustin Bogner2014-04-25
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207172 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-cov: Add support for gcov's --long-file-names optionJustin Bogner2014-04-23
| | | | | | | | GCOV provides an option to prepend output file names with the source file name, to disambiguate between covered data that's included from multiple sources. Add a flag to llvm-cov that does the same. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207035 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-profdata: Avoid writing to /dev/null in testsJustin Bogner2014-04-18
| | | | | | | We fseek on our output file in llvm-profdata, which errors on some systems. Avoid getting into the situation by writing to /dev/null git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206670 91177308-0d34-0410-b5e6-96231b3b80d8
* test: Add extra run lines to investigate an error on the botsJustin Bogner2014-04-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206668 91177308-0d34-0410-b5e6-96231b3b80d8
* ProfileData: Add support for the indexed instrprof formatJustin Bogner2014-04-18
| | | | | | | | This adds support for an indexed instrumentation based profiling format, which is just a small header and an on disk hash table. This format will be used by clang's -fprofile-instr-use= for PGO. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206656 91177308-0d34-0410-b5e6-96231b3b80d8
* tools: fix invalid printing, buffer overrun in llvm-readobjSaleem Abdulrasool2014-04-16
| | | | | | All auxiliary records are consumed when accessing a File record. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206354 91177308-0d34-0410-b5e6-96231b3b80d8
* tools: fix heap-buffer-overrun detected via ASANSaleem Abdulrasool2014-04-14
| | | | | | | | | | Once the auxiliary fields relating to the filename have been inspected, any following auxiliary fields need not be visited as they have been consumed (the following fields comprise the filepath as a single unit). Adjust the test to catch this even if ASAN is not enabled. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206190 91177308-0d34-0410-b5e6-96231b3b80d8
* tools: address possible non-null terminated filenamesSaleem Abdulrasool2014-04-14
| | | | | | | | | If a filename is a multiple of 18 characters, there will be no null-terminator. This will result in an invalid access by the constructed StringRef. Add a test case to exercise this and fix that handling. Address this same vulnerability in llvm-readobj as well. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206145 91177308-0d34-0410-b5e6-96231b3b80d8
* tools: teach objdump about FILE aux recordsSaleem Abdulrasool2014-04-13
| | | | | | | | | Add support for file auxiliary symbol entries in COFF symbol tables. A COFF symbol table with a FILE entry is followed by sizeof(__FILE__) / 18 auxiliary symbol records which contain the filename. Read them and form the original filename that the record contains. Then display the name in the output. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206126 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-cov: Move XFAIL after the body of the testJustin Bogner2014-03-26
| | | | | | | llvm-cov tests are sensitive to line number changes, so putting this at the end will limit churn when we fix the XFAIL. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204871 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-cov: Disable test on big endian machinesJustin Bogner2014-03-26
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204868 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-cov: Handle functions with no line numberJustin Bogner2014-03-26
| | | | | | | | | Functions may in an instrumented binary but not in the original source when they're inserted by the compiler or the runtime. These functions aren't meaningful to the user, so teach llvm-cov to skip over them instead of crashing. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204863 91177308-0d34-0410-b5e6-96231b3b80d8
* Teach llvm-readobj to print human friendly description of reserved sections.Rafael Espindola2014-03-24
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204584 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-profdata: Check for bad data in the show commandJustin Bogner2014-03-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204573 91177308-0d34-0410-b5e6-96231b3b80d8
* InstrProf: Check pointer size in raw profileDuncan P. N. Exon Smith2014-03-23
| | | | | | | | | | | | | | | Since the profile can come from 32-bit machines, we need to check the pointer size. Change the magic number to facilitate this. Adds tests for reading 32-bit and 64-bit binaries (both big- and little-endian). The tests write a binary using printf in RUN lines (like raw-magic-but-no-header.test). Assuming the bots don't complain, this seems like a better way forward for testing RawInstrProfReader than committing binary files. <rdar://problem/16400648> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204557 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-profdata: Don't pipe stderr into show for the testsJustin Bogner2014-03-22
| | | | | | | | Some text shows up on stderr when using guard malloc, and this test was trying to treat that as input to llvm-profdata show. There's no reason to pipe stderr into show at all here. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204549 91177308-0d34-0410-b5e6-96231b3b80d8
* InstrProf: Cleanup binary profdata testcaseDuncan P. N. Exon Smith2014-03-21
| | | | | | | | | | Cleanup the current binary testcase for profile data. - Rename it to something more specific. - Remove the text comparison. - Check the output of llvm-profdata show. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204518 91177308-0d34-0410-b5e6-96231b3b80d8
* InstrProf: Change magic number to have non-text charactersDuncan P. N. Exon Smith2014-03-21
| | | | | | | | | Include non-text characters in the magic number so that text files can't match. <rdar://problem/15950346> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204513 91177308-0d34-0410-b5e6-96231b3b80d8
* InstrProf: Actually detect bad headersDuncan P. N. Exon Smith2014-03-21
| | | | | | <rdar://problem/15950346> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204510 91177308-0d34-0410-b5e6-96231b3b80d8
* InstrProf: Read raw binary profile in llvm-profdataDuncan P. N. Exon Smith2014-03-21
| | | | | | | | | | | | | | Read a raw binary profile that corresponds to a memory dump from the runtime profile. The test is a binary file generated from cfe/trunk/test/Profile/c-general.c with the new compiler-rt runtime and the matching text version of the input. It includes instructions on how to regenerate. <rdar://problem/15950346> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204496 91177308-0d34-0410-b5e6-96231b3b80d8
* ProfileData: Introduce InstrProfWriter using the naive text formatJustin Bogner2014-03-21
| | | | | | | | | | | This isn't a format we'll want to write out in practice, but moving it to the writer library simplifies llvm-profdata and isolates it from further changes to the format. This also allows us to update the tests to not rely on the text output format. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204489 91177308-0d34-0410-b5e6-96231b3b80d8
* ProfileData: Introduce the InstrProfReader interface and a text readerJustin Bogner2014-03-21
| | | | | | | | | | This introduces the ProfileData library and updates llvm-profdata to use this library for reading profiles. InstrProfReader is an abstract base class that will be subclassed for both the raw instrprof data from compiler-rt and the efficient instrprof format that will be used for PGO. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204482 91177308-0d34-0410-b5e6-96231b3b80d8
* Object/COFF: Support large relocation table.Rui Ueyama2014-03-21
| | | | | | | | | | | | | | | | NumberOfRelocations field in COFF section table is only 16-bit wide. If an object has more than 65535 relocations, the number of relocations is stored to VirtualAddress field in the first relocation field, and a special flag (IMAGE_SCN_LNK_NRELOC_OVFL) is set to Characteristics field. In test we cheated a bit. I made up a test file so that it has IMAGE_SCN_LNK_NRELOC_OVFL flag but the number of relocations is much smaller than 65535. This is to avoid checking in a large test file just to test a file with many relocations. Differential Revision: http://llvm-reviews.chandlerc.com/D3139 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204418 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-objdump output hex to match binutils' objdumpGreg Fitzgerald2014-03-20
| | | | | | Patch by Ted Woodward git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204409 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-profdata: Make "merge" into a subcommand.Justin Bogner2014-03-19
| | | | | | We'll be adding a few more subcommands in the near future. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204211 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-profdata: Update to use the naive text format with function hashJustin Bogner2014-03-19
| | | | | | This also uses line_iterator to simplify the parsing logic. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204210 91177308-0d34-0410-b5e6-96231b3b80d8
* Object/COFF: Add function to check if section number is reserved one.Rui Ueyama2014-03-18
| | | | | | Differential Revision: http://llvm-reviews.chandlerc.com/D3103 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204199 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-readobj: Print referred symbol name for CLR token definitionNico Rieck2014-03-17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204024 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-readobj: Add test for COFF auxiliary symbols as used by C++/CLINico Rieck2014-03-17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204023 91177308-0d34-0410-b5e6-96231b3b80d8
* Support: add support to identify WinCOFF/ARM objectsSaleem Abdulrasool2014-03-13
| | | | | | | Add the Windows COFF ARM object file magic. This enables the LLVM tools to interact with COFF object files for Windows on ARM. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203761 91177308-0d34-0410-b5e6-96231b3b80d8
* Back out Profile library and dependent commitsJustin Bogner2014-03-12
| | | | | | | | | Chandler voiced some concern with checking this in without some discussion first. Reverting for now. This reverts r203703, r203704, r203708, and 203709. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203723 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-profdata: Use the Profile library, implement show and generateJustin Bogner2014-03-12
| | | | | | | | This replaces the llvm-profdata tool with a version that uses the recently introduced Profile library. The new tool has the ability to generate and summarize profdata files as well as merging them. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203704 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix the printing of n_type.Rafael Espindola2014-03-06
| | | | | | | Despite the name, n_type contains the type of the symbol, but also if it is extern or private extern. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203154 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-objdump: Indent unwind info contents.Rui Ueyama2014-03-04
| | | | | | | | | | | Unwind info contents were indented at the same level as function table contents. That's a bit confusing because the unwind info is pointed by function table. In other places we usually increment indentation depth by one when dereferncing a pointer. This patch also removes extraneous newlines between function tables. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202879 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-objdump: Fix typo in output.Rui Ueyama2014-03-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202875 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-objdump: Print x64 unwind info in executable.Rui Ueyama2014-03-04
| | | | | | | | | | | | | | | | | | The original code does not work correctly on executable files because the code is written in such a way that only object files are assumed to be given to llvm-objdump. Contents of RuntimeFunction are different between executables and objects. In executables, fields in RuntimeFunction have actual addresses to unwind info structures. On the other hand, in object files, the fields have zero value, but instead there are relocations pointing to the fields, so that Linker will fill them at link-time. So, when we are reading an object file, we need to use relocation info to find the location of unwind info. When executable, we should just look at the values in RuntimeFunction. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202785 91177308-0d34-0410-b5e6-96231b3b80d8
* Make a test for llvm-objdump a little bit more readable.Rui Ueyama2014-03-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202783 91177308-0d34-0410-b5e6-96231b3b80d8
* Relax COFF string table checkNico Rieck2014-02-26
| | | | | | | | | COFF object files with 0 as string table size are currently rejected. This prevents us from reading object files written by tools like cvtres that violate the PECOFF spec and write 0 instead of 4 for the size of an empty string table. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202292 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-objdump: Do not attempt to disassemble symbols outside of sectionSimon Atanasyan2014-02-24
| | | | | | | | | | | | | | boundaries. It is possible to create an ELF executable where symbol from say .text section 'points' to the address outside the section boundaries. It does not have a sense to disassemble something outside the section. Without this fix llvm-objdump prints finite or infinite (depends on the executable file architecture) number of 'invalid instruction encoding' warnings. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202083 91177308-0d34-0410-b5e6-96231b3b80d8
* For lcov tests, don't Xfail mips littl endian (mipsel-... and mip64el-...)Reed Kotler2014-02-24
| | | | | | | | targets. Just big endian (mips-... and mips64-...) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202049 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-objdump/COFF: Print SEH table addresses.Rui Ueyama2014-02-20
| | | | | | | SEH table addresses are VA in COFF file. In this patch we convert VA to RVA before printing it, because dumpbin prints them as RVAs. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201760 91177308-0d34-0410-b5e6-96231b3b80d8