summaryrefslogtreecommitdiffstats
path: root/llvm/test/tools/llvm-ar
Commit message (Collapse)AuthorAgeFilesLines
* 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)
* [llvm-ar] Improve tool selection heuristicFangrui Song2019-12-101-0/+15
| | | | | | | | | | | | | | | | If llvm-ar is installed at arm-pokymllib32-linux-gnueabi-llvm-ar, it may think it is llvm-lib due to the "lib" substring. Improve the heuristic to make all the following work as intended: llvm-ar-9 (llvm-9 package on Debian) llvm-ranlib.exe Lib.exe (reported by D44808) arm-pokymllib32-linux-gnueabi-llvm-ar (reported by D71030) Reviewed By: raj.khem, rupprecht Differential Revision: https://reviews.llvm.org/D71302
* [llvm-ar][test] Add to thin archive test coveragegbreynoo2019-12-046-82/+136
| | | | | | | | This diff adds test coverage for thin archives including additions to existing tests. In some cases I have updated the formats of these tests to better match other tests in the archive. Differential Revision: https://reviews.llvm.org/D70969
* llvm-ranlib/nm: Don't print usage message except for usage errorsSam Clegg2019-11-081-0/+3
| | | | | | | Also, fix a bug in ranlib where it didn't correctly detect being run without any argument and would try to operate on the empty string. Differential Revision: https://reviews.llvm.org/D70021
* [llvm-ar] Support verbose mode for operation 'x'Fangrui Song2019-11-071-3/+12
| | | | | | Reviewed By: jhenderson, kongyi Differential Revision: https://reviews.llvm.org/D69911
* [test] Use system locale for mri-utf8.testThomas Preud'homme2019-11-042-23/+21
| | | | | | | | | | | | | | | | | | | | | | | Summary: llvm-ar's mri-utf8.test test relies on the en_US.UTF-8 locale to be installed for its last RUN line to work. If not installed, the unicode string gets encoded (interpreted) as ascii which fails since the most significant byte is non zero. This commit changes the test to only rely on the system being able to encode the pound sign in its default encoding (e.g. UTF-16 for Microsoft Windows) by always opening the file via input/output redirection. This avoids forcing a given locale to be present and supported. A Byte Order Mark is also added to help recognizing the encoding of the file and its endianness. Finally the XFAIL on system-darwin is removed since the test actually passes fine on Mac OS X and XFAIL was only added because it failed before. Reviewers: gbreynoo, MaskRay, rupprecht, JamesNagurne, jfb Subscribers: dexonsmith, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D68472
* [llvm-ar] Implement the V modifier as an alias for --versionJordan Rupprecht2019-10-162-0/+16
| | | | | | | | | | | | | | Summary: Also update the help modifier (h) so that it works as a modifier and not just as a standalone `h`. For example, `llvm-ar h` prints the help message, but `llvm-ar xh` currently prints `unknown option h`. Reviewers: MaskRay, gbreynoo Subscribers: llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D69007 llvm-svn: 375028
* [llvm-ar] Make paths case insensitive when on windowsOwen Reynolds2019-10-164-0/+73
| | | | | | | | | When on windows gnu-ar treats member names as case insensitive. This commit implements the same behaviour. Differential Revision: https://reviews.llvm.org/D68033 llvm-svn: 375002
* Revert "[test] Use system locale for mri-utf8.test"Thomas Preud'homme2019-10-102-22/+23
| | | | | | This reverts commit r374318 / b6f1d1fa0e3ee0e25f22414bf97c05276b934507. llvm-svn: 374349
* [test] Use system locale for mri-utf8.testThomas Preud'homme2019-10-102-23/+22
| | | | | | | | | | | | | | | | | | | | | | | Summary: llvm-ar's mri-utf8.test test relies on the en_US.UTF-8 locale to be installed for its last RUN line to work. If not installed, the unicode string gets encoded (interpreted) as ascii which fails since the most significant byte is non zero. This commit changes the test to only rely on the system being able to encode the pound sign in its default encoding (e.g. UTF-16 for Microsoft Windows) by always opening the file via input/output redirection. This avoids forcing a given locale to be present and supported. A Byte Order Mark is also added to help recognizing the encoding of the file and its endianness. Reviewers: gbreynoo, MaskRay, rupprecht, JamesNagurne, jfb Subscribers: dexonsmith, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D68472 llvm-svn: 374318
* [llvm-ar][test] Clarified commentOwen Reynolds2019-10-041-0/+4
| | | | | | | The test is dependant on the installation of the en_US.UTF-8 locale. The reasoning for this is clarified in the amended comment. llvm-svn: 373737
* Revert [test] Remove locale dependency for mri-utf8.testOwen Reynolds2019-10-041-1/+5
| | | | | | This reverts r373700 (git commit b455ebf921c5c940c2366bec226959e3a4127fee) llvm-svn: 373728
* [test] Remove locale dependency for mri-utf8.testThomas Preud'homme2019-10-041-5/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: llvm-ar's mri-utf8.test test relies on the en_US.UTF-8 locale to be installed for its last RUN line to work. If not installed, the unicode string gets encoded (interpreted) as ascii which fails since the most significant byte is non zero. This commit changes the call to open to use a binary literal of the UTF-8 encoding for the pound sign instead, thus bypassing the encoding step. Note that the echo to create the <pound sign>.txt file will work regardless of the locale because both the shell and the echo (in case it's not a builtin of the shell concerned) only care about ascii character to operate. Indeed, the mri-utf8.test file (and in particular the pound sign) is encoded in UTF-8 and UTF-8 guarantees only ascii characters can create bytes that can be interpreted as ascii characters (i.e. bytes with the most significant bit null). So the process to break down the filename in the line goes something along: - find an ascii chevron '>' - find beginning of the filename by removing ascii space-like characters - find ascii newline character indicating the end of the redirection (no semicolon ';', closing curly bracket '}' or parenthesis ')' or the like - create a file whose name is made of all the bytes in between beginning and end of filename *without interpretting them* Reviewers: gbreynoo, MaskRay, rupprecht, JamesNagurne, jfb Subscribers: llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D68418 llvm-svn: 373700
* [test] Remove a needless declaration of REQUIRES: target-windowsMartin Storsjo2019-10-041-1/+1
| | | | | | | | | This test only relies on running on a case insensitive file system, the exact target triple of the toolchain shouldn't matter. Differential Revision: https://reviews.llvm.org/D68136 llvm-svn: 373697
* [llvm-ar][test] Move MRI tests from "llvm/test/Object/"Owen Reynolds2019-09-267-0/+28
| | | | | | | | | | llvm/test/Object/ contains tests for the ArchiveWriter library, however support for MRI scripts is found in llvm-ar and not the library. This diff moves the MRI related tests and removes those that are duplicates. Differential Revision: https://reviews.llvm.org/D68038 llvm-svn: 372973
* Reapply [llvm-ar] Include a line number when failing to parse an MRI scriptOwen Reynolds2019-09-202-2/+43
| | | | | | | | | | | Reapply r372309 Errors that occur when reading an MRI script now include a corresponding line number. Differential Revision: https://reviews.llvm.org/D67449 llvm-svn: 372374
* [llvm-ar] Removes repetition in the error messageFangrui Song2019-09-201-0/+8
| | | | | | | | | As per bug 40244, fixed an error where the error message was repeated. Differential Revision: https://reviews.llvm.org/D67038 Patch by Yu Jian (wyjw) llvm-svn: 372370
* Revert [llvm-ar] Include a line number when failing to parse an MRI scriptOwen Reynolds2019-09-192-43/+2
| | | | | | | | Revert r372309 due to buildbot failures Differential Revision: https://reviews.llvm.org/D67449 llvm-svn: 372311
* [llvm-ar] Include a line number when failing to parse an MRI scriptOwen Reynolds2019-09-192-2/+43
| | | | | | | | | Errors that occur when reading an MRI script now include a corresponding line number. Differential Revision: https://reviews.llvm.org/D67449 llvm-svn: 372309
* [llvm-ar] Parse 'h' and '-h': display help and exitFangrui Song2019-09-171-0/+6
| | | | | | | | | | | Support `llvm-ar h` and `llvm-ar -h` because they may be what users try at first. Note, operation 'h' is undocumented in GNU ar. Reviewed By: jhenderson Differential Revision: https://reviews.llvm.org/D67560 llvm-svn: 372088
* [llvm-ar] Uncapitalize error messages and delete full stopFangrui Song2019-09-1412-19/+19
| | | | | | | | | | | | Most GNU binutils don't append full stops in error messages. This convention has been adopted by a bunch of LLVM binary utilities. Make llvm-ar follow the convention as well. Reviewed By: grimar Differential Revision: https://reviews.llvm.org/D67558 llvm-svn: 371912
* [llvm-ar] Accept file paths with windows format slashesOwen Reynolds2019-08-121-0/+44
| | | | | | | | | | | | | | | The internal representation of llvm-ar archives uses linux style slashes for paths, no matter the OS. In the case of windows this meant file paths input intending to match existing members would only match if linux style slashes where used. This change allows either slash direction to be input by the user. This change includes removing an unnecessary call to normalisePath and moving the call of another. Differential Revision: https://reviews.llvm.org/D65743 llvm-svn: 368573
* [llvm-ar][test] Correct tests marked as expected failsOwen Reynolds2019-08-123-3/+3
| | | | | | | | | | | | | In diff D64802 I marked three tests as expected failures for darwin but James Nagurne saw these fail on his downstream embedded ARM cross compiler. I believe XFAIL: system-darwin should be used instead of using XFAIL: darwin due to the problem being related to the darwin host and not the target. Differential Revision: https://reviews.llvm.org/D65745 llvm-svn: 368564
* [llvm-ar][test] Fix move operation testsOwen Reynolds2019-07-242-17/+17
| | | | | | | This fixes two tests that did not remove existing archives before testing due to mistyped archive names. llvm-svn: 366908
* [llvm-ar][test] Add tests failing on DarwinOwen Reynolds2019-07-173-0/+125
| | | | | | | | | | These tests that failed on Darwin but passed on other machines due to the default archive format differing on a Darwin machine, and what looks to be bugs in the output of this format. I can not investigate these issue further so the tests are considered expected failures on Darwin. Differential Revision: https://reviews.llvm.org/D64802 llvm-svn: 366334
* [llvm-ar][test] \r\n -> \nFangrui Song2019-07-1717-1167/+1164
| | | | | | Also simplify some empty output tests with 'count 0' llvm-svn: 366324
* [llvm-ar][test] Add coverage for replace and update key lettersOwen Reynolds2019-07-172-0/+367
| | | | | | | | Some more tests to increase llvm-ar test coverage, this time for replace 'r' and update 'u'. Differential Revision: https://reviews.llvm.org/D64803 llvm-svn: 366309
* [llvm-ar][test] Add to llvm-ar test coverageOwen Reynolds2019-07-163-0/+252
| | | | | | | | | This change adds tests to cover existing llvm-ar functionality. print.test is omitted due to failing on Darwin. Differential Revision: https://reviews.llvm.org/D64330 llvm-svn: 366209
* Reapply [llvm-ar][test] Increase llvm-ar test coverageOwen Reynolds2019-07-169-18/+413
| | | | | | | | This reapplies 365316 without extract.test due to failing on Darwin. Differential Revision: https://reviews.llvm.org/D63935 llvm-svn: 366206
* Reapply [llvm-ar][test] Add to MRI test coverageOwen Reynolds2019-07-164-0/+139
| | | | | | | | This reapplies 363232 without mri-utf8.test due to failing on Darwin. Differential Revision: https://reviews.llvm.org/D63197 llvm-svn: 366201
* Revert "Reapply [llvm-ar][test] Increase llvm-ar test coverage"JF Bastien2019-07-0810-433/+17
| | | | | | llvm-ar.extract.test has been failing on greendragon and gone unfixed. llvm-svn: 365383
* Reapply [llvm-ar][test] Increase llvm-ar test coverageOwen Reynolds2019-07-0810-17/+433
| | | | | | | | This change adds tests to cover existing llvm-ar functionality. Differential Revision: https://reviews.llvm.org/D63935 llvm-svn: 365318
* Revert [llvm-ar][test] Increase llvm-ar test coverageOwen Reynolds2019-07-0810-433/+17
| | | | | | | | Reverted due to test failures Differential Revision: https://reviews.llvm.org/D63935 llvm-svn: 365317
* [llvm-ar][test] Increase llvm-ar test coverageOwen Reynolds2019-07-0810-17/+433
| | | | | | | | This change adds tests to cover existing llvm-ar functionality. Differential Revision: https://reviews.llvm.org/D63935 llvm-svn: 365316
* Revert "[llvm-ar][test] Add to MRI test coverage"JF Bastien2019-07-035-160/+0
| | | | | | | This reverts commit 250015bacf7f255abcfb646fb8b6b56ce8be7e01. r365039 was re-commit of D63197 and failed on Mac. Reid XFAIL'd it, but I'd rather jsut revert and have it fixed properly. llvm-svn: 365084
* Try to XFAIL mri-utf8.test on MacReid Kleckner2019-07-031-18/+21
| | | | llvm-svn: 365076
* [llvm-ar][test] Add to MRI test coverageOwen Reynolds2019-07-035-0/+157
| | | | | | | | This reapplies 363232 that was reverted due to a buildbot test failure, this build bot has now been fixed. Differential Revision: https://reviews.llvm.org/D63197 llvm-svn: 365039
* Partial revert of "[llvm-ar] Document response file support in --help"Sam Clegg2019-06-291-9/+0
| | | | | | | | | This is partial revert of 70a8027c60fe1f95e8a8a1ff6575ebf8778d3544. The test apparently failed on win32 bots due to the way slashes in pathnames are handled. llvm-svn: 364705
* [llvm-ar] Document response file support in --helpSam Clegg2019-06-281-0/+9
| | | | | | | | Also a test for this. Differential Revision: https://reviews.llvm.org/D63836 llvm-svn: 364673
* Revert [llvm-ar][test] Add to MRI test coverageOwen Reynolds2019-06-135-157/+0
| | | | | | | | This reverts 363232 due to mru-utf8.test buildbot test failure Differential Revision: https://reviews.llvm.org/D63197 llvm-svn: 363239
* [llvm-ar][test] Add to MRI test coverageOwen Reynolds2019-06-135-0/+157
| | | | | | | | This change adds tests to cover existing MRI script functionality. Differential Revision: https://reviews.llvm.org/D63197 llvm-svn: 363232
* [llvm-ar][test] Relax lit directory assumptions in thin-archive.testJordan Rupprecht2019-06-121-6/+6
| | | | | | | | | | | | | | | | Summary: thin-archive.test assumes the Output/<testname> structure that lit creates. Rewrite the test in a way that still tests the same thing (creating via relative path and adding via absolute path) but doesn't assume this specific lit structure, making it possible to run in a lit emulator. Reviewers: gbreynoo Reviewed By: gbreynoo Subscribers: llvm-commits, bkramer Tags: #llvm Differential Revision: https://reviews.llvm.org/D62930 llvm-svn: 363189
* [llvm-ar] Create thin archives with MRI scriptsOwen Reynolds2019-06-061-0/+23
| | | | | | | | This patch implements the "CREATE_THIN" MRI script command, allowing thin archives to be created via MRI scripts. Differential Revision: https://reviews.llvm.org/D62919 llvm-svn: 362704
* [llvm-ar] Reapply Fix relative thin archive path handlingOwen Reynolds2019-06-042-0/+55
| | | | | | | | | | Includes a fix for an introduced build failure due to a post c++11 use of std::mismatch. This fixes some thin archive relative path issues, paths are shortened where possible and paths are output correctly when using the display table command. Differential Revision: https://reviews.llvm.org/D59491 llvm-svn: 362484
* Revert "[llvm-ar] Fix relative thin archive path handling"Dmitri Gribenko2019-06-032-55/+0
| | | | | | | | | | This reverts commit r362407. It broke compilation of llvm/lib/Object/ArchiveWriter.cpp: error: type 'llvm::sys::path::const_iterator' does not provide a call operator llvm-svn: 362413
* [llvm-ar] Fix relative thin archive path handlingOwen Reynolds2019-06-032-0/+55
| | | | | | | | This fixes some thin archive relative path issues, paths are shortened where possible and paths are output correctly when using the display table command. Differential Revision: https://reviews.llvm.org/D59491 llvm-svn: 362407
* [llvm-ar][llvm-nm][llvm-size] Change -long-option to --long-option in tests. NFCFangrui Song2019-05-011-1/+1
| | | | llvm-svn: 359688
* [llvm-nm][llvm-readelf] Avoid single-dash -long-option in testsFangrui Song2019-04-271-1/+1
| | | | llvm-svn: 359383
* [yaml2obj][obj2yaml] - Change how symbol's binding is descibed when ↵George Rimar2019-04-034-24/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | parsing/dumping. Currently, YAML has the following syntax for describing the symbols: Symbols: Local: LocalSymbol1: ... LocalSymbol2: ... ... Global: GlobalSymbol1: ... Weak: ... GNUUnique: I.e. symbols are grouped by their bindings. That is not very convenient, because: It does not allow to set a custom binding, what can be useful for producing broken/special outputs for test cases. Adding a new binding would require to change a syntax (what we observed when added GNUUnique recently). It does not allow to change the order of the symbols in .symtab/.dynsym, i.e. currently all Local symbols are placed first, then Global, Weak and GNUUnique are following, but we are not able to change the order. It is not consistent. Binding is just one of the properties of the symbol, we do not group them by other properties. It makes the code more complex that it can be. This patch shows it can be simplified with the change performed. The patch changes the syntax to just: Symbols: Symbol1: ... Symbol2: ... ... With that, we are able to work with the binding field just like with any other symbol property. Differential revision: https://reviews.llvm.org/D60122 llvm-svn: 357595
* [llvm-ar] Support N [count] modifierJordan Rupprecht2019-03-191-0/+80
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: GNU ar supports the 'N' count modifier for the extract (x) and delete (d) operations. When an archive contains multiple members with the same name, this can be used to extract (or delete) them individually. For example: ``` $ llvm-ar t archive.a foo foo $ llvm-ar x archive.a -> Writes foo twice, overwriting it the second time :( :( $ llvm-ar xN 1 archive.a foo && mv foo foo.1 $ llvm-ar xN 2 archive.a foo && mv foo foo.2 -> Write foo twice, renaming it in between invocations to preserve all versions ``` Reviewers: ruiu, MaskRay Reviewed By: ruiu, MaskRay Subscribers: jdoerfert, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D59503 llvm-svn: 356466
OpenPOWER on IntegriCloud