summaryrefslogtreecommitdiffstats
path: root/lld/test/wasm
Commit message (Collapse)AuthorAgeFilesLines
...
* [WebAssembly] Update test expectations to match llvm-readobj change. NFC.Sam Clegg2019-02-071-1/+3
| | | | | | Differential Revision: https://reviews.llvm.org/D57868 llvm-svn: 353358
* [wasm-ld] Fix wasm trace test to use %t for temporary files.David L. Jones2019-02-061-2/+2
| | | | llvm-svn: 353272
* [WebAssembly] Implement --trace and --trace-symbolSam Clegg2019-02-062-0/+31
| | | | | | Differential Revision: https://reviews.llvm.org/D57725 llvm-svn: 353264
* [WebAssembly] Use wasm-ld rather than lld with -flavor in tests. NFC.Sam Clegg2019-02-052-4/+4
| | | | | | Differential Revision: https://reviews.llvm.org/D57758 llvm-svn: 353187
* [WebAssembly] Update test to match new readobj output. NFC.Sam Clegg2019-02-041-0/+1
| | | | | | Differential Revision: https://reviews.llvm.org/D57715 llvm-svn: 353105
* [WebAssembly] Update relocation naming to match llvm change. NFC.Sam Clegg2019-02-049-170/+170
| | | | | | Differential Revision: https://reviews.llvm.org/D57698 llvm-svn: 353066
* [WebAssembly] Support imports from custom module namesSam Clegg2019-02-011-0/+21
| | | | | | | | | | | | | Fixes: https://bugs.llvm.org/show_bug.cgi?id=37168 This is only a first pass at supporting these custom import modules. In the long run we most likely want to treat these kinds of symbols very differently. For example, it should not be possible to resolve such as symbol at static link type. Differential Revision: https://reviews.llvm.org/D45796 llvm-svn: 352828
* [WebAssembly] Fix crash with LTO + relocatable + undefined symbolsSam Clegg2019-01-305-133/+169
| | | | | | | | | | | | Change the way we create the symbol table to be closer to how its done on ELF. Now the output symbol table matches the internal symtab order and includes local and undefined symbols. Fixes PR40204 Differential Revision: https://reviews.llvm.org/D56947 llvm-svn: 352645
* [WebAssembly] Fix undefined weak function symbols in LTO buildsSam Clegg2019-01-301-0/+20
| | | | | | | | | | Summary: Fixes PR40219 Subscribers: dschuff, mehdi_amini, inglorion, jgravelle-google, aheejin, sunfish, steven_wu, dexonsmith, llvm-commits Differential Revision: https://reviews.llvm.org/D57420 llvm-svn: 352575
* [WebAssembly] Don't load weak undefined symbols from archive filesSam Clegg2019-01-291-0/+19
| | | | | | | | | | Summary: Fixes PR40494 Subscribers: dschuff, jgravelle-google, aheejin, sunfish, llvm-commits Differential Revision: https://reviews.llvm.org/D57370 llvm-svn: 352554
* [WebAssembly] Changed objdump output to offsets instead of indices.Wouter van Oortmerssen2019-01-171-3/+3
| | | | | | | | | | | | Summary: This is to accommodate this change: https://reviews.llvm.org/D56684 Reviewers: sbc100 Subscribers: dschuff, jgravelle-google, aheejin, sunfish, llvm-commits Differential Revision: https://reviews.llvm.org/D56687 llvm-svn: 351462
* [WebAssembly] Store section alignment as a power of 2Sam Clegg2019-01-167-18/+18
| | | | | | | | | | | This change bumps for version number of the wasm object file metadata. See https://github.com/WebAssembly/tool-conventions/pull/92 Differential Revision: https://reviews.llvm.org/D56762 llvm-svn: 351287
* [WebAssembly] Instruction renamingThomas Lively2019-01-0814-18/+18
| | | | | | | | | | | | Summary: Associated with D56338. Reviewers: aheejin, aardappel Subscribers: dschuff, sbc100, jgravelle-google, sunfish, llvm-commits Differential Revision: https://reviews.llvm.org/D56339 llvm-svn: 350610
* Update for an llvm-dwarfdump change in outputDavid Blaikie2018-12-121-2/+2
| | | | llvm-svn: 348955
* [WebAssembly] Add support for the event sectionHeejin Ahn2018-12-083-0/+52
| | | | | | | | | | | | | | | | | Summary: This adds support for the 'event section' specified in the exception handling proposal. Wasm exception handling binary model spec: https://github.com/WebAssembly/exception-handling/blob/master/proposals/Exceptions.md#changes-to-the-binary-model Reviewers: sbc100, ruiu Subscribers: dschuff, jgravelle-google, sunfish, llvm-commits Differential Revision: https://reviews.llvm.org/D54875 llvm-svn: 348703
* [test] Mark atime-based tests unsupported on NetBSDMichal Gorny2018-12-071-0/+2
| | | | | | | Mark tests requiring 'touch' to set atime unsupported on NetBSD due to kernel limitation preventing it from working with noatime. llvm-svn: 348607
* [WebAssembly] Don't set a maximum size when importing the tableSam Clegg2018-12-032-4/+0
| | | | | | | | | We shouldn't be setting setting a max size for a table that is being imported. Differential Revision: https://reviews.llvm.org/D55231 llvm-svn: 348204
* [WebAssembly] Allow undefined symbols when building shared librariesSam Clegg2018-11-291-10/+17
| | | | | | Differential Revision: https://reviews.llvm.org/D55043 llvm-svn: 347909
* [WebAssembly] Import the stack pointer when building shared librariesSam Clegg2018-11-151-2/+9
| | | | | | Differential Revision: https://reviews.llvm.org/D54558 llvm-svn: 346974
* [WebAssembly] Initial support for shared objects (-shared)Sam Clegg2018-11-151-0/+70
| | | | | | | | | | | | Based on the initial spec proposal: https://github.com/WebAssembly/tool-conventions/blob/master/DynamicLinking.md The llvm/codegen side of this is still missing but I believe this change is still worth landing as an incremental step Differential Revision: https://reviews.llvm.org/D54249 llvm-svn: 346918
* [WebAssembly] Respect `--no-mangle` in more locationsSam Clegg2018-11-091-4/+6
| | | | | | | | | | | | | `--no-demangle` now also applies to the name section. This change was motivated by the rust team that have a slightly different name mangling scheme to the standard C++ itanium one and prefer to do their de-mangling as a post-link setp. Patch by Alex Crichton! Differential Revision: https://reviews.llvm.org/D54279 llvm-svn: 346516
* [WebAssembly] Support creation and import of shared memoriesDerek Schuff2018-11-062-0/+27
| | | | | | | | | Used for WebAssembly threads proposal. Add a flag --shared-memory which sets the IS_SHARED bit in WasmLimits Differential Revision: https://reviews.llvm.org/D54130 llvm-svn: 346248
* Reland "Change the timestamp of llvmcache-foo file to meet the thinLTO ↵Fangrui Song2018-11-021-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | prune policy" Summary: It is difficult to touch a file with a relative mtime across different OSes as POSIX touch -d is rigid. While we may construct relative timestamps with `date`, POSIX date is inadequate to do so as various OSes' date do not agree on a common format (OpenBSD uses `date -r seconds`, FreeBSD uses `date -v-2M` while GNU accepts `-d '-2 min'`) Just use python os.utime() Original description: The case may randomly fail if we test it with command " while llvm-lit tools/lld/test/ELF/lto/cache.ll; do true; done". It is because the llvmcache-foo file is younger than llvmcache-349F039B8EB076D412007D82778442BED3148C4E and llvmcache-A8107945C65C2B2BBEE8E61AA604C311D60D58D6. But due to timestamp precision reason their timestamp is the same. Given the same timestamp, the file prune policy is to remove bigger size file first, so mostly foo file is removed for its bigger size. And the files size is under threshold after deleting foo file. That's what test case expect. However sometimes, the precision is enough to measure that timestamp of llvmcache-349F039B8EB076D412007D82778442BED3148C4E and llvmcache-A8107945C65C2B2BBEE8E61AA604C311D60D58D6 are smaller than foo, so llvmcache-349F039B8EB076D412007D82778442BED3148C4E and llvmcache-A8107945C65C2B2BBEE8E61AA604C311D60D58D6 are deleted first. Since the files size is still above the file size threshold after deleting the 2 files, the foo file is also deleted. And then the test case fails, because it expect only one file should be deleted instead of 3. The fix is to change the timestamp of llvmcache-foo file to meet the thinLTO prune policy. The same fix is applied to llvm code at https://reviews.llvm.org/D52452. Patch by Luo Yuanke. Reviewers: ruiu, craig.topper, smaslov, Jianping, espindola, LuoYuanke, tejohnson Reviewed By: tejohnson Subscribers: sbc100, krytarowski, aheejin, llvm-commits, dexonsmith, steven_wu, arichardson, inglorion, emaste, bjope, rupprecht Differential Revision: https://reviews.llvm.org/D54039 llvm-svn: 346006
* Revert "Change the timestamp of llvmcache-foo file to meet the thinLTO ↵Teresa Johnson2018-11-021-4/+0
| | | | | | | | | | | | | | | prune policy" This reverts commit r345977. A few bots failing because the invocation of "touch" is not accepted on a couple other OSes. Specifically the -d argument is not accepted or requires a different format. http://lab.llvm.org:8011/builders/lld-x86_64-darwin13/builds/27103/steps/test_lld/logs/stdio http://lab.llvm.org:8011/builders/lld-x86_64-freebsd/builds/24974/steps/test_lld/logs/stdio llvm-svn: 345980
* Change the timestamp of llvmcache-foo file to meet the thinLTO prune policyTeresa Johnson2018-11-021-0/+4
| | | | | | | | | | | | | | | | | | | | | | Summary: The case may randomly fail if we test it with command " while llvm-lit tools/lld/test/ELF/lto/cache.ll; do true; done". It is because the llvmcache-foo file is younger than llvmcache-349F039B8EB076D412007D82778442BED3148C4E and llvmcache-A8107945C65C2B2BBEE8E61AA604C311D60D58D6. But due to timestamp precision reason their timestamp is the same. Given the same timestamp, the file prune policy is to remove bigger size file first, so mostly foo file is removed for its bigger size. And the files size is under threshold after deleting foo file. That's what test case expect. However sometimes, the precision is enough to measure that timestamp of llvmcache-349F039B8EB076D412007D82778442BED3148C4E and llvmcache-A8107945C65C2B2BBEE8E61AA604C311D60D58D6 are smaller than foo, so llvmcache-349F039B8EB076D412007D82778442BED3148C4E and llvmcache-A8107945C65C2B2BBEE8E61AA604C311D60D58D6 are deleted first. Since the files size is still above the file size threshold after deleting the 2 files, the foo file is also deleted. And then the test case fails, because it expect only one file should be deleted instead of 3. The fix is to change the timestamp of llvmcache-foo file to meet the thinLTO prune policy. The same fix is applied to llvm code at https://reviews.llvm.org/D52452. Patch by Luo Yuanke. Reviewers: ruiu, craig.topper, smaslov, Jianping, espindola, LuoYuanke Subscribers: rupprecht, bjope, emaste, inglorion, arichardson, steven_wu, dexonsmith, llvm-commits Differential Revision: https://reviews.llvm.org/D53123 llvm-svn: 345977
* [WebAssembly] Remove duplicate function. NFC.Sam Clegg2018-11-013-7/+7
| | | | | | Differential Revision: https://reviews.llvm.org/D53963 llvm-svn: 345806
* [WedAssembly] Add -s and -S alias for --strip-all and --strip-debugSam Clegg2018-10-312-0/+14
| | | | llvm-svn: 345767
* [WebAssembly] Preserve function signatures during LTOSam Clegg2018-09-281-0/+19
| | | | | | | | | | | | | | | | | | | With LTO when and undefined function (with a known signature) in replaced by a defined bitcode function we were loosing the signature information (since bitcode functions don't have signatures). With this change we preserve the original signature from the undefined function and verify that the post LTO compiled function has the correct signature. This change improves the error handling in the case where there is a signature mismatch with a function defined in a bitcode file. Differential Revision: https://reviews.llvm.org/D50721 llvm-svn: 343340
* [WebAssembly] Add --[no]-export-dynamic to replace --export-defaultSam Clegg2018-09-2715-40/+40
| | | | | | | | | | | | | | | | | | | | | | | | In a very recent change I introduced a --no-export-default flag but after conferring with others it seems that this feature already exists in gnu GNU ld and lld in the form the --export-dynamic flag which is off by default. This change replaces export-default with export-dynamic and also changes the default to match the traditional linker behaviour. Now, by default, only the entry point is exported. If other symbols are required by the embedder then --export-dynamic or --export can be used to export all visibility hidden symbols or individual symbols respectively. This change touches a lot of tests that were relying on symbols being exported by default. I imagine it will also effect many users but do think the change is worth it match of the traditional behaviour and flag names. Differential Revision: https://reviews.llvm.org/D52587 llvm-svn: 343265
* [WebAssembly] Add --export-default/--no-export-default optionsSam Clegg2018-09-251-2/+16
| | | | | | | | | | | | | These option control weather or not symbols marked as visibility default are exported in the output binary. By default this is true, but emscripten prefers to control the exported symbol list explicitly at link time and ignore the symbol attributes. Differential Revision: https://reviews.llvm.org/D52003 llvm-svn: 343034
* [WebAssembly] Move .debug_line section address of dead function outside ↵Yury Delendik2018-09-241-0/+44
| | | | | | | | | | | | | | | | | | | | | | section range Summary: Currently we are pointing all debug information that refer removed function code to the beginning of the code section (offset = 0). A debugger may want to resolve code offset to the debug information, which will collide with offsets of the live functions. Moving offsets of dead functions outside code section range. Reviewers: sbc100 Reviewed By: sbc100 Subscribers: dblaikie, ruiu, alexcrichton, dschuff, aprantl, jgravelle-google, aheejin, sunfish, JDevlieghere, llvm-commits Differential Revision: https://reviews.llvm.org/D49446 llvm-svn: 342930
* [WebAssembly] Don't compress LEBs by defaultSam Clegg2018-08-171-2/+6
| | | | | | | | | LEB compression breaks debug info so we don't want to enable it by default, even at high optimization levels. Differential Revision: https://reviews.llvm.org/D50729 llvm-svn: 340073
* Revert r339490 to match revert of llvm r339474 in r339630.Richard Smith2018-08-142-4/+4
| | | | llvm-svn: 339635
* Fix WebAssembly tests after r339474Richard Trieu2018-08-102-4/+4
| | | | | | Add flags to llc RUN lines to keep tests passing. llvm-svn: 339490
* [WebAssembly] Group rodata into a single output segmentSam Clegg2018-08-081-34/+17
| | | | | | Differential Revision: https://reviews.llvm.org/D50424 llvm-svn: 339279
* [lit, python] Always add quotes around the python path in litStella Stamenova2018-08-061-1/+1
| | | | | | | | | | | | | | | Summary: The issue with the python path is that the path to python on Windows can contain spaces. To make the tests always work, the path to python needs to be surrounded by quotes. This is a companion change to: https://reviews.llvm.org/D50206 Reviewers: asmith, zturner, espindola Subscribers: emaste, sbc100, arichardson, aheejin, steven_wu, dexonsmith, llvm-commits Differential Revision: https://reviews.llvm.org/D50282 llvm-svn: 339075
* [WebAssembly] --export should fetch lazy symbolsSam Clegg2018-08-061-0/+50
| | | | | | | | | | | --export now implies --undefined This is really a requirement from emscripten but I think it makes sense in general too. Differential Revision: https://reviews.llvm.org/D50287 llvm-svn: 339047
* [WebAssembly] Don't error when --undefined symbols are not foundSam Clegg2018-08-0412-43/+40
| | | | | | | | | | | | | | | This matches the behavior of the ELF linker where -u/--undefined means symbols will get pulled in from archives but won't result in link error if they are missing. Also, don't actually great symbol table entries for the undefined symbols, again matching more closely the ELF linker. This also results in simplification of the code. Differential Revision: https://reviews.llvm.org/D50279 llvm-svn: 338938
* [lld] Make tests calling llvm-ar more robustChris Jackson2018-08-023-0/+3
| | | | | | | | | | | Some lit tests that call llvm-ar use the 'r' flag. If the target archive already exists and is in a corrupt state, this can cause the test to fail. We have added 'rm -f' calls before the llvm-ar calls to increase the robustness of the tests. Differential revision: https://reviews.llvm.org/D49184 llvm-svn: 338705
* [WebAssembly] Add support for --whole-archive.Sam Clegg2018-07-231-0/+34
| | | | | | | | Subscribers: dschuff, jgravelle-google, aheejin, sunfish, llvm-commits Differential Revision: https://reviews.llvm.org/D49706 llvm-svn: 337777
* [WebAssembly] Fix archive member display in error messagesSam Clegg2018-07-183-4/+28
| | | | | | | | | Add a test for this by causing a symbol collision between archive members. Differential Revision: https://reviews.llvm.org/D49343 llvm-svn: 337426
* [WebAssemlby] Set IsUsedInRegularObj correctly for undefined data symbolsSam Clegg2018-07-172-0/+53
| | | | | | Differential Revision: https://reviews.llvm.org/D49113 llvm-svn: 337314
* [LTO] Errors in LLVM backend should manifest as lld errorsSam Clegg2018-07-021-0/+22
| | | | | | Differential Revision: https://reviews.llvm.org/D48812 llvm-svn: 336143
* [WebAssembly] Set threadmodel during LTOSam Clegg2018-07-021-0/+14
| | | | | | | | Subscribers: dschuff, mehdi_amini, inglorion, jgravelle-google, aheejin, sunfish, steven_wu, llvm-commits Differential Revision: https://reviews.llvm.org/D48689 llvm-svn: 336118
* [WebAssembly] Fix --export of LTO symbolsSam Clegg2018-06-281-0/+38
| | | | | | Differential Revision: https://reviews.llvm.org/D48697 llvm-svn: 335881
* [WebAssembly] Add support for bitcode archive membersSam Clegg2018-06-283-7/+41
| | | | | | | | | | This change effects the behavior of --export-all. Previously --export-all would only effect symbols that survived GC. Now --export-all will prevent any non-local symbols from being GCed. Differential Revision: https://reviews.llvm.org/D48673 llvm-svn: 335878
* [WebAssembly] LTO: Fix signatures of undefined functions in bitcodeSam Clegg2018-06-281-0/+20
| | | | | | | | | | | Function symbols that come from bitcode have not signatures. After LTO when the real symbols are read in we need to make sure that we set the signature on the existing symbol. the signature-less undefined functions. Differential Revision: https://reviews.llvm.org/D48693 llvm-svn: 335875
* Revert "[WebAssembly] Error on mismatched function signature in final output"Sam Clegg2018-06-223-18/+5
| | | | | | | | | | This caused a lot of issues on the WebAssembly waterfall. In particular, until with the signature of `main`. We probably want a better solution for main before we re-land. Reverts rL335192 llvm-svn: 335355
* [WebAssembly] Only mark non-hidden symbols as live if they are also definedSam Clegg2018-06-211-37/+19
| | | | | | | | | Previously we were also marking undefined symbols (i.e. imports) as live. Differential Revision: https://reviews.llvm.org/D48299 llvm-svn: 335243
* [WebAssembly] Error on mismatched function signature in final outputSam Clegg2018-06-213-5/+18
| | | | | | | | | | | | | During symbol resolution, emit warnings for function signature mismatches. During GC, if any mismatched symbol is marked as live then generate an error. This means that we only error out if the mismatch is written to the final output. i.e. if we would generate an invalid wasm file. Differential Revision: https://reviews.llvm.org/D48394 llvm-svn: 335192
OpenPOWER on IntegriCloud