mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-22 18:54:02 +01:00
Use unsigned rather than uint16_t in case anyone feels like testing
more graphs, like all graphs with 5 nodes or less. With a 32 bit unsigned type, the maximum is graphs with 6 nodes or less, but that would take a while to test - 5 nodes or less already requires a few seconds. llvm-svn: 136354
This commit is contained in:
parent
bda9b8bd4b
commit
cfca795839
@ -251,8 +251,8 @@ TEST(SCCIteratorTest, AllSmallGraphs) {
|
|||||||
#define NUM_GRAPHS (NUM_NODES * (NUM_NODES - 1))
|
#define NUM_GRAPHS (NUM_NODES * (NUM_NODES - 1))
|
||||||
|
|
||||||
/// GraphDescriptor - Enumerate all graphs using NUM_GRAPHS bits.
|
/// GraphDescriptor - Enumerate all graphs using NUM_GRAPHS bits.
|
||||||
uint16_t GraphDescriptor = 0;
|
unsigned GraphDescriptor = 0;
|
||||||
assert(NUM_GRAPHS <= sizeof(uint16_t) * CHAR_BIT && "Too many graphs!");
|
assert(NUM_GRAPHS <= sizeof(unsigned) * CHAR_BIT && "Too many graphs!");
|
||||||
|
|
||||||
do {
|
do {
|
||||||
typedef Graph<NUM_NODES> GT;
|
typedef Graph<NUM_NODES> GT;
|
||||||
@ -260,7 +260,7 @@ TEST(SCCIteratorTest, AllSmallGraphs) {
|
|||||||
GT G;
|
GT G;
|
||||||
|
|
||||||
// Add edges as specified by the descriptor.
|
// Add edges as specified by the descriptor.
|
||||||
uint16_t DescriptorCopy = GraphDescriptor;
|
unsigned DescriptorCopy = GraphDescriptor;
|
||||||
for (unsigned i = 0; i != NUM_NODES; ++i)
|
for (unsigned i = 0; i != NUM_NODES; ++i)
|
||||||
for (unsigned j = 0; j != NUM_NODES; ++j) {
|
for (unsigned j = 0; j != NUM_NODES; ++j) {
|
||||||
// Always add a self-edge.
|
// Always add a self-edge.
|
||||||
@ -344,7 +344,7 @@ TEST(SCCIteratorTest, AllSmallGraphs) {
|
|||||||
EXPECT_EQ(NodesInSomeSCC, G.NodesReachableFrom(0));
|
EXPECT_EQ(NodesInSomeSCC, G.NodesReachableFrom(0));
|
||||||
|
|
||||||
++GraphDescriptor;
|
++GraphDescriptor;
|
||||||
} while (GraphDescriptor && (unsigned)GraphDescriptor < (1U << NUM_GRAPHS));
|
} while (GraphDescriptor && GraphDescriptor < (1U << NUM_GRAPHS));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user