summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/init/cleanup3.C
blob: da7e411aba4ae1de5103a82ece859169a51b8733 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// Check that on targets with "__cxa_atexit" we use destructors,
// rather than cleanup functions, to destroy objects with static
// storage duration.

// { dg-require-effective-target "cxa_atexit" }
// Cleanup functions generated by G++ have the "_tcf" prefix.
// { dg-final { scan-assembler-not "_tcf" } }

struct S { 
  ~S();
};

struct T { 
  S s;
};

S s;
T t;

void f() {
  static S s;
}