| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-O2 -fdump-tree-cddce1-details -fdump-tree-optimized" } */ |
| 3 |
// { dg-require-effective-target cxa_atexit } |
| 4 |
/* PR tree-optimization/19661 */ |
| 5 |
|
| 6 |
/* The call to axexit should be removed as A::~A() is a pure/const function call |
| 7 |
and there is no visible effect if A::~A() call does not happen. */ |
| 8 |
|
| 9 |
struct A { |
| 10 |
A(); |
| 11 |
~A() {} |
| 12 |
}; |
| 13 |
|
| 14 |
void foo () { |
| 15 |
static A a; |
| 16 |
} |
| 17 |
|
| 18 |
/* { dg-final { scan-tree-dump-times "Deleting : (?:__cxxabiv1::__cxa_atexit|__aeabiv1::__aeabi_atexit)" 1 "cddce1" } } */ |
| 19 |
/* { dg-final { scan-tree-dump-not "__cxa_atexit|__aeabi_atexit" "optimized" } } */ |
| 20 |
|