Debian Codegraph @

gcc/testsuite/g++.dg/tree-ssa/pr20458.C

raw
1 /* { dg-do run } */
2 /* { dg-options "-O2" } */
3 /* { dg-skip-if "requires hosted libstdc++ for std::locale cdtor" { ! hostedlib } } */
4
5 /* The tail call optimization would inapproriately tail call the
6 destructors due to not recognizing a call clobbered variable */
7 namespace std
8 {
9 class locale
10 {
11 public:
12 locale();
13 ~locale();
14 };
15 }
16
17 struct B
18 {
19 std::locale _M_buf_locale;
20 virtual ~B() {}
21 };
22
23 struct C : public B
24 {
25 char *s;
26 };
27
28 void foo ()
29 {
30 C c;
31 }
32
33 int main()
34 {
35 foo ();
36 return 0;
37 }
38