unsigned ID = StringSwitch<unsigned>(Arch)
#define ARM_ARCH_NAME(NAME, ID, DEFAULT_CPU_NAME, DEFAULT_CPU_ARCH) \
.Case(NAME, ARM::ID)
+#define ARM_ARCH_ALIAS(NAME, ID) \
+ .Case(NAME, ARM::ID)
#include "MCTargetDesc/ARMArchName.def"
.Default(ARM::INVALID_ARCH);
ARM_ARCH_NAME("armv6-m", ARMV6M, "6-M", v6_M)
ARM_ARCH_NAME("armv7", ARMV7, "7", v7)
ARM_ARCH_NAME("armv7-a", ARMV7A, "7-A", v7)
+ARM_ARCH_ALIAS("armv7a", ARMV7A)
ARM_ARCH_NAME("armv7-r", ARMV7R, "7-R", v7)
+ARM_ARCH_ALIAS("armv7r", ARMV7R)
ARM_ARCH_NAME("armv7-m", ARMV7M, "7-M", v7)
+ARM_ARCH_ALIAS("armv7m", ARMV7M)
ARM_ARCH_NAME("armv8-a", ARMV8A, "8-A", v8)
+ARM_ARCH_ALIAS("armv8a", ARMV8A)
ARM_ARCH_NAME("iwmmxt", IWMMXT, "iwmmxt", v5TE)
ARM_ARCH_NAME("iwmmxt2", IWMMXT2, "iwmmxt2", v5TE)
#undef ARM_ARCH_NAME
+#undef ARM_ARCH_ALIAS
INVALID_ARCH = 0
#define ARM_ARCH_NAME(NAME, ID, DEFAULT_CPU_NAME, DEFAULT_CPU_ARCH) , ID
+#define ARM_ARCH_ALIAS(NAME, ID) /* empty */
#include "ARMArchName.def"
};
break;
#define ARM_ARCH_NAME(NAME, ID, DEFAULT_CPU_NAME, DEFAULT_CPU_ARCH) \
case ARM::ID: return NAME;
+#define ARM_ARCH_ALIAS(NAME, ID) /* empty */
#include "ARMArchName.def"
}
return NULL;
break;
#define ARM_ARCH_NAME(NAME, ID, DEFAULT_CPU_NAME, DEFAULT_CPU_ARCH) \
case ARM::ID: return DEFAULT_CPU_NAME;
+#define ARM_ARCH_ALIAS(NAME, ID) /* empty */
#include "ARMArchName.def"
}
return NULL;
break;
#define ARM_ARCH_NAME(NAME, ID, DEFAULT_CPU_NAME, DEFAULT_CPU_ARCH) \
case ARM::ID: return ARMBuildAttrs::DEFAULT_CPU_ARCH;
+#define ARM_ARCH_ALIAS(NAME, ID) /* empty */
#include "ARMArchName.def"
}
return 0;
--- /dev/null
+@ Test the .arch directive for armv7-a
+
+@ This test case will check the default .ARM.attributes value for the
+@ armv7-a architecture when using the armv7a alias.
+
+@ RUN: llvm-mc < %s -triple=arm-linux-gnueabi -filetype=asm \
+@ RUN: | FileCheck %s --check-prefix=CHECK-ASM
+@ RUN: llvm-mc < %s -triple=arm-linux-gnueabi -filetype=obj \
+@ RUN: | llvm-readobj -s -sd | FileCheck %s --check-prefix=CHECK-OBJ
+
+ .syntax unified
+ .arch armv7a
+
+@ CHECK-ASM: .arch armv7-a
+
+@ CHECK-OBJ: Name: .ARM.attributes
+@ CHECK-OBJ: Type: SHT_ARM_ATTRIBUTES (0x70000003)
+@ CHECK-OBJ: Flags [ (0x0)
+@ CHECK-OBJ: ]
+@ CHECK-OBJ: Address: 0x0
+@ CHECK-OBJ: Offset: 0x34
+@ CHECK-OBJ: Size: 29
+@ CHECK-OBJ: Link: 0
+@ CHECK-OBJ: Info: 0
+@ CHECK-OBJ: AddressAlignment: 1
+@ CHECK-OBJ: EntrySize: 0
+@ CHECK-OBJ: SectionData (
+@ CHECK-OBJ: 0000: 411C0000 00616561 62690001 12000000 |A....aeabi......|
+@ CHECK-OBJ: 0010: 05372D41 00060A07 41080109 02 |.7-A....A....|
+@ CHECK-OBJ: )
--- /dev/null
+@ Test the .arch directive for armv7-m
+
+@ This test case will check the default .ARM.attributes value for the
+@ armv7-m architecture when using the armv7m alias.
+
+@ RUN: llvm-mc < %s -triple=arm-linux-gnueabi -filetype=asm \
+@ RUN: | FileCheck %s --check-prefix=CHECK-ASM
+@ RUN: llvm-mc < %s -triple=arm-linux-gnueabi -filetype=obj \
+@ RUN: | llvm-readobj -s -sd | FileCheck %s --check-prefix=CHECK-OBJ
+
+ .syntax unified
+ .arch armv7m
+
+@ CHECK-ASM: .arch armv7-m
+
+@ CHECK-OBJ: Name: .ARM.attributes
+@ CHECK-OBJ: Type: SHT_ARM_ATTRIBUTES (0x70000003)
+@ CHECK-OBJ: Flags [ (0x0)
+@ CHECK-OBJ: ]
+@ CHECK-OBJ: Address: 0x0
+@ CHECK-OBJ: Offset: 0x34
+@ CHECK-OBJ: Size: 27
+@ CHECK-OBJ: Link: 0
+@ CHECK-OBJ: Info: 0
+@ CHECK-OBJ: AddressAlignment: 1
+@ CHECK-OBJ: EntrySize: 0
+@ CHECK-OBJ: SectionData (
+@ CHECK-OBJ: 0000: 411A0000 00616561 62690001 10000000 |A....aeabi......|
+@ CHECK-OBJ: 0010: 05372D4D 00060A07 4D0902 |.7-M....M..|
+@ CHECK-OBJ: )
--- /dev/null
+@ Test the .arch directive for armv7-r
+
+@ This test case will check the default .ARM.attributes value for the
+@ armv7-r architecture when using the armv7r alias.
+
+@ RUN: llvm-mc < %s -triple=arm-linux-gnueabi -filetype=asm \
+@ RUN: | FileCheck %s --check-prefix=CHECK-ASM
+@ RUN: llvm-mc < %s -triple=arm-linux-gnueabi -filetype=obj \
+@ RUN: | llvm-readobj -s -sd | FileCheck %s --check-prefix=CHECK-OBJ
+
+ .syntax unified
+ .arch armv7r
+
+@ CHECK-ASM: .arch armv7-r
+
+@ CHECK-OBJ: Name: .ARM.attributes
+@ CHECK-OBJ: Type: SHT_ARM_ATTRIBUTES (0x70000003)
+@ CHECK-OBJ: Flags [ (0x0)
+@ CHECK-OBJ: ]
+@ CHECK-OBJ: Address: 0x0
+@ CHECK-OBJ: Offset: 0x34
+@ CHECK-OBJ: Size: 29
+@ CHECK-OBJ: Link: 0
+@ CHECK-OBJ: Info: 0
+@ CHECK-OBJ: AddressAlignment: 1
+@ CHECK-OBJ: EntrySize: 0
+@ CHECK-OBJ: SectionData (
+@ CHECK-OBJ: 0000: 411C0000 00616561 62690001 12000000 |A....aeabi......|
+@ CHECK-OBJ: 0010: 05372D52 00060A07 52080109 02 |.7-R....R....|
+@ CHECK-OBJ: )
--- /dev/null
+@ Test the .arch directive for armv8-a
+
+@ This test case will check the default .ARM.attributes value for the
+@ armv8-a architecture when using the armv8a alias.
+
+@ RUN: llvm-mc < %s -triple=arm-linux-gnueabi -filetype=asm \
+@ RUN: | FileCheck %s --check-prefix=CHECK-ASM
+@ RUN: llvm-mc < %s -triple=arm-linux-gnueabi -filetype=obj \
+@ RUN: | llvm-readobj -s -sd | FileCheck %s --check-prefix=CHECK-OBJ
+
+ .syntax unified
+ .arch armv8a
+
+@ CHECK-ASM: .arch armv8-a
+
+@ CHECK-OBJ: Name: .ARM.attributes
+@ CHECK-OBJ: Type: SHT_ARM_ATTRIBUTES (0x70000003)
+@ CHECK-OBJ: Flags [ (0x0)
+@ CHECK-OBJ: ]
+@ CHECK-OBJ: Address: 0x0
+@ CHECK-OBJ: Offset: 0x34
+@ CHECK-OBJ: Size: 33
+@ CHECK-OBJ: Link: 0
+@ CHECK-OBJ: Info: 0
+@ CHECK-OBJ: AddressAlignment: 1
+@ CHECK-OBJ: EntrySize: 0
+@ CHECK-OBJ: SectionData (
+@ CHECK-OBJ: 0000: 41200000 00616561 62690001 16000000 |A ...aeabi......|
+@ CHECK-OBJ: 0010: 05382D41 00060E07 41080109 022A0144 |.8-A....A....*.D|
+@ CHECK-OBJ: 0020: 03 |.|
+@ CHECK-OBJ: )