armeb, // ARM (big endian): armeb
aarch64, // AArch64 (little endian): aarch64
aarch64_be, // AArch64 (big endian): aarch64_be
+ avr, // AVR: Atmel AVR microcontroller
bpfel, // eBPF or extended BPF or 64-bit BPF (little endian)
bpfeb, // eBPF or extended BPF or 64-bit BPF (big endian)
hexagon, // Hexagon: hexagon
case aarch64_be: return "aarch64_be";
case arm: return "arm";
case armeb: return "armeb";
+ case avr: return "avr";
case bpfel: return "bpfel";
case bpfeb: return "bpfeb";
case hexagon: return "hexagon";
case thumb:
case thumbeb: return "arm";
+ case avr: return "avr";
+
case ppc64:
case ppc64le:
case ppc: return "ppc";
.Case("arm64", aarch64) // "arm64" is an alias for "aarch64"
.Case("arm", arm)
.Case("armeb", armeb)
+ .Case("avr", avr)
.StartsWith("bpf", BPFArch)
.Case("mips", mips)
.Case("mipsel", mipsel)
.Case("armeb", Triple::armeb)
.Case("thumb", Triple::thumb)
.Case("thumbeb", Triple::thumbeb)
+ .Case("avr", Triple::avr)
.Case("msp430", Triple::msp430)
.Cases("mips", "mipseb", "mipsallegrex", Triple::mips)
.Cases("mipsel", "mipsallegrexel", Triple::mipsel)
case llvm::Triple::UnknownArch:
return 0;
+ case llvm::Triple::avr:
case llvm::Triple::msp430:
return 16;
case Triple::aarch64:
case Triple::aarch64_be:
case Triple::amdgcn:
+ case Triple::avr:
case Triple::bpfel:
case Triple::bpfeb:
case Triple::msp430:
case Triple::UnknownArch:
case Triple::arm:
case Triple::armeb:
+ case Triple::avr:
case Triple::hexagon:
case Triple::kalimba:
case Triple::msp430:
case Triple::amdgcn:
case Triple::amdil64:
case Triple::amdil:
+ case Triple::avr:
case Triple::hexagon:
case Triple::hsail64:
case Triple::hsail:
case Triple::amdil64:
case Triple::amdil:
case Triple::arm:
+ case Triple::avr:
case Triple::bpfel:
case Triple::hexagon:
case Triple::hsail64:
EXPECT_EQ(Triple::UnknownOS, T.getOS());
EXPECT_EQ(Triple::UnknownEnvironment, T.getEnvironment());
+ T = Triple("avr-unknown-unknown");
+ EXPECT_EQ(Triple::avr, T.getArch());
+ EXPECT_EQ(Triple::UnknownVendor, T.getVendor());
+ EXPECT_EQ(Triple::UnknownOS, T.getOS());
+ EXPECT_EQ(Triple::UnknownEnvironment, T.getEnvironment());
+
+ T = Triple("avr");
+ EXPECT_EQ(Triple::avr, T.getArch());
+ EXPECT_EQ(Triple::UnknownVendor, T.getVendor());
+ EXPECT_EQ(Triple::UnknownOS, T.getOS());
+ EXPECT_EQ(Triple::UnknownEnvironment, T.getEnvironment());
+
T = Triple("huh");
EXPECT_EQ(Triple::UnknownArch, T.getArch());
}
EXPECT_FALSE(T.isArch16Bit());
EXPECT_FALSE(T.isArch32Bit());
EXPECT_TRUE(T.isArch64Bit());
+
+ T.setArch(Triple::avr);
+ EXPECT_TRUE(T.isArch16Bit());
+ EXPECT_FALSE(T.isArch32Bit());
+ EXPECT_FALSE(T.isArch64Bit());
}
TEST(TripleTest, BitWidthArchVariants) {