[clang][modules] Don't prevent translation of FW_Private includes when explicitly...
[llvm-project.git] / bolt / test / runtime / Inputs / exceptions_split.cpp
blobde81adf7583ca3da8b8255e45809f4f7d2ad899f
1 // Test that we can have a statement that throws in hot cold
2 // and a landing pad in cold code.
3 //
4 // Record performance data with no args. Run test with 2 args.
6 #include <stdint.h>
7 #include <stdio.h>
9 int foo() { return 0; }
11 void bar(int a) {
12 if (a > 2 && a % 2)
13 throw new int();
16 void filter_only() { foo(); }
18 int main(int argc, char **argv) {
19 unsigned r = 0;
21 uint64_t limit = (argc >= 2 ? 10 : 5000);
22 for (uint64_t i = 0; i < limit; ++i) {
23 i += foo();
24 try {
25 bar(argc);
26 try {
27 if (argc >= 2)
28 throw new int();
29 } catch (...) {
30 printf("catch 2\n");
31 throw new int();
33 } catch (...) {
34 printf("catch 1\n");
38 return 0;