[lld] r188981 - [lld][Hexagon] Enable Hexagon sdata sorting test

Shankar Easwaran shankare at codeaurora.org
Wed Aug 21 20:02:17 PDT 2013


Author: shankare
Date: Wed Aug 21 22:02:17 2013
New Revision: 188981

URL: http://llvm.org/viewvc/llvm-project?rev=188981&view=rev
Log:
[lld][Hexagon] Enable Hexagon sdata sorting test

Modified:
    lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonSectionChunks.h
    lld/trunk/test/elf/hexagon-quickdata-sortcommon.test

Modified: lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonSectionChunks.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonSectionChunks.h?rev=188981&r1=188980&r2=188981&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonSectionChunks.h (original)
+++ lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonSectionChunks.h Wed Aug 21 22:02:17 2013
@@ -54,11 +54,18 @@ template <class HexagonELFType>
 void SDataSection<HexagonELFType>::doPreFlight() {
   // sort the atoms on the alignments they have been set
   std::stable_sort(this->_atoms.begin(), this->_atoms.end(),
-                   [](const lld::AtomLayout * A, const lld::AtomLayout * B) {
+                                             [](const lld::AtomLayout * A,
+                                                const lld::AtomLayout * B) {
     const DefinedAtom *definedAtomA = cast<DefinedAtom>(A->_atom);
     const DefinedAtom *definedAtomB = cast<DefinedAtom>(B->_atom);
     int64_t align2A = 1 << definedAtomA->alignment().powerOf2;
     int64_t align2B = 1 << definedAtomB->alignment().powerOf2;
+    if (align2A == align2B) {
+      if (definedAtomA->merge() == DefinedAtom::mergeAsTentative)
+        return false;
+      if (definedAtomB->merge() == DefinedAtom::mergeAsTentative)
+        return true;
+    }
     return align2A < align2B;
   });
 

Modified: lld/trunk/test/elf/hexagon-quickdata-sortcommon.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf/hexagon-quickdata-sortcommon.test?rev=188981&r1=188980&r2=188981&view=diff
==============================================================================
--- lld/trunk/test/elf/hexagon-quickdata-sortcommon.test (original)
+++ lld/trunk/test/elf/hexagon-quickdata-sortcommon.test Wed Aug 21 22:02:17 2013
@@ -1,7 +1,6 @@
 RUN: lld -flavor gnu -target hexagon -o %t1 --noinhibit-exec \
 RUN:     %p/Inputs/quickdata-sortcommon-test.o.elf-hexagon 
 RUN: llvm-nm -n %t1 | FileCheck %s -check-prefix=quickdataSortCommon
-XFAIL: *
 
 quickdataSortCommon: 00002000 D A1
 quickdataSortCommon: 00002001 D AA1





More information about the llvm-commits mailing list