Fix test-suite fallout of default -Wreturn-type.
[official-gcc.git] / gcc / testsuite / g++.dg / ipa / pr63838.C
blobd23b31337482259e2aaa840ebbe4f2eaeab88371
1 // PR ipa/63838
2 // { dg-do run }
3 // { dg-options "-O2 -fdump-ipa-pure-const" }
4 // { dg-final { scan-ipa-dump-not "Function found to be nothrow: void foo" "pure-const" } }
5 // { dg-final { scan-ipa-dump-not "Function found to be nothrow: void bar" "pure-const" } }
7 __attribute__((noinline, noclone)) static void bar (int);
8 volatile int v;
9 void (*fn) ();
10 struct S { S () { v++; } ~S () { v++; } };
12 __attribute__((noinline, noclone)) static void
13 foo (int x)
15   v++;
16   if (x == 5)
17     bar (x);
20 __attribute__((noinline, noclone)) static void
21 bar (int x)
23   v++;
24   if (x == 6)
25     foo (x);
26   else if (x == 5)
27     fn ();
30 __attribute__((noinline, noclone)) void
31 baz (int x)
33   S s;
34   foo (x);
37 void
38 throw0 ()
40   throw 0;
43 int
44 main ()
46   fn = throw0;
47   asm volatile ("" : : : "memory");
48   try
49     {
50       baz (5);
51     }
52   catch (int)
53     {
54     }