• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# RUN: llvm-mc %s -triple=mipsel-unknown-linux -show-encoding \
2# RUN: -mattr=micromips | FileCheck %s -check-prefix=CHECK-FIXUP
3# RUN: llvm-mc %s -filetype=obj -triple=mipsel-unknown-linux \
4# RUN: -mattr=micromips | llvm-readobj -r \
5# RUN: | FileCheck %s -check-prefix=CHECK-ELF
6#------------------------------------------------------------------------------
7# Check that the assembler can handle the documented syntax
8# for relocations.
9#------------------------------------------------------------------------------
10# CHECK-FIXUP: foo:
11# CHECK-FIXUP:   addiu $2, $zero, 1332
12# CHECK-FIXUP:         # encoding: [0x40,0x30,0x34,0x05]
13# CHECK-FIXUP:   j foo # encoding: [A,0xd4'A',A,0b000000AA]
14# CHECK-FIXUP:         #   fixup A - offset: 0,
15# CHECK-FIXUP:             value: foo, kind: fixup_MICROMIPS_26_S1
16# CHECK-FIXUP:   nop   # encoding: [0x00,0x00,0x00,0x00]
17#------------------------------------------------------------------------------
18# Check that the appropriate relocations were created.
19#------------------------------------------------------------------------------
20# CHECK-ELF: Relocations [
21# CHECK-ELF:     0x{{[0-9,A-F]+}} R_MICROMIPS_26_S1
22# CHECK-ELF: ]
23
24foo:
25  addiu $2, $0, 1332
26  j foo
27