Skip to content

Commit 558d9e8

Browse files
committed
[llvm][ARM] Treat xscale arch as an alias of armv5te
Previously xscale was known to everything apart from the ELF streamer so we would crash as soon as you tried to output an object file. Reviewed By: nickdesaulniers Differential Revision: https://reviews.llvm.org/D104776
1 parent ef78325 commit 558d9e8

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed

llvm/lib/Target/ARM/MCTargetDesc/ARMELFStreamer.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -834,6 +834,7 @@ void ARMTargetELFStreamer::emitArchDefaultAttributes() {
834834

835835
case ARM::ArchKind::ARMV4T:
836836
case ARM::ArchKind::ARMV5T:
837+
case ARM::ArchKind::XSCALE:
837838
case ARM::ArchKind::ARMV5TE:
838839
case ARM::ArchKind::ARMV6:
839840
setAttributeItem(ARM_ISA_use, Allowed, false);
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
@@ Test the .arch directive for xscale
2+
3+
@@ This test case will check the default .ARM.attributes value for the
4+
@@ xscale architecture.
5+
6+
@ RUN: llvm-mc -triple arm-eabi -filetype asm %s \
7+
@ RUN: | FileCheck %s -check-prefix CHECK-ASM
8+
@ RUN: llvm-mc -triple arm-eabi -filetype obj %s \
9+
@ RUN: | llvm-readobj --arch-specific - | FileCheck %s -check-prefix CHECK-ATTR
10+
11+
.syntax unified
12+
.arch xscale
13+
14+
@ CHECK-ASM: .arch xscale
15+
16+
@ CHECK-ATTR: FileAttributes {
17+
@ CHECK-ATTR: Attribute {
18+
@ CHECK-ATTR: TagName: CPU_name
19+
@ CHECK-ATTR: Value: xscale
20+
@ CHECK-ATTR: }
21+
@ CHECK-ATTR: Attribute {
22+
@ CHECK-ATTR: TagName: CPU_arch
23+
@ CHECK-ATTR: Description: ARM v5TE
24+
@ CHECK-ATTR: }
25+
@ CHECK-ATTR: Attribute {
26+
@ CHECK-ATTR: TagName: ARM_ISA_use
27+
@ CHECK-ATTR: Description: Permitted
28+
@ CHECK-ATTR: }
29+
@ CHECK-ATTR: Attribute {
30+
@ CHECK-ATTR: TagName: THUMB_ISA_use
31+
@ CHECK-ATTR: Description: Thumb-1
32+
@ CHECK-ATTR: }
33+
@ CHECK-ATTR: }
34+

0 commit comments

Comments
 (0)