Skip to content

Commit 75e2ec6

Browse files
committed
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 ------------------------------------------------------------------------ git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_37@252393 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent 40c245c commit 75e2ec6

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

lib/Target/Sparc/AsmParser/SparcAsmParser.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ class SparcAsmParser : public MCTargetAsmParser {
7777
bool parseDirectiveWord(unsigned Size, SMLoc L);
7878

7979
bool is64Bit() const {
80-
return STI.getTargetTriple().getArchName().startswith("sparcv9");
80+
return STI.getTargetTriple().getArch() == Triple::sparcv9;
8181
}
8282

8383
void expandSET(MCInst &Inst, SMLoc IDLoc,

test/MC/Sparc/sparc-directive-xword.s

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
! RUN: not llvm-mc %s -arch=sparc -show-encoding 2>&1 | FileCheck %s --check-prefix=SPARC32
2-
! RUN: llvm-mc %s -arch=sparcv9 -show-encoding | FileCheck %s --check-prefix=SPARC64
2+
! RUN: llvm-mc %s -triple sparc64 -show-encoding | FileCheck %s --check-prefix=SPARC64
3+
! RUN: llvm-mc %s -triple sparcv9 -show-encoding | FileCheck %s --check-prefix=SPARCV9
34

45
! SPARC32: error: unknown directive
56
! SPARC32-NEXT: .xword 65536
@@ -8,3 +9,5 @@
89
! SPARC64: .xword 65536
910
.xword 65536
1011

12+
! SPARCV9: .xword 65536
13+
.xword 65536

0 commit comments

Comments
 (0)