[llvm] r236251 - Exhaustively test all triples in TripleTest.
Douglas Katzman
dougk at google.com
Thu Apr 30 13:08:45 PDT 2015
Author: dougk
Date: Thu Apr 30 15:08:44 2015
New Revision: 236251
URL: http://llvm.org/viewvc/llvm-project?rev=236251&view=rev
Log:
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
Modified:
llvm/trunk/include/llvm/ADT/Triple.h
llvm/trunk/unittests/ADT/TripleTest.cpp
Modified: llvm/trunk/include/llvm/ADT/Triple.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/Triple.h?rev=236251&r1=236250&r2=236251&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ADT/Triple.h (original)
+++ llvm/trunk/include/llvm/ADT/Triple.h Thu Apr 30 15:08:44 2015
@@ -82,7 +82,8 @@ public:
hsail64, // AMD HSAIL with 64-bit pointers
spir, // SPIR: standard portable IR for OpenCL 32-bit version
spir64, // SPIR: standard portable IR for OpenCL 64-bit version
- kalimba // Kalimba: generic kalimba
+ kalimba, // Kalimba: generic kalimba
+ LastArchType = kalimba
};
enum SubArchType {
NoSubArch,
@@ -118,7 +119,8 @@ public:
ImaginationTechnologies,
MipsTechnologies,
NVIDIA,
- CSR
+ CSR,
+ LastVendorType = CSR
};
enum OSType {
UnknownOS,
@@ -146,7 +148,8 @@ public:
CUDA, // NVIDIA CUDA
NVCL, // NVIDIA OpenCL
AMDHSA, // AMD HSA Runtime
- PS4
+ PS4,
+ LastOSType = PS4
};
enum EnvironmentType {
UnknownEnvironment,
@@ -163,6 +166,7 @@ public:
MSVC,
Itanium,
Cygnus,
+ LastEnvironmentType = Cygnus
};
enum ObjectFormatType {
UnknownObjectFormat,
Modified: llvm/trunk/unittests/ADT/TripleTest.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/ADT/TripleTest.cpp?rev=236251&r1=236250&r2=236251&view=diff
==============================================================================
--- llvm/trunk/unittests/ADT/TripleTest.cpp (original)
+++ llvm/trunk/unittests/ADT/TripleTest.cpp Thu Apr 30 15:08:44 2015
@@ -225,12 +225,12 @@ TEST(TripleTest, Normalization) {
// Check that normalizing a permutated set of valid components returns a
// triple with the unpermuted components.
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));
- for (int Vendor = 1+Triple::UnknownVendor; Vendor <= Triple::PC;
+ for (int Vendor = 1+Triple::UnknownVendor; Vendor <= Triple::LastVendorType;
++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)
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[1], C[0])));
- for (int Env = 1 + Triple::UnknownEnvironment; Env <= Triple::Android;
+ for (int Env = 1 + Triple::UnknownEnvironment; Env <= Triple::LastEnvironmentType;
++Env) {
C[3] = Triple::getEnvironmentTypeName(Triple::EnvironmentType(Env));
More information about the llvm-commits
mailing list