Reducing stack usage of test
This test has a lot of classes with large amounts of manually inserted padding in them, presumably to prevent various optimizations. The test then creates lots of these objects on the stack. On embedded targets, this was usually enough to overflow the stack. I moved the objects to global / namespace scope. Since the tests are each in their own namespace, there should be no cross-test conflicts. llvm-svn: 262717
This commit is contained in:
parent
6c3856d850
commit
5d78477ba1
|
@ -213,20 +213,20 @@ struct A13
|
|||
A13* getA13() {return this;}
|
||||
};
|
||||
|
||||
A3 a3;
|
||||
A4 a4;
|
||||
A5 a5;
|
||||
A6 a6;
|
||||
A7 a7;
|
||||
A8 a8;
|
||||
A9 a9;
|
||||
A10 a10;
|
||||
A11 a11;
|
||||
A12 a12;
|
||||
A13 a13;
|
||||
|
||||
void test()
|
||||
{
|
||||
A3 a3;
|
||||
A4 a4;
|
||||
A5 a5;
|
||||
A6 a6;
|
||||
A7 a7;
|
||||
A8 a8;
|
||||
A9 a9;
|
||||
A10 a10;
|
||||
A11 a11;
|
||||
A12 a12;
|
||||
A13 a13;
|
||||
|
||||
assert(dynamic_cast<A3*>(a3.getA1_3()) == a3.getA3());
|
||||
assert(dynamic_cast<A3*>(a3.getA2()) == a3.getA3());
|
||||
|
||||
|
@ -934,20 +934,20 @@ struct A13
|
|||
A13* getA13() {return this;}
|
||||
};
|
||||
|
||||
A3 a3;
|
||||
A4 a4;
|
||||
A5 a5;
|
||||
A6 a6;
|
||||
A7 a7;
|
||||
A8 a8;
|
||||
A9 a9;
|
||||
A10 a10;
|
||||
A11 a11;
|
||||
A12 a12;
|
||||
A13 a13;
|
||||
|
||||
void test()
|
||||
{
|
||||
A3 a3;
|
||||
A4 a4;
|
||||
A5 a5;
|
||||
A6 a6;
|
||||
A7 a7;
|
||||
A8 a8;
|
||||
A9 a9;
|
||||
A10 a10;
|
||||
A11 a11;
|
||||
A12 a12;
|
||||
A13 a13;
|
||||
|
||||
assert(dynamic_cast<A3*>(a3.getA1_3()) == 0);
|
||||
assert(dynamic_cast<A3*>(a3.getA2()) == a3.getA3());
|
||||
|
||||
|
@ -1655,20 +1655,20 @@ struct A13
|
|||
A13* getA13() {return this;}
|
||||
};
|
||||
|
||||
A3 a3;
|
||||
A4 a4;
|
||||
A5 a5;
|
||||
A6 a6;
|
||||
A7 a7;
|
||||
A8 a8;
|
||||
A9 a9;
|
||||
A10 a10;
|
||||
A11 a11;
|
||||
A12 a12;
|
||||
A13 a13;
|
||||
|
||||
void test()
|
||||
{
|
||||
A3 a3;
|
||||
A4 a4;
|
||||
A5 a5;
|
||||
A6 a6;
|
||||
A7 a7;
|
||||
A8 a8;
|
||||
A9 a9;
|
||||
A10 a10;
|
||||
A11 a11;
|
||||
A12 a12;
|
||||
A13 a13;
|
||||
|
||||
assert(dynamic_cast<A3*>(a3.getA1_3()) == a3.getA3());
|
||||
assert(dynamic_cast<A3*>(a3.getA2()) == 0);
|
||||
|
||||
|
|
Loading…
Reference in New Issue