Home | History | Annotate | Download | only in Mips
      1 # RUN: llvm-mc %s -triple=mipsel -show-encoding -mattr=micromips \
      2 # RUN: | FileCheck %s -check-prefix=CHECK-EL
      3 # RUN: llvm-mc %s -triple=mips -show-encoding -mattr=micromips \
      4 # RUN: | FileCheck %s -check-prefix=CHECK-EB
      5 # Check that the assembler can handle the documented syntax
      6 # for jump and branch instructions.
      7 #------------------------------------------------------------------------------
      8 # Jump instructions
      9 #------------------------------------------------------------------------------
     10 # Little endian
     11 #------------------------------------------------------------------------------
     12 # CHECK-EL: j 1328      # encoding: [0x00,0xd4,0x98,0x02]
     13 # CHECK-EL: nop         # encoding: [0x00,0x00,0x00,0x00]
     14 # CHECK-EL: jal 1328    # encoding: [0x00,0xf4,0x98,0x02]
     15 # CHECK-EL: nop         # encoding: [0x00,0x00,0x00,0x00]
     16 # CHECK-EL: jalr $ra, $6 # encoding: [0xe6,0x03,0x3c,0x0f]
     17 # CHECK-EL: nop         # encoding: [0x00,0x00,0x00,0x00]
     18 # CHECK-EL: jr $7       # encoding: [0x07,0x00,0x3c,0x0f]
     19 # CHECK-EL: nop         # encoding: [0x00,0x00,0x00,0x00]
     20 # CHECK-EL: jr $7       # encoding: [0x07,0x00,0x3c,0x0f]
     21 # CHECK-EL: nop         # encoding: [0x00,0x00,0x00,0x00]
     22 #------------------------------------------------------------------------------
     23 # Big endian
     24 #------------------------------------------------------------------------------
     25 # CHECK-EB: j 1328      # encoding: [0xd4,0x00,0x02,0x98]
     26 # CHECK-EB: nop         # encoding: [0x00,0x00,0x00,0x00]
     27 # CHECK-EB: jal 1328    # encoding: [0xf4,0x00,0x02,0x98]
     28 # CHECK-EB: nop         # encoding: [0x00,0x00,0x00,0x00]
     29 # CHECK-EB: jalr $ra, $6 # encoding: [0x03,0xe6,0x0f,0x3c]
     30 # CHECK-EB: nop         # encoding: [0x00,0x00,0x00,0x00]
     31 # CHECK-EB: jr $7       # encoding: [0x00,0x07,0x0f,0x3c]
     32 # CHECK-EB: nop         # encoding: [0x00,0x00,0x00,0x00]
     33 # CHECK-EB: jr $7       # encoding: [0x00,0x07,0x0f,0x3c]
     34 # CHECK-EB: nop         # encoding: [0x00,0x00,0x00,0x00]
     35 
     36      j 1328
     37      jal 1328
     38      jalr $ra, $6
     39      jr $7
     40      j $7
     41