summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDavid Majnemer <david.majnemer@gmail.com>2014-01-29 18:57:46 +0000
committerDavid Majnemer <david.majnemer@gmail.com>2014-01-29 18:57:46 +0000
commit654247c3ea3304b434cb3f0dcf69338073651158 (patch)
treebbc783928f594d94a66da4a5a2bcfa75bd0fb2dc /test
parentfb70e11bbcbe57bb7a6295e2f3ae1a1a71af02d4 (diff)
downloadllvm-654247c3ea3304b434cb3f0dcf69338073651158.tar.gz
llvm-654247c3ea3304b434cb3f0dcf69338073651158.tar.bz2
llvm-654247c3ea3304b434cb3f0dcf69338073651158.tar.xz
MC: Better management of macro arguments
The linux kernel makes uses of a GAS `feature' which substitutes nothing for macro arguments which aren't specified. Proper support for these kind of macro arguments necessitated a cleanup of differences between `GAS' and `Darwin' dialect macro processing. Differential Revision: http://llvm-reviews.chandlerc.com/D2634 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200409 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/MC/AsmParser/macros-darwin.s8
-rw-r--r--test/MC/AsmParser/macros-gas.s28
2 files changed, 16 insertions, 20 deletions
diff --git a/test/MC/AsmParser/macros-darwin.s b/test/MC/AsmParser/macros-darwin.s
index c4061f0663..e22038e7d1 100644
--- a/test/MC/AsmParser/macros-darwin.s
+++ b/test/MC/AsmParser/macros-darwin.s
@@ -86,12 +86,8 @@ test8 x - y, z, 1
// CHECK: .globl "1 2 3"
test9 1, 2,3
+// CHECK: .globl "1,23,"
test8 1,2 3
-// CHECK-ERRORS: error: macro argument '_c' is missing
-// CHECK-ERRORS-NEXT: test8 1,2 3
-// CHECK-ERRORS-NEXT: ^
+// CHECK: .globl "12,3,"
test8 1 2, 3
-// CHECK-ERRORS: error: macro argument '_c' is missing
-// CHECK-ERRORS-NEXT:test8 1 2, 3
-// CHECK-ERRORS-NEXT: ^
diff --git a/test/MC/AsmParser/macros-gas.s b/test/MC/AsmParser/macros-gas.s
index 39f654dd9a..6c75363b5e 100644
--- a/test/MC/AsmParser/macros-gas.s
+++ b/test/MC/AsmParser/macros-gas.s
@@ -32,17 +32,21 @@ test2 10
// CHECK: .ascii "1 2 3 \003"
test3 1, 2, 3
-// FIXME: test3 1, 2 3 should be treated like test 1, 2, 3
+// CHECK: .ascii "1 2 3 \003"
+test3 1, 2 3
+
+.macro test3_prime _a _b _c
+.ascii "\_a \_b \_c"
+.endm
-// FIXME: remove the n argument from the remaining test3 examples
-// CHECK: .ascii "1 (23) n \n"
-test3 1, (2 3), n
+// CHECK: .ascii "1 (23) "
+test3_prime 1, (2 3)
-// CHECK: .ascii "1 (23) n \n"
-test3 1 (2 3) n
+// CHECK: .ascii "1 (23) "
+test3_prime 1 (2 3)
-// CHECK: .ascii "1 2 n \n"
-test3 1 2 n
+// CHECK: .ascii "1 2 "
+test3_prime 1 2
.macro test5 _a
.globl \_a
@@ -82,12 +86,8 @@ test8 x - y z 1
// CHECK: .ascii "1 2 3"
test9 1, 2,3
+// CHECK: .ascii "1,2,3"
test8 1,2 3
-// CHECK-ERRORS: error: macro argument '_c' is missing
-// CHECK-ERRORS-NEXT: test8 1,2 3
-// CHECK-ERRORS-NEXT: ^
+// CHECK: .ascii "1,2,3"
test8 1 2, 3
-// CHECK-ERRORS: error: expected ' ' for macro argument separator
-// CHECK-ERRORS-NEXT:test8 1 2, 3
-// CHECK-ERRORS-NEXT: ^