[llvm] [LoongArch] Insert nops and emit align reloc when handle alignment directive (PR #72962)

Lu Weining via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 16 05:04:36 PST 2024


================
@@ -0,0 +1,53 @@
+# RUN: llvm-mc --filetype=obj --triple=loongarch64 --mattr=-relax %s \
+# RUN:     | llvm-readelf -rs - | FileCheck %s --check-prefix=NORELAX
+# RUN: llvm-mc --filetype=obj --triple=loongarch64 --mattr=+relax %s \
+# RUN:     | llvm-readelf -rs - | FileCheck %s --check-prefix=RELAX
+# RUN: llvm-mc --filetype=obj --triple=loongarch64 --mattr=+relax %s \
+# RUN:     | llvm-objdump -d - | FileCheck -check-prefix=RELAX-INST %s
+
+# NORELAX: There are no relocations in this file.
+# NORELAX: Symbol table '.symtab' contains 1 entries:
+
+# RELAX:       0000000000000000  0000000100000066 R_LARCH_ALIGN          0000000000000000 {{.*}} + 4
+# RELAX-NEXT:  0000000000000010  0000000100000066 R_LARCH_ALIGN          0000000000000000 {{.*}} + 5
+# RELAX-NEXT:  000000000000002c  0000000100000066 R_LARCH_ALIGN          0000000000000000 {{.*}} + 4
+# RELAX-NEXT:  000000000000003c  0000000100000066 R_LARCH_ALIGN          0000000000000000 {{.*}} + b04
+# RELAX-NEXT:  0000000000000048  0000000100000066 R_LARCH_ALIGN          0000000000000000 {{.*}} + 4
+# RELAX-EMPTY:
+# RELAX:       0000000000000000  0000000200000066 R_LARCH_ALIGN          0000000000000000 <null> + 4
+# RELAX-EMPTY:
+# RELAX:       Symbol table '.symtab' contains 3 entries:
----------------
SixWeining wrote:

Why we should check symbol table? To check the temp symbol `.Lla-relax-align` is generated?

https://github.com/llvm/llvm-project/pull/72962


More information about the llvm-commits mailing list