From 8cf77b256e0ece9190e57201ae7365369e42220b Mon Sep 17 00:00:00 2001
From: Iain Sandoe <iain@sandoe.co.uk>
Date: Sun, 19 Oct 2014 23:48:52 +0100
Subject: [PATCH] [llvm, Darwin, ppc] Use the same separator char as
 cctools as.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Use the same separator and comment chars as ‘cctools as’ for compatibility with existing assembler sources.
---
 .../darwin-comment-and-separator-chars.s      | 20 +++++++++++++++++++
 1 file changed, 20 insertions(+)
 create mode 100644 llvm/test/MC/PowerPC/darwin-comment-and-separator-chars.s

diff --git a/llvm/test/MC/PowerPC/darwin-comment-and-separator-chars.s b/llvm/test/MC/PowerPC/darwin-comment-and-separator-chars.s
new file mode 100644
index 00000000000..d248dbfbb21
--- /dev/null
+++ b/llvm/test/MC/PowerPC/darwin-comment-and-separator-chars.s
@@ -0,0 +1,20 @@
+# RUN: llvm-mc -triple powerpc-darwin --show-encoding %s | \
+# RUN:         FileCheck -check-prefix=CHECK %s
+# RUN: llvm-mc -triple powerpc64-darwin --show-encoding %s | \
+# RUN:         FileCheck -check-prefix=CHECK %s
+
+# This tests that we accept the in-line comment and separator chars that
+# were used by cctools for compatibility with existing code.
+
+# Passing thus far shows that '#' is OK for a line start comment.
+
+# Here's a function on one line with delimiters.
+
+	.globl _foo @ _foo: @ addi r3,r3,1 @ blr
+# CHECK: blr ; encoding: [0x4e,0x80,0x00,0x20]
+
+# Here's a use for the in-line comment marker.
+_bar:
+	addi r3,r3,1 ; this is OK for an in-line comment
+# CHECK: addi r3, r3, 1 ; encoding: [0x38,0x63,0x00,0x01]
+	blr
