summaryrefslogtreecommitdiff
path: root/test/MC
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2012-05-12 16:31:10 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2012-05-12 16:31:10 +0000
commit2ec304c0bf308c5c304412c56ca8f6d69c0b94fc (patch)
treeda83d35577cc44cb16b6730d9831dbd9be9d21b7 /test/MC
parent6a80f9da8c2cb2cbf931ec8cf2a72b5f288c1bc6 (diff)
downloadllvm-2ec304c0bf308c5c304412c56ca8f6d69c0b94fc.tar.gz
llvm-2ec304c0bf308c5c304412c56ca8f6d69c0b94fc.tar.bz2
llvm-2ec304c0bf308c5c304412c56ca8f6d69c0b94fc.tar.xz
Add support for the .rept directive. Patch by Vladmir Sorokin. I added support
for nesting. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156714 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/MC')
-rw-r--r--test/MC/AsmParser/macro-rept-err1.s6
-rw-r--r--test/MC/AsmParser/macro-rept-err2.s7
-rw-r--r--test/MC/AsmParser/macro-rept.s22
3 files changed, 35 insertions, 0 deletions
diff --git a/test/MC/AsmParser/macro-rept-err1.s b/test/MC/AsmParser/macro-rept-err1.s
new file mode 100644
index 0000000000..db92856a1d
--- /dev/null
+++ b/test/MC/AsmParser/macro-rept-err1.s
@@ -0,0 +1,6 @@
+// RUN: not llvm-mc -triple x86_64-unknown-unknown %s 2> %t
+// RUN: FileCheck < %t %s
+
+.endr
+
+// CHECK: unexpected '.endr' directive, no current .rept
diff --git a/test/MC/AsmParser/macro-rept-err2.s b/test/MC/AsmParser/macro-rept-err2.s
new file mode 100644
index 0000000000..678b4c7eee
--- /dev/null
+++ b/test/MC/AsmParser/macro-rept-err2.s
@@ -0,0 +1,7 @@
+// RUN: not llvm-mc -triple x86_64-unknown-unknown %s 2> %t
+// RUN: FileCheck < %t %s
+
+.rept 3
+.long
+
+// CHECK: no matching '.endr' in definition
diff --git a/test/MC/AsmParser/macro-rept.s b/test/MC/AsmParser/macro-rept.s
new file mode 100644
index 0000000000..1dc8060e1d
--- /dev/null
+++ b/test/MC/AsmParser/macro-rept.s
@@ -0,0 +1,22 @@
+// RUN: llvm-mc -triple x86_64-unknown-unknown %s | FileCheck %s
+
+.rept 2
+ .long 1
+.endr
+
+.rept 3
+.rept 2
+ .long 0
+.endr
+.endr
+
+// CHECK: .long 1
+// CHECK: .long 1
+
+// CHECK: .long 0
+// CHECK: .long 0
+// CHECK: .long 0
+
+// CHECK: .long 0
+// CHECK: .long 0
+// CHECK: .long 0