[lld] r331995 - [ELF][MIPS] Add test case to check some microMIPS R6 relocations. NFC

Simon Atanasyan via llvm-commits llvm-commits at lists.llvm.org
Thu May 10 08:56:28 PDT 2018


Author: atanasyan
Date: Thu May 10 08:56:27 2018
New Revision: 331995

URL: http://llvm.org/viewvc/llvm-project?rev=331995&view=rev
Log:
[ELF][MIPS] Add test case to check some microMIPS R6 relocations. NFC

Added:
    lld/trunk/test/ELF/mips-micror6-relocs.s

Added: lld/trunk/test/ELF/mips-micror6-relocs.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/mips-micror6-relocs.s?rev=331995&view=auto
==============================================================================
--- lld/trunk/test/ELF/mips-micror6-relocs.s (added)
+++ lld/trunk/test/ELF/mips-micror6-relocs.s Thu May 10 08:56:27 2018
@@ -0,0 +1,38 @@
+# REQUIRES: mips
+
+# Check handling of microMIPS R6 relocations.
+
+# RUN: llvm-mc -filetype=obj -triple=mips -mcpu=mips32r6 \
+# RUN:         %S/Inputs/mips-micro.s -o %t1eb.o
+# RUN: llvm-mc -filetype=obj -triple=mips -mcpu=mips32r6 %s -o %t2eb.o
+# RUN: ld.lld -o %teb.exe %t1eb.o %t2eb.o
+# RUN: llvm-objdump -d -t -mattr=micromips %teb.exe \
+# RUN:   | FileCheck --check-prefixes=EB,SYM %s
+
+# RUN: llvm-mc -filetype=obj -triple=mipsel -mcpu=mips32r6 \
+# RUN:         %S/Inputs/mips-micro.s -o %t1el.o
+# RUN: llvm-mc -filetype=obj -triple=mipsel -mcpu=mips32r6 %s -o %t2el.o
+# RUN: ld.lld -o %tel.exe %t1el.o %t2el.o
+# RUN: llvm-objdump -d -t -mattr=micromips %tel.exe \
+# RUN:   | FileCheck --check-prefixes=EL,SYM %s
+
+# EB:      __start:
+# EB-NEXT:    20010:  78 47 ff fd  lapc   $2, -12
+# EB-NEXT:    20014:  80 7f ff f6  beqzc  $3, -36
+# EB-NEXT:    20018:  b7 ff ff f4  balc   -24 <foo>
+
+# EL:      __start:
+# EL-NEXT:    20010:  47 78 fd ff  lapc   $2, -12
+# EL-NEXT:    20014:  7f 80 f6 ff  beqzc  $3, -36
+# EL-NEXT:    20018:  ff b7 f4 ff  balc   -24 <foo>
+
+# SYM: 00020000 g F     .text           00000000 foo
+# SYM: 00020010         .text           00000000 __start
+
+  .text
+  .set micromips
+  .global __start
+__start:
+  addiupc $2, foo+4   # R_MICROMIPS_PC19_S2
+  beqzc   $3, foo+4   # R_MICROMIPS_PC21_S1
+  balc    foo+4       # R_MICROMIPS_PC26_S1




More information about the llvm-commits mailing list