llvm-project/lld/test/elf
Chandler Carruth c9cdc502f3 Fix a comparison function to actually be a SWO so that it conforms to
the spec required by std::sort and friends.

Ordering things this way also dramatically simplifies the code as
short-circuit ensures we can skip all of the negative tests.

I've left one FIXME where we're establishing a fairly arbitrary
ordering. Previously, the function compared all types as equal except
for the ones it explicitly handled, but it didn't delegate correctly to
the atomflags when doing so, and so it would fail to be a SWO. The two
possible fixes are to stop comparing the atom flags entirely, or to
establish some arbitrary ordering of the types.

Since it was pure luck which ordering of unequal types we ended up with
previously (the caller was std::sort, not std::stable_sort) I chose to
make the ordering explicit and guaranteed. This seems like the best
conservative approach as I suspect we would want to switch to
stable_sort otherwise in order to have deterministic output.

Differential Revision: http://reviews.llvm.org/D8266

llvm-svn: 231968
2015-03-11 21:34:33 +00:00
..
AArch64 Fix AArhc64 ELF test failure on Windows 2015-02-17 11:16:54 +00:00
ARM [ELF][ARM] Add veneer generation to branch instructions 2015-02-10 09:31:42 +00:00
Hexagon ELF: Don't use LayoutPass. 2015-01-31 02:05:01 +00:00
Inputs [ELF] Fix bug in ELFFile::createAtoms() that caused lld to mislink musl 2014-10-03 22:50:50 +00:00
Mips [Mips] Implement R_MIPS_SUB relocation handling 2015-03-09 10:53:50 +00:00
X86_64 [ELF] Implement R_X86_64_PC16 relocation. 2015-03-03 07:38:20 +00:00
gnulinkonce Update comments, fix typos. 2015-02-27 04:23:21 +00:00
linkerscript [ELF] Return error from invalid linker script parse. 2013-10-10 16:59:53 +00:00
options Fix trailing whitespace. 2014-01-27 03:09:26 +00:00
sectionGroups [ELF] Add section group/COMDAT support. 2015-02-23 00:30:00 +00:00
abs-dup.objtxt Accept and handle absolute symbols with empty name. 2014-02-06 07:35:16 +00:00
abs.test [ELF] Check for target architecture. 2014-10-20 04:00:26 +00:00
allowduplicates.objtxt [ELF] Add -z muldefs option. 2014-04-02 03:57:37 +00:00
archive-elf-forceload.test Fix trailing whitespace. 2014-01-27 03:09:26 +00:00
archive-elf.test Add missing triples so that these tests pass on 32 bit arch. 2014-01-09 00:07:20 +00:00
as-needed.test [ELF] Add --as-needed. 2015-01-16 14:27:01 +00:00
branch.test Fix trailing whitespace. 2014-01-27 03:09:26 +00:00
check.test ELF: Don't use LayoutPass. 2015-01-31 02:05:01 +00:00
checkrodata.test [lld][ELF] Fix the readonly section order. 2013-09-12 15:43:13 +00:00
common.test This is my Driver refactoring patch. 2013-04-04 18:59:24 +00:00
consecutive-weak-sym-defs.test [Core,MachO,Test] Remove trailing whitespace. 2015-02-22 23:54:38 +00:00
defsym.objtxt [ELF] Support --defsym=<symbol>=<symbol>. 2014-04-16 20:58:57 +00:00
dynamic-segorder.test [ELF] Fix values of linker created dynamic variables. 2014-11-10 14:55:07 +00:00
dynamic-undef.test Remove fragile regex from test 2015-01-13 00:12:04 +00:00
dynamic.test Core: Make the resolver faster. 2015-03-06 00:28:41 +00:00
eh_frame_hdr.test [ELF] Implement minimal support for .eh_frame_hdr. 2013-10-30 00:02:04 +00:00
entry.objtxt [ELF] Fix DT_INIT_ARRAY{SZ} and DT_FINI_ARRAY{SZ} 2014-11-10 14:55:11 +00:00
export-dynamic.test [Core,MachO,Test] Remove trailing whitespace. 2015-02-22 23:54:38 +00:00
filenotfound.test Remove fragile regex from test 2015-01-13 00:12:04 +00:00
gotpcrel.test ELF: Don't use LayoutPass. 2015-01-31 02:05:01 +00:00
group-cmd-search.test ELF: Fix a bug in -l. 2015-01-30 21:03:19 +00:00
hexagon-quickdata-sort.test ELF: Don't use LayoutPass. 2015-01-31 02:05:01 +00:00
hexagon-quickdata-sortcommon.test ELF: Don't use LayoutPass. 2015-01-31 02:05:01 +00:00
ifunc.test ELF: Don't use LayoutPass. 2015-01-31 02:05:01 +00:00
ignore-unknownoption.test [Gnu] Ignore unknown arguments, and print message. 2013-11-25 04:22:11 +00:00
init_array-order.test [ELF] Fix incorrect sorting of .init_array / .fini_array sections. 2014-05-30 05:29:46 +00:00
init_array.test This is my Driver refactoring patch. 2013-04-04 18:59:24 +00:00
initfini-options.test-1.test [ELF] Make -init/-fini options compatible with the gnu linker 2014-12-10 05:38:46 +00:00
initfini-options.test-2.test [ELF] Make -init/-fini options compatible with the gnu linker 2014-12-10 05:38:46 +00:00
initfini-options.test-3.test [ELF] Make -init/-fini options compatible with the gnu linker 2014-12-10 05:38:46 +00:00
librarynotfound.test [lld][InputGraph] Change the Resolver to use inputGraph 2013-10-07 02:47:09 +00:00
linker-as-ld.test If lld is renamed (or symlinked) to "ld" automatically pick the right flavor. 2014-09-11 00:52:05 +00:00
loginputfiles.test Fix display of files processed by the linker. 2014-10-18 20:36:35 +00:00
mergeatoms.test Add missing triples so that these tests pass on 32 bit arch. 2014-01-09 00:07:20 +00:00
mergeconstants.test [ELF] change LayoutBefore Reference to InGroup Reference 2014-02-03 04:01:14 +00:00
mergeglobalatoms.test Add missing -target triple to ELF tests. 2014-11-07 01:45:32 +00:00
note.test [ELF] Dont discard sections in the input file. 2015-02-05 02:56:06 +00:00
phdr.test Fix a comparison function to actually be a SWO so that it conforms to 2015-03-11 21:34:33 +00:00
quickdata.test ELF: Don't use LayoutPass. 2015-01-31 02:05:01 +00:00
reloc.test [ELF] change LayoutBefore Reference to InGroup Reference 2014-02-03 04:01:14 +00:00
responsefile.test [ELF] Support response file. 2014-03-28 19:34:34 +00:00
rodata.test This is my Driver refactoring patch. 2013-04-04 18:59:24 +00:00
rosegment.test Fix a comparison function to actually be a SWO so that it conforms to 2015-03-11 21:34:33 +00:00
sections.test [ELF] Fix uninitalized value. 2013-10-03 19:25:34 +00:00
sh_addralign.test Fix slow test. 2015-01-21 19:15:56 +00:00
soname.test Output soname. 2013-09-14 19:53:51 +00:00
strip-all.test Remove trailing space. 2015-02-10 01:06:14 +00:00
stripped-empty.test Add missing -target triple to ELF tests. 2014-11-07 01:45:32 +00:00
symbols.test [ELF] Add Readers for all the ELF subtargets. 2014-10-18 05:23:17 +00:00
tls.test ELF: Don't use LayoutPass. 2015-01-31 02:05:01 +00:00
tlsAddr.test Fix trailing whitespace. 2014-01-27 03:09:26 +00:00
undef-from-dso-to-main.test Re-commit r218259. 2014-09-22 20:48:04 +00:00
undef-from-main-dso.test [lld] [ELF] Support for general dynamic TLS relocations on X86_64 2014-09-29 22:05:26 +00:00
weaksym.test A weak reference to a symbol that is only weakly referenced in 2013-09-03 12:06:33 +00:00
wrap.test [ELF] Insert wrap symbols into a set. 2015-02-12 22:37:27 +00:00
x86-64-dynamic-relocs.test [lld][LinkingContext][ELF] Allow different output file types. 2013-09-23 04:24:15 +00:00
x86-64-dynamic.test ELF: Don't use LayoutPass. 2015-01-31 02:05:01 +00:00
x86.test [lld][LinkingContext][ELF] Allow different output file types. 2013-09-23 04:24:15 +00:00
x86_64-kinds.test Fix REQUIRES lines added in r226951 and add the x86 feature if the X86 target was compiled in 2015-01-24 03:55:22 +00:00