1 /* { dg-options "-O" } */
3 int foo1(void) { return 0; }
4 int bar1(void) { throw 1; }
6 void bar2(void) { throw 1; }
7 void __attribute__((noinline,noclone)) test1(void (*f)(void)) { (*f)(); }
8 void __attribute__((noinline,noclone)) test2(void (*f)(void)) { (*f)(); }
9 int __attribute__((noinline,noclone)) test3(int (*f)(void)) { return (*f)(); }
10 int __attribute__((noinline,noclone)) test4(int (*f)(void)) { return (*f)(); }
11 int __attribute__((noinline,noclone)) test5(int (*f)(void), int x) { return x ? x : (*f)(); }
12 int __attribute__((noinline,noclone)) test6(int (*f)(void), int x) { return x ? x : (*f)(); }
13 void __attribute__((noinline,noclone)) test7(void (*f)(void)) { try { (*f)(); } catch (...) {} }
14 void __attribute__((noinline,noclone)) test8(void (*f)(void)) { try { (*f)(); } catch (...) {}}
15 int __attribute__((noinline,noclone)) test9(int (*f)(void)) { try { return (*f)(); } catch (...) {return 0;} }
16 int __attribute__((noinline,noclone)) test10(int (*f)(void)) { try { return (*f)(); } catch (...) {return 0;} }
17 int __attribute__((noinline,noclone)) test11(int (*f)(void), int x) { try { return x ? x : (*f)(); } catch (...) {return 0;} }
18 int __attribute__((noinline,noclone)) test12(int (*f)(void), int x) { try { return x ? x : (*f)(); } catch (...) {return 0;} }
22 for (int i = 0; i < 100; ++i) test1(foo2);
23 for (int i = 0; i < 100; ++i) try { test2(bar2); } catch (...) {}
24 for (int i = 0; i < 100; ++i) test3(foo1);
25 for (int i = 0; i < 100; ++i) try { test4(bar1); } catch (...) {}
26 for (int i = 0; i < 100; ++i) test5(foo1, 0);
27 for (int i = 0; i < 100; ++i) try { test6(bar1, 0); } catch (...) {}
28 for (int i = 0; i < 100; ++i) test7(foo2);
29 for (int i = 0; i < 100; ++i) try { test8(bar2); } catch (...) {}
30 for (int i = 0; i < 100; ++i) test9(foo1);
31 for (int i = 0; i < 100; ++i) try { test10(bar1); } catch (...) {}
32 for (int i = 0; i < 100; ++i) test11(foo1, 0);
33 for (int i = 0; i < 100; ++i) try { test12(bar1, 0); } catch (...) {}