1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 19:12:56 +02:00

Exhaustively test all triples in TripleTest.

Iteration over all permutations didn't really work,
due to evolution of the underlying enums.

Differential Revision: http://reviews.llvm.org/D9057

llvm-svn: 236251
This commit is contained in:
Douglas Katzman 2015-04-30 20:08:44 +00:00
parent c3f1d1307f
commit c5f5be748a
2 changed files with 11 additions and 7 deletions

View File

@ -82,7 +82,8 @@ public:
hsail64, // AMD HSAIL with 64-bit pointers hsail64, // AMD HSAIL with 64-bit pointers
spir, // SPIR: standard portable IR for OpenCL 32-bit version spir, // SPIR: standard portable IR for OpenCL 32-bit version
spir64, // SPIR: standard portable IR for OpenCL 64-bit version spir64, // SPIR: standard portable IR for OpenCL 64-bit version
kalimba // Kalimba: generic kalimba kalimba, // Kalimba: generic kalimba
LastArchType = kalimba
}; };
enum SubArchType { enum SubArchType {
NoSubArch, NoSubArch,
@ -118,7 +119,8 @@ public:
ImaginationTechnologies, ImaginationTechnologies,
MipsTechnologies, MipsTechnologies,
NVIDIA, NVIDIA,
CSR CSR,
LastVendorType = CSR
}; };
enum OSType { enum OSType {
UnknownOS, UnknownOS,
@ -146,7 +148,8 @@ public:
CUDA, // NVIDIA CUDA CUDA, // NVIDIA CUDA
NVCL, // NVIDIA OpenCL NVCL, // NVIDIA OpenCL
AMDHSA, // AMD HSA Runtime AMDHSA, // AMD HSA Runtime
PS4 PS4,
LastOSType = PS4
}; };
enum EnvironmentType { enum EnvironmentType {
UnknownEnvironment, UnknownEnvironment,
@ -163,6 +166,7 @@ public:
MSVC, MSVC,
Itanium, Itanium,
Cygnus, Cygnus,
LastEnvironmentType = Cygnus
}; };
enum ObjectFormatType { enum ObjectFormatType {
UnknownObjectFormat, UnknownObjectFormat,

View File

@ -225,12 +225,12 @@ TEST(TripleTest, Normalization) {
// Check that normalizing a permutated set of valid components returns a // Check that normalizing a permutated set of valid components returns a
// triple with the unpermuted components. // triple with the unpermuted components.
StringRef C[4]; StringRef C[4];
for (int Arch = 1+Triple::UnknownArch; Arch <= Triple::amdil; ++Arch) { for (int Arch = 1+Triple::UnknownArch; Arch <= Triple::LastArchType; ++Arch) {
C[0] = Triple::getArchTypeName(Triple::ArchType(Arch)); C[0] = Triple::getArchTypeName(Triple::ArchType(Arch));
for (int Vendor = 1+Triple::UnknownVendor; Vendor <= Triple::PC; for (int Vendor = 1+Triple::UnknownVendor; Vendor <= Triple::LastVendorType;
++Vendor) { ++Vendor) {
C[1] = Triple::getVendorTypeName(Triple::VendorType(Vendor)); C[1] = Triple::getVendorTypeName(Triple::VendorType(Vendor));
for (int OS = 1+Triple::UnknownOS; OS <= Triple::Minix; ++OS) { for (int OS = 1+Triple::UnknownOS; OS <= Triple::LastOSType; ++OS) {
if (OS == Triple::Win32) if (OS == Triple::Win32)
continue; continue;
@ -245,7 +245,7 @@ TEST(TripleTest, Normalization) {
EXPECT_EQ(E, Triple::normalize(Join(C[2], C[0], C[1]))); EXPECT_EQ(E, Triple::normalize(Join(C[2], C[0], C[1])));
EXPECT_EQ(E, Triple::normalize(Join(C[2], C[1], C[0]))); EXPECT_EQ(E, Triple::normalize(Join(C[2], C[1], C[0])));
for (int Env = 1 + Triple::UnknownEnvironment; Env <= Triple::Android; for (int Env = 1 + Triple::UnknownEnvironment; Env <= Triple::LastEnvironmentType;
++Env) { ++Env) {
C[3] = Triple::getEnvironmentTypeName(Triple::EnvironmentType(Env)); C[3] = Triple::getEnvironmentTypeName(Triple::EnvironmentType(Env));