1 ## The file testing Nop insertion with R_LARCH_ALIGN for relaxation.
3 # RUN: llvm-mc --filetype=obj --triple=loongarch64 --mattr=-relax %s -o %t
4 # RUN: llvm-objdump -d %t | FileCheck %s --check-prefix=INSTR
5 # RUN: llvm-readobj -r %t | FileCheck %s --check-prefix=RELOC
6 # RUN: llvm-mc --filetype=obj --triple=loongarch64 --mattr=+relax %s -o %t.r
7 # RUN: llvm-objdump -d %t.r | FileCheck %s --check-prefixes=INSTR,RELAX-INSTR
8 # RUN: llvm-readobj -r %t.r | FileCheck %s --check-prefixes=RELOC,RELAX-RELOC
14 ## Not emit R_LARCH_ALIGN if alignment directive is less than or equal to
15 ## minimum code alignment(a.k.a 4).
20 ## Not emit instructions if max emit bytes less than min nop size.
23 ## Not emit R_LARCH_ALIGN if alignment directive with specific padding value.
24 ## The behavior is the same as GNU assembler.
28 # INSTR-COUNT-2: 01 01 01 01
33 # INSTR-COUNT-3: 01 01 01 01
45 # RELAX-INSTR-COUNT-7: nop
50 # RELAX-INSTR-COUNT-3: nop
53 ## Not emit the third parameter.
58 # RELAX-INSTR-NEXT: nop
63 ## Test the symbol index is different from .text.
69 # RELOC: Relocations [
70 # RELAX-RELOC-NEXT: Section ({{.*}}) .rela.text {
71 # RELAX-RELOC-NEXT: 0x24 R_LARCH_ALIGN - 0xC
72 # RELAX-RELOC-NEXT: 0x34 R_LARCH_ALIGN - 0x1C
73 # RELAX-RELOC-NEXT: 0x50 R_LARCH_ALIGN - 0xC
74 # RELAX-RELOC-NEXT: 0x60 R_LARCH_ALIGN .Lla-relax-align0 0xB04
75 # RELAX-RELOC-NEXT: 0x70 R_LARCH_ALIGN - 0xC
77 # RELAX-RELOC-NEXT: Section ({{.*}}) .rela.text2 {
78 # RELAX-RELOC-NEXT: 0x0 R_LARCH_ALIGN - 0xC
79 # RELAX-RELOC-NEXT: 0xC R_LARCH_ALIGN .Lla-relax-align1 0x404