The test has 3 invocations with 1M iterations each, which adds delay to fast check-bolt testing. Reduce the number to 1K. Reviewed By: #bolt, rafauler Differential Revision: https://reviews.llvm.org/D139651
56 lines
889 B
C++
56 lines
889 B
C++
#include <stdio.h>
|
|
|
|
class ExcA {};
|
|
class ExcB {};
|
|
class ExcC {};
|
|
class ExcD {};
|
|
class ExcE {};
|
|
class ExcF {};
|
|
class ExcG {};
|
|
|
|
void foo(int a)
|
|
{
|
|
if (a > 1)
|
|
throw ExcG();
|
|
else
|
|
throw ExcC();
|
|
}
|
|
|
|
void never_throws() throw () {
|
|
printf("this statement is cold and should be outlined\n");
|
|
}
|
|
|
|
int main(int argc, char **argv)
|
|
{
|
|
for (unsigned i = 0; i < 1000; ++i) {
|
|
try {
|
|
if (argc == 2) {
|
|
never_throws(); // should be cold
|
|
}
|
|
try {
|
|
if (argc == 2) {
|
|
never_throws(); // should be cold
|
|
}
|
|
throw ExcA();
|
|
} catch (ExcA) {
|
|
printf("catch 2\n");
|
|
throw new int();
|
|
}
|
|
} catch (...) {
|
|
printf("catch 1\n");
|
|
}
|
|
|
|
try {
|
|
try {
|
|
foo(argc);
|
|
} catch (ExcC) {
|
|
printf("caught ExcC\n");
|
|
}
|
|
} catch (ExcG) {
|
|
printf("caught ExcG\n");
|
|
}
|
|
}
|
|
|
|
return 0;
|
|
}
|