Debian Codegraph @

gcc/testsuite/g++.dg/other/pr49912.C

raw
1 // PR rtl-optimization/49912
2 // { dg-do compile }
3 // { dg-require-effective-target freorder }
4 // { dg-options "-O -freorder-blocks-and-partition" }
5
6 int foo (int *);
7
8 struct S
9 {
10 int *m1 ();
11 S (int);
12 ~S () { foo (m1 ()); }
13 };
14
15 template <int>
16 struct V
17 {
18 S *v1;
19 void m2 (const S &);
20 S *base ();
21 };
22
23 template <int N>
24 void V<N>::m2 (const S &x)
25 {
26 S a = x;
27 S *l = base ();
28 while (l)
29 *v1 = *--l;
30 }
31
32 V<0> v;
33
34 void
35 foo ()
36 {
37 v.m2 (0);
38 }