[lld] r211355 - [Mips] Make rel-copy.test test case independent from external input files.

Simon Atanasyan simon at atanasyan.com
Fri Jun 20 05:54:06 PDT 2014


Author: atanasyan
Date: Fri Jun 20 07:54:06 2014
New Revision: 211355

URL: http://llvm.org/viewvc/llvm-project?rev=211355&view=rev
Log:
[Mips] Make rel-copy.test test case independent from external input files.

Modified:
    lld/trunk/test/elf/Mips/rel-copy.test

Modified: lld/trunk/test/elf/Mips/rel-copy.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf/Mips/rel-copy.test?rev=211355&r1=211354&r2=211355&view=diff
==============================================================================
--- lld/trunk/test/elf/Mips/rel-copy.test (original)
+++ lld/trunk/test/elf/Mips/rel-copy.test Fri Jun 20 07:54:06 2014
@@ -1,13 +1,11 @@
-# REQUIRES: mips
-
 # Check R_MIPS_COPY relocation emitting
 # when linking non-shared executable file.
 #
-# RUN: yaml2obj -format=elf %S/Inputs/pic-obj.yaml > %t-so-obj
-# RUN: lld -flavor gnu -target mipsel -shared -o %t-so %t-so-obj
-# RUN: yaml2obj -format=elf %s > %t-obj
-# RUN: lld -flavor gnu -target mipsel -e T0 -o %t1-exe %t-obj %t-so
-# RUN: llvm-readobj -dyn-symbols -relocations %t1-exe | FileCheck %s
+# RUN: yaml2obj -format=elf -docnum 1 %s > %t-so.o
+# RUN: lld -flavor gnu -target mipsel -shared -o %t.so %t-so.o
+# RUN: yaml2obj -format=elf -docnum 2 %s > %t-o.o
+# RUN: lld -flavor gnu -target mipsel -e T0 -o %t.exe %t-o.o %t.so
+# RUN: llvm-readobj -dyn-symbols -relocations %t.exe | FileCheck %s
 
 # CHECK:      Relocations [
 # CHECK-NEXT:   Section (5) .rel.dyn {
@@ -55,26 +53,56 @@
 # CHECK-NEXT:   }
 # CHECK-NEXT: ]
 
-!ELF
-FileHeader: !FileHeader
-  Class: ELFCLASS32
-  Data: ELFDATA2LSB
-  Type: ET_REL
+# so.o
+---
+FileHeader:
+  Class:   ELFCLASS32
+  Data:    ELFDATA2LSB
+  Type:    ET_REL
+  Machine: EM_MIPS
+  Flags:   [EF_MIPS_PIC, EF_MIPS_CPIC]
+
+Sections:
+- Name:         .data
+  Type:         SHT_PROGBITS
+  Size:         0x08
+  AddressAlign: 16
+  Flags:        [SHF_WRITE, SHF_ALLOC]
+
+Symbols:
+  Global:
+    - Name: D1
+      Section: .data
+      Type: STT_OBJECT
+      Value: 0x0
+      Size: 4
+    - Name: D2
+      Section: .data
+      Type: STT_OBJECT
+      Value: 0x4
+      Size: 4
+
+# o.o
+---
+FileHeader:
+  Class:   ELFCLASS32
+  Data:    ELFDATA2LSB
+  Type:    ET_REL
   Machine: EM_MIPS
-  Flags: [EF_MIPS_CPIC]
+  Flags:   [EF_MIPS_CPIC]
 
 Sections:
-- Name: .text
-  Type: SHT_PROGBITS
-  Content:  "0000000000000000"
+- Name:         .text
+  Type:         SHT_PROGBITS
+  Size:         0x08
   AddressAlign: 16
-  Flags: [SHF_EXECINSTR, SHF_ALLOC]
+  Flags:        [SHF_EXECINSTR, SHF_ALLOC]
 
-- Name: .data
-  Type: SHT_PROGBITS
-  Content:  "0000000000000000"
+- Name:         .data
+  Type:         SHT_PROGBITS
+  Size:         0x08
   AddressAlign: 16
-  Flags: [SHF_WRITE, SHF_ALLOC]
+  Flags:        [SHF_WRITE, SHF_ALLOC]
 
 - Name: .rel.data
   Type: SHT_REL
@@ -106,3 +134,4 @@ Symbols:
     - Name: D1
       Type: STT_OBJECT
     - Name: D2
+...





More information about the llvm-commits mailing list