summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorVenkatraman Govindaraju <venkatra@cs.wisc.edu>2014-03-01 02:18:04 +0000
committerVenkatraman Govindaraju <venkatra@cs.wisc.edu>2014-03-01 02:18:04 +0000
commit17e95370047926ea4eb1f263667959456731e042 (patch)
tree33490a1b6eb667afa952b615aabb556748227a7b /test
parentc9bf74fdc543c2da90f334e0bf8e34b128c8a615 (diff)
downloadllvm-17e95370047926ea4eb1f263667959456731e042.tar.gz
llvm-17e95370047926ea4eb1f263667959456731e042.tar.bz2
llvm-17e95370047926ea4eb1f263667959456731e042.tar.xz
[Sparc] Add support for parsing directives in SparcAsmParser.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202564 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/CodeGen/SPARC/mature-mc-support.ll2
-rw-r--r--test/MC/Sparc/sparc-directive-xword.s10
-rw-r--r--test/MC/Sparc/sparc-directives.s19
3 files changed, 29 insertions, 2 deletions
diff --git a/test/CodeGen/SPARC/mature-mc-support.ll b/test/CodeGen/SPARC/mature-mc-support.ll
index c4f8f8dd02..4ed3309805 100644
--- a/test/CodeGen/SPARC/mature-mc-support.ll
+++ b/test/CodeGen/SPARC/mature-mc-support.ll
@@ -2,8 +2,6 @@
; (even when the output is assembly).
; FIXME: SPARC doesn't use the integrated assembler by default in all cases
; so we only test that -filetype=obj tries to parse the assembly.
-; FIXME: SPARC seems to accept directives that don't exist
-; XFAIL: *
; SKIP: not llc -march=sparc < %s > /dev/null 2> %t1
; SKIP: FileCheck %s < %t1
diff --git a/test/MC/Sparc/sparc-directive-xword.s b/test/MC/Sparc/sparc-directive-xword.s
new file mode 100644
index 0000000000..0c9e249a6a
--- /dev/null
+++ b/test/MC/Sparc/sparc-directive-xword.s
@@ -0,0 +1,10 @@
+! RUN: not llvm-mc %s -arch=sparc -show-encoding 2>&1 | FileCheck %s --check-prefix=SPARC32
+! RUN: llvm-mc %s -arch=sparcv9 -show-encoding | FileCheck %s --check-prefix=SPARC64
+
+ ! SPARC32: error: unknown directive
+ ! SPARC32-NEXT: .xword 65536
+ ! SPARC32-NEXT: ^
+
+ ! SPARC64: .xword 65536
+ .xword 65536
+
diff --git a/test/MC/Sparc/sparc-directives.s b/test/MC/Sparc/sparc-directives.s
new file mode 100644
index 0000000000..9185e4bc9b
--- /dev/null
+++ b/test/MC/Sparc/sparc-directives.s
@@ -0,0 +1,19 @@
+! RUN: llvm-mc %s -arch=sparc -show-encoding | FileCheck %s --check-prefix=SPARC32
+! RUN: llvm-mc %s -arch=sparcv9 -show-encoding | FileCheck %s --check-prefix=SPARC64
+
+ ! SPARC32: .byte 24
+ ! SPARC64: .byte 24
+ .byte 24
+
+ ! SPARC32: .half 1024
+ ! SPARC64: .half 1024
+ .half 1024
+
+ ! SPARC32: .word 65536
+ ! SPARC64: .word 65536
+ .word 65536
+
+ ! SPARC32: .word 65536
+ ! SPARC64: .xword 65536
+ .nword 65536
+