summaryrefslogtreecommitdiffstats
path: root/llvm/test/Object
Commit message (Collapse)AuthorAgeFilesLines
* The archive update test has a subtle race condition in it: if the testChandler Carruth2013-07-141-7/+15
| | | | | | | | | | | | | | | | | | is executed within the same second as the inputs for the test are checked out from the source tree, it will fail to update due to being below the resolution of the 'mtime' test used. Now, this may seem improbably to you... ok, maybe *really* improbable, but consider a system which does distributed execution of tests by shipping their inputs to another machine and runs them. That might cause the mtime to be quite recent during the test run. ;] Instead, create two files directly in the test (allowing all platforms to see the problem) and add either a use of the 'touch' command that forces one mtime to some time quite a bit in the past, or it sleeps for just over a second to be outside of the precision window. llvm-svn: 186282
* Only verify the length in archive test, we can't make assumptions on the ↵Benjamin Kramer2013-07-131-2/+2
| | | | | | | | spacing. And .* did just match about anything anyways. llvm-svn: 186246
* Add r186216 back, but make the test tolerant of different uids and gids.Rafael Espindola2013-07-131-0/+22
| | | | | | | original message: Fix a off by one error about which members need to use the string table. llvm-svn: 186238
* Revert commit r186216 -- it's breaking bots:Chandler Carruth2013-07-131-22/+0
| | | | | | | | | | http://lab.llvm.org:8011/builders/clang-x86_64-debian-fast/builds/6897/steps/check-all/logs/LLVM%3A%3Aarchive-format.test Original commit log: Fix a off by one error about which members need to use the string table. llvm-svn: 186232
* Fix a off by one error about which members need to use the string table.Rafael Espindola2013-07-121-0/+22
| | | | llvm-svn: 186216
* Change archive-update.test to create a new file on the fly.Rafael Espindola2013-07-122-3/+6
| | | | llvm-svn: 186206
* Rename directory to avoid problems on windows.Rafael Espindola2013-07-122-2/+2
| | | | llvm-svn: 186202
* Change llvm-ar to use lib/Object.Rafael Espindola2013-07-122-3/+5
| | | | | | | | | | | | | | | | | | | | | | This fixes two bugs is lib/Object that the use in llvm-ar found: * In OS X created archives, the name can be padded with nulls. Strip them. * In the constructor, remember the first non special member and use that in begin_children. This makes sure we skip all special members, not just the first one. The change to llvm-ar itself consist of * Using lib/Object for reading archives instead of ArchiveReader.cpp. * Writing the modified archive directly, instead of creating an in memory representation. The old Archive library was way more general than what is needed, as can be seen by the diffstat of this patch. Having llvm-ar using lib/Object now opens the way for creating regular symbol tables for both native objects and bitcode files so that we can use those archives for LTO. llvm-svn: 186197
* Add a test for llvm-ar's u option.Rafael Espindola2013-07-122-0/+26
| | | | llvm-svn: 186192
* Relax the test a bit more to handle different UIDs and GIDs.Rafael Espindola2013-07-121-1/+1
| | | | llvm-svn: 186186
* Relax test a bit to handle umask differences.Rafael Espindola2013-07-121-1/+1
| | | | llvm-svn: 186184
* Add a test for the 'o' option in llvm-ar.Rafael Espindola2013-07-121-0/+10
| | | | llvm-svn: 186183
* Don't reject an empty archive.Rafael Espindola2013-07-122-0/+4
| | | | llvm-svn: 186159
* llvm/test/Object/archive-toc.test: Use env(1) to satisfy win32 hosts.NAKAMURA Takumi2013-07-121-8/+4
| | | | llvm-svn: 186143
* Add tests for the before and after modifiers.Rafael Espindola2013-07-111-0/+20
| | | | llvm-svn: 186118
* Add a test for llvm-ar's m operation.Rafael Espindola2013-07-111-0/+30
| | | | llvm-svn: 186110
* Fix a FIXME about the format and add a test.Rafael Espindola2013-07-111-8/+23
| | | | | | | While at it, use strftime on Unix too and use the thread safe versions of localtime. llvm-svn: 186090
* Merge these tests.Rafael Espindola2013-07-115-35/+16
| | | | llvm-svn: 186084
* Use a more unique name to avoid conflicting with directory.ll tests when runningRafael Espindola2013-07-111-19/+19
| | | | | | in parallel. llvm-svn: 186083
* Add a test for llvm-ar's 'd' operation.Rafael Espindola2013-07-111-0/+30
| | | | llvm-svn: 186082
* Add tests for the 'x' operation.Rafael Espindola2013-07-111-0/+20
| | | | llvm-svn: 186081
* Remove this test for now.Rafael Espindola2013-07-101-7/+0
| | | | | | | It is not reliable to depend on the output of llvm_unreachable. The original change will have proper tests when llvm-ar moves to lib/Object (soon). llvm-svn: 186043
* Find the symbol table on archives created on OS X.Rafael Espindola2013-07-101-0/+7
| | | | llvm-svn: 186041
* Move tests from test/Archive to test/Object.Rafael Espindola2013-07-1015-0/+69
| | | | | | | | There is no lib/Archive anymore and some archive tests were in test/Archive and others in test/Object. Since archive is just one of the formats supported by lib/Object, test/Object is probably the best location. llvm-svn: 186038
* Don't crash in 'llvm -s' when an archive has no symtab.Rafael Espindola2013-07-101-10/+17
| | | | llvm-svn: 186029
* Don't create an archive if, for example, we are asked to print the index.Rafael Espindola2013-07-051-0/+17
| | | | llvm-svn: 185697
* Add support for archives with no symbol table or string table.Rafael Espindola2013-07-042-0/+5
| | | | llvm-svn: 185664
* Add support for gnu archives with a string table and no symtab.Rafael Espindola2013-07-032-0/+8
| | | | | | While there, use early returns to reduce nesting. llvm-svn: 185547
* Make llvm-nm return 1 on error.Rafael Espindola2013-07-031-0/+17
| | | | | | | This is a small compatibility improvement with gnu nm and makes llvm-nm more useful as a testing tool. llvm-svn: 185546
* [yaml2obj][ELF] Make symbol table top-level key.Sean Silva2013-06-222-25/+21
| | | | | | | | | Although in reality the symbol table in ELF resides in a section, the standard requires that there be no more than one SHT_SYMTAB. To enforce this constraint, it is cleaner to group all the symbols under a top-level `Symbols` key on the object file. llvm-svn: 184627
* This was a nifty test, but remove it.Sean Silva2013-06-211-6/+0
| | | | | | | | | | | | | | It wouldn't really test anything that doesn't already have a more targeted test: `yaml2obj-elf-section-basic.yaml`: Already tests that section content is correctly passed though. `yaml2obj-elf-symbol-basic.yaml` (this file): Tests that the st_value and st_size attributes of `main` are set correctly. Between those two tests, disassembling the file doesn't really add anything, so just remove mention of disassembling the file. llvm-svn: 184607
* Revert "Put r184469 disassembler test back on X86"Sean Silva2013-06-212-46/+15
| | | | | | | | | This reverts commit r184602. In an upcoming commit, I will just remove the disassembler part of the test; it was mostly just a "nifty" thing marking a milestone but it doesn't test anything that isn't tested elsewhere. llvm-svn: 184606
* Put r184469 disassembler test back on X86Renato Golin2013-06-212-15/+46
| | | | llvm-svn: 184602
* [yaml2obj][ELF] Don't do disassembly in this test.Sean Silva2013-06-211-1/+2
| | | | | | | | | This was causing buildbot failures when build without X86 support. Is there a way to conditionalize the test on the X86 target being present? llvm-svn: 184597
* [yaml2obj][ELF] Allow expressing undefined symbols.Sean Silva2013-06-211-0/+4
| | | | | | | | | | Previously we unconditionally enforced that section references in symbols in the YAML had a name that was a section name present in the object, and linked the references to that section. Now, permit empty section names (already the default, if the `Section` key is not provided) to indicate SHN_UNDEF. llvm-svn: 184513
* [yaml2obj][ELF] Don't explicitly set `Binding` with STB_*Sean Silva2013-06-212-6/+45
| | | | | | | | | | | | | | | Instead, just have 3 sub-lists, one for each of {STB_LOCAL,STB_GLOBAL,STB_WEAK}. This allows us to be a lot more explicit w.r.t. the symbol ordering in the object file, because if we allowed explicitly setting the STB_* `Binding` key for the symbol, then we might have ended up having to shuffle STB_LOCAL symbols to the front of the list, which is likely to cause confusion and potential for error. Also, this new approach is simpler ;) llvm-svn: 184506
* [yaml2obj][ELF] Add support for st_value and st_size.Sean Silva2013-06-201-0/+16
| | | | | | | | | After this patch, the ELF file produced by `yaml2obj-elf-symbol-basic.yaml`, when linked and executed on x86_64 (under SysV ABI, obviously; I tested on Linux), produces a working executable that goes into an infinite loop! llvm-svn: 184469
* [yaml2obj][ELF] Allow symbols to reference sections.Sean Silva2013-06-201-0/+2
| | | | llvm-svn: 184468
* Make sure ar is creating a new file instead of updating an existing one.Rafael Espindola2013-06-201-0/+1
| | | | | | Should fix the bots that are seeing a corrupted file from a previous run. llvm-svn: 184424
* [yaml2obj][ELF] Beef up this test a bit.Sean Silva2013-06-191-0/+1
| | | | llvm-svn: 184269
* [yaml2obj][ELF] Support ELFOSABI_* enum.Sean Silva2013-06-191-0/+10
| | | | llvm-svn: 184268
* [yaml2obj][ELF] Support st_info through `Binding` and `Type` YAML keys.Sean Silva2013-06-191-0/+4
| | | | llvm-svn: 184263
* [yaml2obj][ELF] Ensure STN_UNDEF entry is present.Sean Silva2013-06-181-1/+0
| | | | llvm-svn: 184258
* [yaml2obj][ELF] Rudimentary symbol table support.Sean Silva2013-06-181-0/+22
| | | | | | Currently, we only output the name. llvm-svn: 184255
* Basic support for parsing Mach-O universal binaries in LLVMObject libraryAlexey Samsonov2013-06-182-0/+6
| | | | llvm-svn: 184191
* [yaml2obj] Add support for sh_link via `Link` key.Sean Silva2013-06-151-0/+3
| | | | llvm-svn: 184022
* [yaml2obj] Add support for sh_addralign via `AddressAlign` key.Sean Silva2013-06-141-2/+4
| | | | | | | For consistency, change the address in the test case from 0xDEADBEEF to 0xCAFEBABE since 0xCAFEBABE that actually has a 2-byte alignment. llvm-svn: 183962
* [yaml2obj] Add support for specifying raw section content.Sean Silva2013-06-131-1/+6
| | | | llvm-svn: 183955
* [yaml2obj] Add sh_addr via `Address` key.Sean Silva2013-06-131-0/+2
| | | | llvm-svn: 183954
* [yaml2obj] Initial ELF section support.Sean Silva2013-06-132-1/+24
| | | | | | | The current functionality is extremely basic and a bit rough around the edges, but it will flesh out in future commits. llvm-svn: 183953
OpenPOWER on IntegriCloud