From 2ec304c0bf308c5c304412c56ca8f6d69c0b94fc Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Sat, 12 May 2012 16:31:10 +0000 Subject: 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 --- test/MC/AsmParser/macro-rept-err1.s | 6 ++++++ test/MC/AsmParser/macro-rept-err2.s | 7 +++++++ test/MC/AsmParser/macro-rept.s | 22 ++++++++++++++++++++++ 3 files changed, 35 insertions(+) create mode 100644 test/MC/AsmParser/macro-rept-err1.s create mode 100644 test/MC/AsmParser/macro-rept-err2.s create mode 100644 test/MC/AsmParser/macro-rept.s (limited to 'test/MC') 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 -- cgit v1.2.3