summaryrefslogtreecommitdiffstats
path: root/llvm/test/tools
Commit message (Collapse)AuthorAgeFilesLines
* [llvm-objcopy] -O binary: skip empty sectionsFangrui Song2020-05-011-2/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | After SHF_ALLOC sections are ordered by LMA: * If initial sections are empty, GNU objcopy skips their contents while we emit leading zeros. (binary-paddr.test %t4) * If trailing sections are empty, GNU objcopy skips their contents while we emit trailing zeros. (binary-paddr.test %t5) This patch matches GNU objcopy's behavior. Linkers don't keep p_memsz PT_LOAD segments. Such empty sections would not have a containing PT_LOAD and `Section::ParentSegment` might be null if linkers fail to optimize the file offsets (lld D79254). In particular, without D79254, the arm Linux kernel's multi_v5_defconfig depends on this behavior: in `vmlinux`, an empty .text_itcm is mapped at a very high address (0xfffe0000) but the kernel does not expect `objcopy -O binary` to create a very large `arch/arm/boot/Image` (0xfffe0000-0xc0000000 ~= 1GiB). See https://bugs.llvm.org/show_bug.cgi?id=45632 Reviewed By: jhenderson Differential Revision: https://reviews.llvm.org/D79229 (cherry picked from commit ec786906f5feb4dceba1b5338927079e63e78095)
* [llvm-objcopy] Improve tool selection logic to recognize llvm-strip-$major ↵Fangrui Song2020-04-111-0/+33
| | | | | | | | | | | | | | | | | as strip Debian and some other distributions install llvm-strip as llvm-strip-$major (e.g. `/usr/bin/llvm-strip-9`) D54193 made it work with llvm-strip-$major but did not add a test. The behavior was regressed by D69146. Fixes https://github.com/ClangBuiltLinux/linux/issues/940 Reviewed By: alexshap Differential Revision: https://reviews.llvm.org/D76562 (cherry picked from commit f2f96eb605bc770e4da400dbcc7a6d2526ec1fd4)
* Make quick-append.test resilient to running in paths with '1.o' in the nameHans Wennborg2020-02-031-9/+9
| | | | (cherry picked from commit f00ab188f4e4214dfbecfdd8968a183e9363cefa)
* [ELF][PowerPC] Support R_PPC_COPY and R_PPC64_COPYFangrui Song2020-01-241-0/+3
| | | | | | | | Reviewed By: Bdragon28, jhenderson, grimar, sfertile Differential Revision: https://reviews.llvm.org/D73255 (cherry picked from commit f1dab29908d25a4044abff6ffc120c48b20f034d)
* Revert "[yaml2obj/obj2yaml] - Add support for SHT_RELR sections."Georgii Rymar2020-01-152-309/+0
| | | | | | This reverts commit 46d11e30ee807accefd14e0b7f306647963a39b5. It broke bots. E.g. http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast/builds/60744
* [yaml2obj/obj2yaml] - Add support for SHT_RELR sections.Georgii Rymar2020-01-152-0/+309
| | | | | | | | | | | | | | | The encoded sequence of Elf*_Relr entries in a SHT_RELR section looks like [ AAAAAAAA BBBBBBB1 BBBBBBB1 ... AAAAAAAA BBBBBB1 ... ] i.e. start with an address, followed by any number of bitmaps. The address entry encodes 1 relocation. The subsequent bitmap entries encode up to 63(31) relocations each, at subsequent offsets following the last address entry. More information is here: https://github.com/llvm-mirror/llvm/blob/master/lib/Object/ELF.cpp#L272 This patch adds a support for these sections. Differential revision: https://reviews.llvm.org/D71872
* [llvm-readobj][llvm-readelf][test] - Add a few more dynamic section tests.Georgii Rymar2020-01-142-196/+716
| | | | | | | | | | | | This adds a few more tests for dynamic section. We only had tests for simple unknown values for 64-bits target, in this patch I've added OS specific and processor specific tags. Also it tests both 32 and 64-bits targets now. It will help to fix the formatting issues we have and diagnose a possible new ones. Differential revision: https://reviews.llvm.org/D71896
* [ARM][Thumb2] Fix ADD/SUB invalid writes to SPDiogo Sampaio2020-01-141-0/+26
| | | | | | | | | | | | | | | | | | | | Summary: This patch fixes pr23772 [ARM] r226200 can emit illegal thumb2 instruction: "sub sp, r12, #80". The violation was that SUB and ADD (reg, immediate) instructions can only write to SP if the source register is also SP. So the above instructions was unpredictable. To enforce that the instruction t2(ADD|SUB)ri does not write to SP we now enforce the destination register to be rGPR (That exclude PC and SP). Different than the ARM specification, that defines one instruction that can read from SP, and one that can't, here we inserted one that can't write to SP, and other that can only write to SP as to reuse most of the hard-coded size optimizations. When performing this change, it uncovered that emitting Thumb2 Reg plus Immediate could not emit all variants of ADD SP, SP #imm instructions before so it was refactored to be able to. (see test/CodeGen/Thumb2/mve-stacksplot.mir where we use a subw sp, sp, Imm12 variant ) It also uncovered a disassembly issue of adr.w instructions, that were only written as SUBW instructions (see llvm/test/MC/Disassembler/ARM/thumb2.txt). Reviewers: eli.friedman, dmgreen, carwil, olista01, efriedma, andreadb Reviewed By: efriedma Subscribers: gbedwell, john.brawn, efriedma, ostannard, kristof.beyls, hiraditya, dmgreen, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D70680
* [llvm-readobj][test] - Fix grammar in comments.Georgii Rymar2020-01-142-2/+2
| | | | This addresses post commit review comments for D71766.
* [llvm-exegesis][mips] Expand loadImmediate()Miloš Stojanović2020-01-131-0/+11
| | | | | | | Add support for loading 32-bit immediates and enable the use of GPR64 registers. Differential Revision: https://reviews.llvm.org/D71873
* [DebugInfo] Improve error message textJames Henderson2020-01-101-1/+1
| | | | | | | | | | Unlike most of our errors in the debug line parser, the "no end of sequence" message was missing any reference to which line table it refererred to. This change adds the offset to this message. Reviewed by: dblaikie Differential Revision: https://reviews.llvm.org/D72443
* [ThinLTO] Pass CodeGenOpts like UnrollLoops/VectorizeLoop/VectorizeSLPWei Mi2020-01-092-0/+130
| | | | | | | | | | | | | down to pass builder in ltobackend. Currently CodeGenOpts like UnrollLoops/VectorizeLoop/VectorizeSLP in clang are not passed down to pass builder in ltobackend when new pass manager is used. This is inconsistent with the behavior when new pass manager is used and thinlto is not used. Such inconsistency causes slp vectorization pass not being enabled in ltobackend for O3 + thinlto right now. This patch fixes that. Differential Revision: https://reviews.llvm.org/D72386
* [X86] AMD Znver2 (Rome) Scheduler enablementGanesh Gopalasubramanian2020-01-1055-6/+12598
| | | | | | | | | | | | The patch gives out the details of the znver2 scheduler model. There are few improvements with respect to execution units, latencies and throughput when compared with znver1. The tests that were present for znver1 for llvm-mca tool were replicated. The latencies, execution units, timeline and throughput information are updated for znver2. Reviewers: craig.topper, Simon Pilgrim Differential Revision: https://reviews.llvm.org/D66088
* [llvm-symbolizer]Fix printing of malformed address values not passed via stdinXuanda Yang2020-01-082-9/+30
| | | | | | | | | | | | | | | | | | | Summary: relates https://bugs.llvm.org/show_bug.cgi?id=44443 Adding missing newline when printing bad input values. Fix testcase Reviewers: jhenderson Reviewed By: jhenderson Subscribers: rupprecht, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D72313
* llc: Change behavior of -mcpu with existing attributeMatt Arsenault2020-01-071-1/+1
| | | | | | | | | | | Don't overwrite existing target-cpu attributes. I've often found the replacement behavior annoying, and this is inconsistent with how the fast math command line flags interact with the function attributes. Does not yet change target-features, since I think that should behave as a concatenation.
* [llvm-readelf] Print EI_ABIVERSION as decimal instead of hexadecimalFangrui Song2020-01-063-9/+9
| | | | | | | | This matches GNU readelf and llvm-readobj. Reviewed By: jhenderson Differential Revision: https://reviews.llvm.org/D72234
* [Remarks] Warn if a remark file is not found when processing static archivesFrancis Visoiu Mistrih2020-01-034-0/+47
| | | | | | | | | | | Static archives contain object files which contain sections pointing to external remark files. When static archives are shipped without the remark files, dsymutil shouldn't generate an error. Instead, generate a warning to inform the user that remarks for that library won't be available in the .dSYM.
* [DebugInfo] Remove redundant checks for past-the-end of prologueJames Henderson2020-01-031-11/+16
| | | | | | | | | | | | | | The V5 directory and filename tables had checks in to make sure we hadn't read past the end of the line table prologue. Since previous changes to the data extractor class ensure we never read past the end, these checks are now redundant, so this patch removes them. There is still a check to show that the whole prologue remains within the prologue length. Reviewed By: JDevlieghere Differential Revision: https://reviews.llvm.org/D71768
* [test][llvm-dwarfdump] Use --implicit-check-not to simplify test checksJames Henderson2020-01-031-11/+5
| | | | | | | | | This removes the need to duplicate the LASTONLY check pattern and the last part of the NONFATAL pattern in the modified test. Reviewed By: MaskRay, JDevlieghere Differential Revision: https://reviews.llvm.org/D71757
* [test][llvm-dwarfdump] Normalise contents and checks for line tablesJames Henderson2020-01-032-60/+86
| | | | | | | | | | | | | The line tables in debug_line_malformed.s had contents that varied more than was necessary for the testing, making it harder to follow what was important. This patch normalises them so that they all share more-or-less the same body. Additionally, it makes the testing for what was printed more consistent, to show that the right parts of the line table prologue and body are/are not parsed and printed. Reviewed By: JDevlieghere Differential Revision: https://reviews.llvm.org/D71755
* [test][llvm-dwarfdump] Add missing checks for table dumpingJames Henderson2020-01-031-1/+15
| | | | | | | | | | | | | | | Some of the tables in debug_line_malformed.s were not being checked in the NONFATAL checks in debug_line_invalid.test (only the warnings coming from them were being checked). This made the test harder to follow. Additionally, a later change will change the way the errors are handled such that more of the line table will be printed. That will require checks for these tables (or something equivalent) so that the difference in behaviour can be observed. This patch adds checks for the three tables that were missing checks. Reviewed By: MaskRay Differential Revision: https://reviews.llvm.org/D71753
* [llvm-size] print a blank line between archieve members when using sysv formatTH3CHARLie2020-01-033-2/+9
| | | | | | | | | | | | | | Summary: This patch is related to https://bugs.llvm.org/show_bug.cgi?id=42967 and it fixes llvm-size's sysv format output by adding a blank line between archieve members Reviewers: jhenderson, Jim, MaskRay Reviewed By: jhenderson, Jim, MaskRay Subscribers: MaskRay, Jim, rupprecht, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D71957
* Fix llvm-symbolizer tests on Windows, one more time.Evgenii Stepanov2020-01-022-7/+7
|
* Add C source to two debug info tests.Evgenii Stepanov2020-01-022-350/+411
| | | | | | | | | | Reviewers: dblaikie, jhenderson Subscribers: aprantl, rupprecht, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D72024
* Make mangled_names.test and update_cc_test_checks.py work with Python 2.Nico Weber2020-01-021-3/+3
| | | | Differential Revision: https://reviews.llvm.org/D71565
* [llvm-ranlib] Update expected error message check for WindowsAlex Richardson2020-01-021-4/+4
| | | | | | | On Windows hosts, the error message will be something like `c:\src\llvm-project\out\gn\bin\llvm-ranlib.exe: error: Invalid option: '--D'`. Due to the .exe after llvm-ranlib the existing CHECK lines do not match. Fix this by ignoring the program name and starting the check line at "error:".
* [test][llvm-dwarfdump][NFC] Remove unused checkJames Henderson2020-01-021-136/+133
| | | | | | Reviewed by: JDevlieghere Differential Revision: https://reviews.llvm.org/D71756
* [test][llvm-dwarfdump][NFC] Improve test readabilityJames Henderson2020-01-022-38/+68
| | | | | | | | | | | | | This patch adds and improves comments in the debug_line_invalid.test and its associated input file so that it is easier to follow. It uses '##' to make comments stand out from lit and FileCheck commands. It also reflows some commands so that the lines are not so long and are easier to read and fixes some copy/paste errors. Reviewed by: JDevlieghere Differential Revision: https://reviews.llvm.org/D71752
* [llvm-ranlib] Relax D-flag.test to allow it to pass on Windows hostsAlex Richardson2020-01-021-3/+2
| | | | | | It appears that Windows hosts always report rwxrwxrwx even with the chmod 644 invocation. As this test only cares about the timestamps and not the permissions, use a regex wildcard instead.
* Make the llvm-ranlib/help-message.test test pass in unusual configurationsDmitri Gribenko2020-01-021-1/+1
| | | | | | The version string can be customized by CMake options, so the 'LLVM version' substring is not guaranteed to appear (see VersionPrinter::print in llvm/lib/Support/CommandLine.cpp).
* Fix D-flag.test by running chmod before creating the archiveAlex Richardson2020-01-021-0/+1
| | | | | | Not all systems create the .o file with mode 644 by default. Adding an explicit chmod invocation should fix this test added in 535b3c6b2f1c81ed91942ebd9ea06a1022dc59a1
* [llvm-ranlib] Handle -D and -U command line flagAlex Richardson2020-01-022-4/+58
| | | | | | | | | | | | | | I have been trying to build CheriBSD (a fork for FreeBSD for the CHERI CPU) with LLVM binutils instead of the default elftoolchain utilities. I noticed that building static archives was failing because ranlib is invoked with the -D flag. This failed with llvm-ranlib since it parses the -D flag as the archive path and reports an error that more than one archive has been passed. This fixes https://llvm.org/PR41707 Reviewed By: rupprecht Differential Revision: https://reviews.llvm.org/D71554
* [Utils] Deal with occasionally deleted functionsJohannes Doerfert2019-12-313-0/+36
| | | | | | | | | | | | When functions exist for some but not all run lines we need to be careful when selecting the prefix. So far, a common prefix was potentially chosen as there was never a "conflict" that would have caused otherwise. With this patch we avoid common prefixes if they are used by run lines that do not emit the function. Reviewed By: lebedev.ri Differential Revision: https://reviews.llvm.org/D68850
* [Utils][Fix] Minor test result changeJohannes Doerfert2019-12-311-1/+1
|
* [Utils] Reuse argument variable names in the bodyJohannes Doerfert2019-12-315-1/+41
| | | | | | | | | | If we have `int foo(int a) { return a; }` and we run with --function-signature enabled, we want a single variable declaration for `a` which is reused later. Reviewed By: lebedev.ri Differential Revision: https://reviews.llvm.org/D69722
* [Utils] Allow update_test_checks to scrub attribute annotationsJohannes Doerfert2019-12-314-0/+43
| | | | | | | | | Attribute annotations on calls, e.g., #0, are not useful on their own. This patch adds a flag to update_test_checks.py to scrub them. Reviewed By: lebedev.ri Differential Revision: https://reviews.llvm.org/D68851
* [test] do not parse ls output for file size; NFCIBryan Chan2019-12-302-3/+3
| | | | | | | | Parsing `ls -l` output to obtain the size of a file is unreliable; the exact output format is not specified, and some user or group names may contain multiple words, causing `cut -f5 -d' '` to extract an incorrect value. `wc -c`, on the other hand, is portable, and there are precendents of its use in test cases.
* [llvm-readobj][llvm-objdump][test] - Improve dynamic section testing.Georgii Rymar2019-12-274-335/+339
| | | | | | | This adds --strict-whitespace --match-full-lines flags to improve the testing and reveal formatting issues we have. Differential revision: https://reviews.llvm.org/D71895
* Partially revert "Add initial tests for update_{llc_,cc_,}test_checks.py"Reid Kleckner2019-12-266-142/+7
| | | | | | | | | | | | | | This reverts part of commit 240aff80e0e59b79779d046b3275904fc0750d59. It reverts cc802ea67beb66d2f8a935e647c3aedcf7848211. We currently run LLVM tests in environments where python3 exists on PATH, but it is broken. I don't think PATH discovery is a strong enough signal that a working Python 3 installation exists. If this will be the way forward, IMO we should follow the direction of debug-info-tests, and use CMake's PYTHON_EXECUTABLE, which in the near future will be a known-to-work Python 3 executable. If it's not Python 3, then we don't have to run this test.
* [llvm-nm] Display STT_GNU_IFUNC as 'i'Fangrui Song2019-12-251-0/+27
| | | | | | Reviewed By: grimar Differential Revision: https://reviews.llvm.org/D71803
* [llvm-readobj] - Merge `gnu-symbols.test` to `symbols.test` and cleanup.Georgii Rymar2019-12-254-91/+109
| | | | | | | | | | | | | | | | This cleans up and merges `gnu-symbols.test` to `symbols.test`. Initially `gnu-symbols.test` tested the following things: 1) How symbols are printed in GNU style. It does not make sense to have a separate file for such tests. 2) It tried to test proc-specific symbol indexes. The test was incomplete and also we already have `symbol-shndx.test` for that, so this part was removed. 3) It tested `--dyn-symbols` and `--symbols` correlation. All following cases were moved to `symbols.test`: a) That `--dyn-symbols` does not trigger showing regular symbols.. b) That `--symbols` triggers `--dyn-symbols` implicitly. c) That `--dyn-symbols` and `--symbols` works fine together. Differential revision: https://reviews.llvm.org/D71697
* [llvm-readobj/llvm-readelf][test] - Add testing for EI_OSABI and ↵Georgii Rymar2019-12-252-0/+352
| | | | | | | | EI_ABIVERSION fields of an ELF header. We had no separate tests for these fields. Differential revision: https://reviews.llvm.org/D71766
* Migrate function attribute "no-frame-pointer-elim"="false" to ↵Fangrui Song2019-12-242-2/+2
| | | | "frame-pointer"="none" as cleanups after D56351
* Migrate function attribute "no-frame-pointer-elim-non-leaf" to ↵Fangrui Song2019-12-241-1/+1
| | | | "frame-pointer"="non-leaf" as cleanups after D56351
* Migrate function attribute "no-frame-pointer-elim" to "frame-pointer"="all" ↵Fangrui Song2019-12-248-10/+10
| | | | as cleanups after D56351
* [llvm-readobj] - Remove an excessive helper for printing dynamic tags.Georgii Rymar2019-12-241-65/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This removes the `getTypeString` from readeobj source because it almost duplicates the existent method: `ELFFile<ELFT>::getDynamicTagAsString`. Side effect: now it prints "<unknown:>0xHEXVALUE" instead of "(unknown)" for unknown values. llvm-readelf before this patch printed: ``` 0x0000000012345678 (unknown) 0x8765432187654321 0x000000006abcdef0 (unknown) 0x9988776655443322 0x0000000076543210 (unknown) 0x5555666677778888 ``` and now it prints: ``` 0x0000000012345678 (<unknown:>0x12345678) 0x8765432187654321 0x000000006abcdef0 (<unknown:>0x6abcdef0) 0x9988776655443322 0x0000000076543210 (<unknown:>0x76543210) 0x5555666677778888 ``` GNU reaedlf prints different thing: ``` 0x0000000012345678 (<unknown>: 12345678) 0x8765432187654321 0x000000006abcdef0 (Operating System specific: 6abcdef0) 0x9988776655443322 0x0000000076543210 (Processor Specific: 76543210) 0x5555666677778888 ``` I am not sure we want to follow GNU here. Even if we do, it should be separate patch probably. The new output looks better and closer to GNU anyways, and the code is a bit simpler. Differential revision: https://reviews.llvm.org/D71835
* DebugInfo: Support dumping any exprloc as an expressionDavid Blaikie2019-12-231-0/+101
| | | | | | | Now that DWARFv5 provides a way to identify DWARF expressions based on form, rather than only by attribute - use it to always provide pretty printing for any exprloc attribute, not only the attributes known to contain expressions.
* [yaml2obj] - Allow using an arbitrary value for OSABI.Georgii Rymar2019-12-231-0/+13
| | | | | | | There was no way to set an unsupported or unknown OS ABI. With this patch it is possible to use any numeric value. Differential revision: https://reviews.llvm.org/D71765
* [yaml2obj] - Add support for ELFOSABI_LINUX.Georgii Rymar2019-12-231-21/+31
| | | | | | | ELFOSABI_LINUX is an alias for ELFOSABI_GNU. It is not that obvious probably. Differential revision: https://reviews.llvm.org/D71764
* [yaml2obj] - Add testing for OSABI field.Georgii Rymar2019-12-231-0/+317
| | | | | | | We have no such testing. This makes impossible to add support for new ELFOSABI_* tags. Differential revision: https://reviews.llvm.org/D71763
OpenPOWER on IntegriCloud