[llvm] 3b2b83c - [AVR] Add $ separator string (like avr-gcc)

Ayke van Laethem via llvm-commits llvm-commits at lists.llvm.org
Sun Nov 27 06:31:33 PST 2022


Author: Ayke van Laethem
Date: 2022-11-27T15:28:17+01:00
New Revision: 3b2b83ce2f6bb32fc73dbd303c791cabf16c8218

URL: https://github.com/llvm/llvm-project/commit/3b2b83ce2f6bb32fc73dbd303c791cabf16c8218
DIFF: https://github.com/llvm/llvm-project/commit/3b2b83ce2f6bb32fc73dbd303c791cabf16c8218.diff

LOG: [AVR] Add $ separator string (like avr-gcc)

avr-gcc uses the $ symbol as an assembly separator instead of the more
common %% syntax. We need it in LLVM too to be compatible.

Differential Revision: https://reviews.llvm.org/D138535

Added: 
    llvm/test/MC/AVR/separator.s

Modified: 
    llvm/lib/Target/AVR/MCTargetDesc/AVRMCAsmInfo.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/AVR/MCTargetDesc/AVRMCAsmInfo.cpp b/llvm/lib/Target/AVR/MCTargetDesc/AVRMCAsmInfo.cpp
index b11ee42bfcd6e..c377721b09ba9 100644
--- a/llvm/lib/Target/AVR/MCTargetDesc/AVRMCAsmInfo.cpp
+++ b/llvm/lib/Target/AVR/MCTargetDesc/AVRMCAsmInfo.cpp
@@ -20,6 +20,7 @@ AVRMCAsmInfo::AVRMCAsmInfo(const Triple &TT, const MCTargetOptions &Options) {
   CodePointerSize = 2;
   CalleeSaveStackSlotSize = 2;
   CommentString = ";";
+  SeparatorString = "$";
   PrivateGlobalPrefix = ".L";
   PrivateLabelPrefix = ".L";
   UsesELFSectionDirectiveForBSS = true;

diff  --git a/llvm/test/MC/AVR/separator.s b/llvm/test/MC/AVR/separator.s
new file mode 100644
index 0000000000000..c62e01bda93d6
--- /dev/null
+++ b/llvm/test/MC/AVR/separator.s
@@ -0,0 +1,11 @@
+; RUN: llvm-mc -filetype=obj -triple avr < %s | llvm-objdump -d - | FileCheck %s
+
+foo:
+
+  ; The $ symbol is a separator (like a newline).
+  mov r0, r1 $ mov r1, r2 $ mov r2, r3 $ mov r3, r4
+
+; CHECK: mov r0, r1
+; CHECK: mov r1, r2
+; CHECK: mov r2, r3
+; CHECK: mov r3, r4


        


More information about the llvm-commits mailing list