[SPARC] Don't compare arch name as a string, use the enum instead.
authorDouglas Katzman <dougk@google.com>
Thu, 6 Aug 2015 15:44:12 +0000 (15:44 +0000)
committerDouglas Katzman <dougk@google.com>
Thu, 6 Aug 2015 15:44:12 +0000 (15:44 +0000)
Fixes PR22695

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244221 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/Sparc/AsmParser/SparcAsmParser.cpp
test/MC/Sparc/sparc-directive-xword.s

index fc56bf9ad8e849a66e8f0ca61ffebd51e4d87230..bba5c5ed176516233585255ff46a89196ffeed81 100644 (file)
@@ -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,
index 0c9e249a6ad35bb1923de9423d593dffc37521f2..736f99fbce744f690df21de18a500213bdc0a5c3 100644 (file)
@@ -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