1 # RUN: llvm-mc %s -triple=mips-unknown-linux -show-encoding -mcpu=mips32r6 \ 2 # RUN: -mattr=micromips | FileCheck %s -check-prefix=CHECK-FIXUP 3 # RUN: llvm-mc %s -filetype=obj -triple=mips-unknown-linux -mcpu=mips32r6 \ 4 # RUN: -mattr=micromips | llvm-readobj -r | FileCheck %s -check-prefix=CHECK-ELF 5 #------------------------------------------------------------------------------ 6 # Check that the assembler can handle the documented syntax for fixups. 7 #------------------------------------------------------------------------------ 8 # CHECK-FIXUP: balc bar # encoding: [0b101101AA,A,A,A] 9 # CHECK-FIXUP: # fixup A - offset: 0, 10 # CHECK-FIXUP: value: bar-4, kind: fixup_MICROMIPS_PC26_S1 11 # CHECK-FIXUP: bc bar # encoding: [0b100101AA,A,A,A] 12 # CHECK-FIXUP: # fixup A - offset: 0, 13 # CHECK-FIXUP: value: bar-4, kind: fixup_MICROMIPS_PC26_S1 14 # CHECK-FIXUP: addiupc $2, bar # encoding: [0x78,0b01000AAA,A,A] 15 # CHECK-FIXUP: # fixup A - offset: 0, 16 # CHECK-FIXUP: value: bar, kind: fixup_MICROMIPS_PC19_S2 17 # CHECK-FIXUP: lwpc $2, bar # encoding: [0x78,0b01001AAA,A,A] 18 # CHECK-FIXUP: # fixup A - offset: 0, 19 # CHECK-FIXUP: value: bar, kind: fixup_MICROMIPS_PC19_S2 20 # CHECK-FIXUP: beqzc $3, bar # encoding: [0x80,0b011AAAAA,A,A] 21 # CHECK-FIXUP: # fixup A - offset: 0, 22 # CHECK-FIXUP: value: bar-4, kind: fixup_MICROMIPS_PC21_S1 23 # CHECK-FIXUP: bnezc $3, bar # encoding: [0xa0,0b011AAAAA,A,A] 24 # CHECK-FIXUP: # fixup A - offset: 0, 25 # CHECK-FIXUP: value: bar-4, kind: fixup_MICROMIPS_PC21_S1 26 #------------------------------------------------------------------------------ 27 # Check that the appropriate relocations were created. 28 #------------------------------------------------------------------------------ 29 # CHECK-ELF: Relocations [ 30 # CHECK-ELF: 0x0 R_MICROMIPS_PC26_S1 bar 0x0 31 # CHECK-ELF: 0x4 R_MICROMIPS_PC26_S1 bar 0x0 32 # CHECK-ELF: 0x8 R_MICROMIPS_PC19_S2 bar 0x0 33 # CHECK-ELF: 0xC R_MICROMIPS_PC19_S2 bar 0x0 34 # CHECK-ELF: 0x10 R_MICROMIPS_PC21_S1 bar 0x0 35 # CHECK-ELF: 0x14 R_MICROMIPS_PC21_S1 bar 0x0 36 # CHECK-ELF: ] 37 38 balc bar 39 bc bar 40 addiupc $2,bar 41 lwpc $2,bar 42 beqzc $3, bar 43 bnezc $3, bar 44