]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/testsuite/g++.dg/tree-prof/partition1.C
Remove obsolete IRIX 6.5 support
[thirdparty/gcc.git] / gcc / testsuite / g++.dg / tree-prof / partition1.C
CommitLineData
17f6e37d
JJ
1/* { dg-require-effective-target freorder } */
2/* { dg-options "-O2 -freorder-blocks-and-partition" } */
3
4struct A { A () __attribute__((noinline)); ~A () __attribute__((noinline)); };
5A::A () { asm volatile ("" : : : "memory"); }
6A::~A () { asm volatile ("" : : : "memory"); }
7
8int bar () __attribute__((noinline));
9void foo () __attribute__((noinline));
10
11volatile int k, l;
12
13int bar (int i)
14{
15 void *p = __builtin_alloca (i);
16 asm volatile ("" : : "r" (i), "r" (p) : "memory");
17 if (k) throw 6;
18 return ++l;
19}
20
21void foo ()
22{
23 A a;
24 try {
25 A b;
26 int i = bar (5);
27 try { throw 6; } catch (int) {}
28 if (__builtin_expect (i < 4500, 0)) {
29 bar (7);
30 try { bar (8); } catch (long) {}
31 bar (10);
32 if (__builtin_expect (i < 0, 0)) {
33 try { bar (12); } catch (...) {}
34 bar (16);
35 bar (122);
36 } else {
37 try { bar (bar (7)); } catch (int) {}
38 }
39 } else {
40 try { bar (bar (bar (9))); } catch (...) {}
41 bar (5);
42 }
43 } catch (...) {
44 }
45}
46
47int
48main ()
49{
50 int i;
51 for (i = 0; i < 10000; i++)
52 foo ();
53}