summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-06-24 23:30:00 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-06-24 23:30:00 +0000
commita0d1426af0bd05e1ae69481cdb75d2913e7e1ac1 (patch)
tree89e76fdb73b893ab20a7e7eb83bcc0c1d429a748 /test
parent023dd3fb0b2ea3ffd26b672829e4806a9b892b81 (diff)
downloadllvm-a0d1426af0bd05e1ae69481cdb75d2913e7e1ac1.tar.gz
llvm-a0d1426af0bd05e1ae69481cdb75d2913e7e1ac1.tar.bz2
llvm-a0d1426af0bd05e1ae69481cdb75d2913e7e1ac1.tar.xz
Basic .s parsing for .asci[iz], .fill, .space, {.byte, .short, ... }
- Includes some DG tests in test/MC/AsmParser, which are rather primitive since we don't have a -verify mode yet. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74139 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/MC/AsmParser/dg.exp3
-rw-r--r--test/MC/AsmParser/directive_ascii.s25
-rw-r--r--test/MC/AsmParser/directive_fill.s11
-rw-r--r--test/MC/AsmParser/directive_space.s11
-rw-r--r--test/MC/AsmParser/directive_values.s21
5 files changed, 71 insertions, 0 deletions
diff --git a/test/MC/AsmParser/dg.exp b/test/MC/AsmParser/dg.exp
new file mode 100644
index 0000000000..ebd84187f5
--- /dev/null
+++ b/test/MC/AsmParser/dg.exp
@@ -0,0 +1,3 @@
+load_lib llvm.exp
+
+RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{s}]]
diff --git a/test/MC/AsmParser/directive_ascii.s b/test/MC/AsmParser/directive_ascii.s
new file mode 100644
index 0000000000..95e194a376
--- /dev/null
+++ b/test/MC/AsmParser/directive_ascii.s
@@ -0,0 +1,25 @@
+# RUN: llvm-mc %s > %t
+
+# RUN: grep -A 1 TEST0 %t > %t2
+# RUN: not grep ".byte" %t2
+TEST0:
+ .ascii
+
+# RUN: grep -A 1 TEST1 %t > %t2
+# RUN: not grep "byte" %t2
+TEST1:
+ .asciz
+
+# RUN: grep -A 2 TEST2 %t > %t2
+# RUN: grep ".byte 65" %t2 | count 1
+TEST2:
+ .ascii "A"
+
+# RUN: grep -A 5 TEST3 %t > %t2
+# RUN: grep ".byte 66" %t2 | count 1
+# RUN: grep ".byte 67" %t2 | count 1
+# RUN: grep ".byte 0" %t2 | count 2
+TEST3:
+ .asciz "B", "C"
+
+ \ No newline at end of file
diff --git a/test/MC/AsmParser/directive_fill.s b/test/MC/AsmParser/directive_fill.s
new file mode 100644
index 0000000000..ec8bdf27c7
--- /dev/null
+++ b/test/MC/AsmParser/directive_fill.s
@@ -0,0 +1,11 @@
+# RUN: llvm-mc %s > %t
+
+# RUN: grep -A 2 TEST0 %t > %t2
+# RUN: grep ".byte 10" %t2 | count 1
+TEST0:
+ .fill 1, 1, 10
+
+# RUN: grep -A 3 TEST1 %t > %t2
+# RUN: grep ".short 3" %t2 | count 2
+TEST1:
+ .fill 2, 2, 3
diff --git a/test/MC/AsmParser/directive_space.s b/test/MC/AsmParser/directive_space.s
new file mode 100644
index 0000000000..6159775de4
--- /dev/null
+++ b/test/MC/AsmParser/directive_space.s
@@ -0,0 +1,11 @@
+# RUN: llvm-mc %s > %t
+
+# RUN: grep -A 2 TEST0 %t > %t2
+# RUN: grep ".byte 0" %t2 | count 1
+TEST0:
+ .space 1
+
+# RUN: grep -A 3 TEST1 %t > %t2
+# RUN: grep ".byte 3" %t2 | count 2
+TEST1:
+ .space 2, 3
diff --git a/test/MC/AsmParser/directive_values.s b/test/MC/AsmParser/directive_values.s
new file mode 100644
index 0000000000..39ba068923
--- /dev/null
+++ b/test/MC/AsmParser/directive_values.s
@@ -0,0 +1,21 @@
+# RUN: llvm-mc %s > %t
+
+# RUN: grep -A 2 TEST0 %t > %t2
+# RUN: grep ".byte 0" %t2 | count 1
+TEST0:
+ .byte 0
+
+# RUN: grep -A 2 TEST1 %t > %t2
+# RUN: grep ".short 3" %t2 | count 1
+TEST1:
+ .short 3
+
+# RUN: grep -A 2 TEST2 %t > %t2
+# RUN: grep ".long 8" %t2 | count 1
+TEST2:
+ .long 8
+
+# RUN: grep -A 2 TEST3 %t > %t2
+# RUN: grep ".quad 9" %t2 | count 1
+TEST3:
+ .quad 9