summaryrefslogtreecommitdiffstats
path: root/llvm/test/tools
Commit message (Collapse)AuthorAgeFilesLines
* ProfileData: Allow multiple profiles in RawInstrProfReaderJustin Bogner2014-05-161-0/+64
| | | | | | | | | | | | | | | | | | | 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 llvm-svn: 208938
* [Test] Trim unnecessary .c and .cpp from config.suffix in lit.local.cfgAdam Nemet2014-05-121-1/+1
| | | | | | | | | | | | | | 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 llvm-svn: 208621
* [llvm-readobj] Print values of FLAGS and MIPS_FLAGS dynamic table tagsSimon Atanasyan2014-05-112-2/+43
| | | | | | in a human readable form. llvm-svn: 208489
* llvm-cov: Handle missing source files as GCOV doesJustin Bogner2014-05-074-0/+97
| | | | | | | | | | | 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. llvm-svn: 208149
* llvm-cov: Implement --no-outputJustin Bogner2014-05-072-0/+9
| | | | | | | | 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. llvm-svn: 208148
* llvm-cov: Fix handling of line zero appearing in a line tableJustin Bogner2014-05-024-1/+30
| | | | | | | | | | | | | 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. llvm-svn: 207866
* ProfileData: Treat missing function counts as malformedJustin Bogner2014-04-252-0/+6
| | | | llvm-svn: 207172
* llvm-cov: Add support for gcov's --long-file-names optionJustin Bogner2014-04-233-0/+26
| | | | | | | | 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. llvm-svn: 207035
* llvm-profdata: Avoid writing to /dev/null in testsJustin Bogner2014-04-181-10/+4
| | | | | | | We fseek on our output file in llvm-profdata, which errors on some systems. Avoid getting into the situation by writing to /dev/null llvm-svn: 206670
* test: Add extra run lines to investigate an error on the botsJustin Bogner2014-04-181-0/+6
| | | | llvm-svn: 206668
* ProfileData: Add support for the indexed instrprof formatJustin Bogner2014-04-182-11/+20
| | | | | | | | 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. llvm-svn: 206656
* tools: fix invalid printing, buffer overrun in llvm-readobjSaleem Abdulrasool2014-04-162-0/+39
| | | | | | All auxiliary records are consumed when accessing a File record. llvm-svn: 206354
* tools: fix heap-buffer-overrun detected via ASANSaleem Abdulrasool2014-04-141-0/+1
| | | | | | | | | | 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. llvm-svn: 206190
* tools: address possible non-null terminated filenamesSaleem Abdulrasool2014-04-144-0/+67
| | | | | | | | | 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. llvm-svn: 206145
* tools: teach objdump about FILE aux recordsSaleem Abdulrasool2014-04-132-0/+5
| | | | | | | | | 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. llvm-svn: 206126
* llvm-cov: Move XFAIL after the body of the testJustin Bogner2014-03-261-2/+3
| | | | | | | llvm-cov tests are sensitive to line number changes, so putting this at the end will limit churn when we fix the XFAIL. llvm-svn: 204871
* llvm-cov: Disable test on big endian machinesJustin Bogner2014-03-261-0/+2
| | | | llvm-svn: 204868
* llvm-cov: Handle functions with no line numberJustin Bogner2014-03-264-1/+30
| | | | | | | | | 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. llvm-svn: 204863
* Teach llvm-readobj to print human friendly description of reserved sections.Rafael Espindola2014-03-241-2/+2
| | | | llvm-svn: 204584
* llvm-profdata: Check for bad data in the show commandJustin Bogner2014-03-231-0/+2
| | | | llvm-svn: 204573
* InstrProf: Check pointer size in raw profileDuncan P. N. Exon Smith2014-03-234-0/+168
| | | | | | | | | | | | | | | 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> llvm-svn: 204557
* llvm-profdata: Don't pipe stderr into show for the testsJustin Bogner2014-03-221-9/+9
| | | | | | | | 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. llvm-svn: 204549
* InstrProf: Cleanup binary profdata testcaseDuncan P. N. Exon Smith2014-03-214-165/+24
| | | | | | | | | | 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. llvm-svn: 204518
* InstrProf: Change magic number to have non-text charactersDuncan P. N. Exon Smith2014-03-212-2/+2
| | | | | | | | | Include non-text characters in the magic number so that text files can't match. <rdar://problem/15950346> llvm-svn: 204513
* InstrProf: Actually detect bad headersDuncan P. N. Exon Smith2014-03-211-0/+6
| | | | | | <rdar://problem/15950346> llvm-svn: 204510
* InstrProf: Read raw binary profile in llvm-profdataDuncan P. N. Exon Smith2014-03-213-0/+165
| | | | | | | | | | | | | | 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> llvm-svn: 204496
* ProfileData: Introduce InstrProfWriter using the naive text formatJustin Bogner2014-03-212-45/+72
| | | | | | | | | | | 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. llvm-svn: 204489
* ProfileData: Introduce the InstrProfReader interface and a text readerJustin Bogner2014-03-211-6/+6
| | | | | | | | | | 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. llvm-svn: 204482
* Object/COFF: Support large relocation table.Rui Ueyama2014-03-212-0/+14
| | | | | | | | | | | | | | | | 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 llvm-svn: 204418
* llvm-objdump output hex to match binutils' objdumpGreg Fitzgerald2014-03-201-0/+17
| | | | | | Patch by Ted Woodward llvm-svn: 204409
* llvm-profdata: Make "merge" into a subcommand.Justin Bogner2014-03-192-14/+14
| | | | | | We'll be adding a few more subcommands in the near future. llvm-svn: 204211
* llvm-profdata: Update to use the naive text format with function hashJustin Bogner2014-03-1914-25/+53
| | | | | | This also uses line_iterator to simplify the parsing logic. llvm-svn: 204210
* Object/COFF: Add function to check if section number is reserved one.Rui Ueyama2014-03-183-1/+19
| | | | | | Differential Revision: http://llvm-reviews.chandlerc.com/D3103 llvm-svn: 204199
* llvm-readobj: Print referred symbol name for CLR token definitionNico Rieck2014-03-171-1/+1
| | | | llvm-svn: 204024
* llvm-readobj: Add test for COFF auxiliary symbols as used by C++/CLINico Rieck2014-03-173-0/+44
| | | | llvm-svn: 204023
* Support: add support to identify WinCOFF/ARM objectsSaleem Abdulrasool2014-03-132-0/+17
| | | | | | | Add the Windows COFF ARM object file magic. This enables the LLVM tools to interact with COFF object files for Windows on ARM. llvm-svn: 203761
* Back out Profile library and dependent commitsJustin Bogner2014-03-1225-150/+77
| | | | | | | | | Chandler voiced some concern with checking this in without some discussion first. Reverting for now. This reverts r203703, r203704, r203708, and 203709. llvm-svn: 203723
* llvm-profdata: Use the Profile library, implement show and generateJustin Bogner2014-03-1225-77/+150
| | | | | | | | 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. llvm-svn: 203704
* Fix the printing of n_type.Rafael Espindola2014-03-061-9/+18
| | | | | | | Despite the name, n_type contains the type of the symbol, but also if it is extern or private extern. llvm-svn: 203154
* llvm-objdump: Indent unwind info contents.Rui Ueyama2014-03-041-80/+80
| | | | | | | | | | | 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. llvm-svn: 202879
* llvm-objdump: Fix typo in output.Rui Ueyama2014-03-041-4/+4
| | | | llvm-svn: 202875
* llvm-objdump: Print x64 unwind info in executable.Rui Ueyama2014-03-043-50/+105
| | | | | | | | | | | | | | | | | | 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. llvm-svn: 202785
* Make a test for llvm-objdump a little bit more readable.Rui Ueyama2014-03-041-44/+44
| | | | llvm-svn: 202783
* Relax COFF string table checkNico Rieck2014-02-262-0/+8
| | | | | | | | | 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. llvm-svn: 202292
* llvm-objdump: Do not attempt to disassemble symbols outside of sectionSimon Atanasyan2014-02-243-0/+28
| | | | | | | | | | | | | | 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. llvm-svn: 202083
* For lcov tests, don't Xfail mips littl endian (mipsel-... and mip64el-...)Reed Kotler2014-02-241-1/+1
| | | | | | targets. Just big endian (mips-... and mips64-...) llvm-svn: 202049
* llvm-objdump/COFF: Print SEH table addresses.Rui Ueyama2014-02-201-0/+1
| | | | | | | 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. llvm-svn: 201760
* Object/COFF: Fix padding between CSDVersion and EditList.Rui Ueyama2014-02-201-3/+3
| | | | llvm-svn: 201756
* llvm-objdump/COFF: Print load configuration table.Rui Ueyama2014-02-192-4/+52
| | | | | | | | | | | | Load Configuration Table may contain a pointer to SEH table. This patch is to print the offset to the table. Printing SEH table contents is a TODO. The layout of Layout Configuration Table is described in Microsoft PE/COFF Object File Format Spec, but the table's offset/size descriptions seems to be totally wrong, at least in revision 8.3 of the spec. I believe the table in this patch is the correct one. llvm-svn: 201638
* llvm-cov: Support gcov's extermely lenient treatment of -oJustin Bogner2014-02-181-0/+10
| | | | | | | | | | | | In gcov, the -o flag can accept either a directory or a file name. When given a directory, the gcda and gcno files are expected to be in that directory. When given a file, the gcda and gcno files are expected to be named based on the stem of that file. Non-existent paths are treated as files. This implements compatible behaviour. llvm-svn: 201555
OpenPOWER on IntegriCloud