PR testsuite/86649
[official-gcc.git] / gcc / testsuite / g++.dg / tree-ssa / ehcleanup-1.C
blobd6e4cf37205958b5cfbe95611623f869546d5452
1 // { dg-options "-O2 -fdump-tree-ehcleanup1-details" }
3 #ifdef __GXX_EXPERIMENTAL_CXX0X__
4 #define NOEXCEPT_FALSE noexcept (false)
5 #else
6 #define NOEXCEPT_FALSE
7 #endif
9 extern void can_throw ();
10 class a
12 public:
13   ~a () NOEXCEPT_FALSE
14   {
15     if (0)
16       can_throw ();
17   }
19 void
20 t (void)
22   class a a;
23   can_throw ();
25 // We ought to remove implicit cleanup, since destructor is empty. 
26 // { dg-final { scan-tree-dump-times "Empty EH handler" 2 "ehcleanup1" } }
28 // And as a result also contained control flow.
29 // { dg-final { scan-tree-dump-times "Removing unreachable" 4 "ehcleanup1" } }