[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:34 PST 2024


================
@@ -0,0 +1,22 @@
+# RUN: llvm-mc --filetype=obj --triple=loongarch64 --mattr=+relax %s \
+# RUN:     | llvm-readobj -r - | FileCheck --check-prefixes=CHECK,RELAX %s
+# RUN: llvm-mc --filetype=obj --triple=loongarch64 --mattr=-relax %s \
+# RUN:     | llvm-readobj -r - | FileCheck %s
+
+.section ".dummy", "a"
+.L1:
+  la.pcrel $t0, sym
+.p2align 3
+.L2:
----------------
SixWeining wrote:

If the aim of this test is to check R_LARCH_ALIGN is not generated for non executable section, seems `.L2 - .L1` is  unnecessary. Use any other simple instruction is enough.

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


More information about the llvm-commits mailing list