[lld] r239180 - [Mips] Add test to check jal -> jalx conversion

Simon Atanasyan simon at atanasyan.com
Fri Jun 5 11:26:44 PDT 2015


Author: atanasyan
Date: Fri Jun  5 13:26:44 2015
New Revision: 239180

URL: http://llvm.org/viewvc/llvm-project?rev=239180&view=rev
Log:
[Mips] Add test to check jal -> jalx conversion

No functional changes.

Added:
    lld/trunk/test/elf/Mips/jalx.test

Added: lld/trunk/test/elf/Mips/jalx.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf/Mips/jalx.test?rev=239180&view=auto
==============================================================================
--- lld/trunk/test/elf/Mips/jalx.test (added)
+++ lld/trunk/test/elf/Mips/jalx.test Fri Jun  5 13:26:44 2015
@@ -0,0 +1,71 @@
+# Check jal => jalx conversion in case of mixed microMIPS and regular code.
+
+# RUN: yaml2obj -format=elf %s > %t.o
+# RUN: lld -flavor gnu -target mipsel -e T1 -o %t.exe %t.o
+# RUN: llvm-objdump -s %t.exe | FileCheck -check-prefix=RAW %s
+# RUN: llvm-nm %t.exe | FileCheck -check-prefix=SYM %s
+
+# RAW:      Contents of section .text:
+# RAW-NEXT:  400110 00000000 44001074 10f04500 46001074
+
+# SYM: 00400118 T M1
+# SYM: 00400110 T M2
+# SYM: 0040011c T T1
+# SYM: 00400114 T T2
+
+FileHeader:
+  Class:    ELFCLASS32
+  Data:     ELFDATA2LSB
+  Type:     ET_REL
+  Machine:  EM_MIPS
+  Flags:    [EF_MIPS_NOREORDER, EF_MIPS_CPIC, EF_MIPS_ABI_O32,
+             EF_MIPS_MICROMIPS, EF_MIPS_ARCH_32R2]
+
+Sections:
+  - Name:          .text
+    Type:          SHT_PROGBITS
+    Flags:         [ SHF_ALLOC, SHF_EXECINSTR ]
+    AddressAlign:  16
+    Content:       "000000000000000c00f400000000000c"
+#                   ^ M2    ^ T2    ^ M1    ^ T1
+
+  - Name:          .rel.text
+    Type:          SHT_REL
+    Link:          .symtab
+    AddressAlign:  4
+    Info:          .text
+    Relocations:
+      - Offset:  4
+        Symbol:  M2
+        Type:    R_MIPS_26
+      - Offset:  8
+        Symbol:  T2
+        Type:    R_MICROMIPS_26_S1
+      - Offset:  12
+        Symbol:  M1
+        Type:    R_MIPS_26
+
+Symbols:
+  Global:
+    - Name:     M2
+      Type:     STT_FUNC
+      Section:  .text
+      Value:    0
+      Size:     4
+      Other:    [ STO_MIPS_MICROMIPS ]
+    - Name:     T2
+      Type:     STT_FUNC
+      Section:  .text
+      Value:    4
+      Size:     4
+    - Name:     M1
+      Type:     STT_FUNC
+      Section:  .text
+      Value:    8
+      Size:     4
+      Other:    [ STO_MIPS_MICROMIPS ]
+    - Name:     T1
+      Type:     STT_FUNC
+      Section:  .text
+      Value:    12
+      Size:     4





More information about the llvm-commits mailing list