aboutsummaryrefslogtreecommitdiffstats
path: root/test/MC
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
commita0527a92adae8c6e3db84cafcef81921e5fe790c (patch)
tree89e76fdb73b893ab20a7e7eb83bcc0c1d429a748 /test/MC
parentba83d7c950a813b2d87b386397e7e086a014acd9 (diff)
downloadexternal_llvm-a0527a92adae8c6e3db84cafcef81921e5fe790c.zip
external_llvm-a0527a92adae8c6e3db84cafcef81921e5fe790c.tar.gz
external_llvm-a0527a92adae8c6e3db84cafcef81921e5fe790c.tar.bz2
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/MC')
-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 0000000..ebd8418
--- /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 0000000..95e194a
--- /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 0000000..ec8bdf2
--- /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 0000000..6159775
--- /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 0000000..39ba068
--- /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