[obj2yaml] - Fix a comment. NFC.
[llvm-complete.git] / test / MC / Mips / micromips-branch-fixup.s
blob3ad625fa4c13dc8effed26022a4f771e635397a1
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: beqz16 $6, bar # encoding: [0b0AAAAAAA,0x8f]
11 # CHECK-FIXUP: # fixup A - offset: 0,
12 # CHECK-FIXUP: value: bar, kind: fixup_MICROMIPS_PC7_S1
13 # CHECK-FIXUP: nop # encoding: [0x00,0x00,0x00,0x00]
14 # CHECK-FIXUP: bnez16 $6, bar # encoding: [0b0AAAAAAA,0xaf]
15 # CHECK-FIXUP: # fixup A - offset: 0,
16 # CHECK-FIXUP: value: bar, kind: fixup_MICROMIPS_PC7_S1
17 # CHECK-FIXUP: nop # encoding: [0x00,0x00,0x00,0x00]
18 # CHECK-FIXUP: b16 bar # encoding: [A,0b110011AA]
19 # CHECK-FIXUP: # fixup A - offset: 0,
20 # CHECK-FIXUP: value: bar, kind: fixup_MICROMIPS_PC10_S1
21 # CHECK-FIXUP: nop # encoding: [0x00,0x00,0x00,0x00]
22 # CHECK-FIXUP: b bar # encoding: [A,0x94'A',0x00,0x00]
23 # CHECK-FIXUP: # fixup A - offset: 0,
24 # CHECK-FIXUP: value: bar, kind: fixup_MICROMIPS_PC16_S1
25 # CHECK-FIXUP: nop # encoding: [0x00,0x0c]
26 # CHECK-FIXUP: beq $3, $4, bar # encoding: [0x83'A',0x94'A',0x00,0x00]
27 # CHECK-FIXUP: # fixup A - offset: 0, value: bar, kind: fixup_MICROMIPS_PC16_S1
28 # CHECK-FIXUP: nop # encoding: [0x00,0x0c]
29 # CHECK-FIXUP: bne $3, $4, bar # encoding: [0x83'A',0xb4'A',0x00,0x00]
30 # CHECK-FIXUP: # fixup A - offset: 0, value: bar, kind: fixup_MICROMIPS_PC16_S1
31 # CHECK-FIXUP: nop # encoding: [0x00,0x0c]
32 # CHECK-FIXUP: bgez $4, bar # encoding: [0x44'A',0x40'A',0x00,0x00]
33 # CHECK-FIXUP-NEXT: # fixup A - offset: 0, value: bar, kind: fixup_MICROMIPS_PC16_S1
34 # CHECK-FIXUP-NEXT: nop # encoding: [0x00,0x0c]
35 # CHECK-FIXUP: bgtz $4, bar # encoding: [0xc4'A',0x40'A',0x00,0x00]
36 # CHECK-FIXUP-NEXT: # fixup A - offset: 0, value: bar, kind: fixup_MICROMIPS_PC16_S1
37 # CHECK-FIXUP-NEXT: nop # encoding: [0x00,0x0c]
38 # CHECK-FIXUP: blez $4, bar # encoding: [0x84'A',0x40'A',0x00,0x00]
39 # CHECK-FIXUP-NEXT: # fixup A - offset: 0, value: bar, kind: fixup_MICROMIPS_PC16_S1
40 # CHECK-FIXUP-NEXT: nop # encoding: [0x00,0x0c]
41 # CHECK-FIXUP: bltz $4, bar # encoding: [0x04'A',0x40'A',0x00,0x00]
42 # CHECK-FIXUP-NEXT: # fixup A - offset: 0, value: bar, kind: fixup_MICROMIPS_PC16_S1
43 # CHECK-FIXUP-NEXT: nop # encoding: [0x00,0x0c]
44 # CHECK-FIXUP: bgezal $4, bar # encoding: [0x64'A',0x40'A',0x00,0x00]
45 # CHECK-FIXUP: # fixup A - offset: 0,
46 # CHECK-FIXUP: value: bar, kind: fixup_MICROMIPS_PC16_S1
47 # CHECK-FIXUP: nop # encoding: [0x00,0x00,0x00,0x00]
48 # CHECK-FIXUP: bltzal $4, bar # encoding: [0x24'A',0x40'A',0x00,0x00]
49 # CHECK-FIXUP: # fixup A - offset: 0,
50 # CHECK-FIXUP: value: bar, kind: fixup_MICROMIPS_PC16_S1
51 # CHECK-FIXUP: nop # encoding: [0x00,0x00,0x00,0x00]
52 #------------------------------------------------------------------------------
53 # Check that the appropriate relocations were created.
54 #------------------------------------------------------------------------------
55 # CHECK-ELF: Relocations [
56 # CHECK-ELF: 0x{{[0-9,A-F]+}} R_MICROMIPS_PC7_S1
57 # CHECK-ELF: 0x{{[0-9,A-F]+}} R_MICROMIPS_PC7_S1
58 # CHECK-ELF: 0x{{[0-9,A-F]+}} R_MICROMIPS_PC10_S1
59 # CHECK-ELF: 0x{{[0-9,A-F]+}} R_MICROMIPS_PC16_S1
60 # CHECK-ELF: 0x{{[0-9,A-F]+}} R_MICROMIPS_PC16_S1
61 # CHECK-ELF: 0x{{[0-9,A-F]+}} R_MICROMIPS_PC16_S1
62 # CHECK-ELF: 0x{{[0-9,A-F]+}} R_MICROMIPS_PC16_S1
63 # CHECK-ELF: 0x{{[0-9,A-F]+}} R_MICROMIPS_PC16_S1
64 # CHECK-ELF: 0x{{[0-9,A-F]+}} R_MICROMIPS_PC16_S1
65 # CHECK-ELF: 0x{{[0-9,A-F]+}} R_MICROMIPS_PC16_S1
66 # CHECK-ELF: 0x{{[0-9,A-F]+}} R_MICROMIPS_PC16_S1
67 # CHECK-ELF: 0x{{[0-9,A-F]+}} R_MICROMIPS_PC16_S1
68 # CHECK-ELF: ]
70 .text
71 .type main, @function
72 .set micromips
73 main:
74 beqz16 $6, bar
75 bnez16 $6, bar
76 b16 bar
77 b bar
78 beq $3, $4, bar
79 bne $3, $4, bar
80 bgez $4, bar
81 bgtz $4, bar
82 blez $4, bar
83 bltz $4, bar
84 bgezal $4, bar
85 bltzal $4, bar