summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Stellard <thomas.stellard@amd.com>2015-11-07 02:40:48 +0000
committerTom Stellard <thomas.stellard@amd.com>2015-11-07 02:40:48 +0000
commitc0b785171b418b751f653c7ac67095513b638a6c (patch)
treeb481b689f82419f037548eb966b221743ffa91c8
parent832552ac7e33292dee207d1ae652ff66dc18f6e3 (diff)
downloadllvm-c0b785171b418b751f653c7ac67095513b638a6c.tar.gz
Merging r244221:
------------------------------------------------------------------------ r244221 | dougk | 2015-08-06 11:44:12 -0400 (Thu, 06 Aug 2015) | 4 lines [SPARC] Don't compare arch name as a string, use the enum instead. Fixes PR22695 ------------------------------------------------------------------------ llvm-svn: 252393
-rw-r--r--llvm/lib/Target/Sparc/AsmParser/SparcAsmParser.cpp2
-rw-r--r--llvm/test/MC/Sparc/sparc-directive-xword.s5
2 files changed, 5 insertions, 2 deletions
diff --git a/llvm/lib/Target/Sparc/AsmParser/SparcAsmParser.cpp b/llvm/lib/Target/Sparc/AsmParser/SparcAsmParser.cpp
index 4a33f7fc3467..1c4e486da418 100644
--- a/llvm/lib/Target/Sparc/AsmParser/SparcAsmParser.cpp
+++ b/llvm/lib/Target/Sparc/AsmParser/SparcAsmParser.cpp
@@ -77,7 +77,7 @@ class SparcAsmParser : public MCTargetAsmParser {
bool parseDirectiveWord(unsigned Size, SMLoc L);
bool is64Bit() const {
- return STI.getTargetTriple().getArchName().startswith("sparcv9");
+ return STI.getTargetTriple().getArch() == Triple::sparcv9;
}
void expandSET(MCInst &Inst, SMLoc IDLoc,
diff --git a/llvm/test/MC/Sparc/sparc-directive-xword.s b/llvm/test/MC/Sparc/sparc-directive-xword.s
index 0c9e249a6ad3..736f99fbce74 100644
--- a/llvm/test/MC/Sparc/sparc-directive-xword.s
+++ b/llvm/test/MC/Sparc/sparc-directive-xword.s
@@ -1,5 +1,6 @@
! 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
+! RUN: llvm-mc %s -triple sparc64 -show-encoding | FileCheck %s --check-prefix=SPARC64
+! RUN: llvm-mc %s -triple sparcv9 -show-encoding | FileCheck %s --check-prefix=SPARCV9
! SPARC32: error: unknown directive
! SPARC32-NEXT: .xword 65536
@@ -8,3 +9,5 @@
! SPARC64: .xword 65536
.xword 65536
+ ! SPARCV9: .xword 65536
+ .xword 65536