2015-05-05 Yvan Roux <yvan.roux@linaro.org>
[official-gcc.git] / gcc / testsuite / g++.dg / pr64191.C
blobe40a62d0843604c4b25dcac1704386dd6ec2d448
1 // { dg-do compile }
2 // { dg-options "-O2 -fdump-tree-cddce1" }
4 struct Bar
6   int i;
7   ~Bar() { }
8 };
9 void bar_dtor_loop(Bar* p, unsigned int n)
11   if (p) {
12       Bar* e = p + n;
13       while (e > p) {
14           --e;
15           e->~Bar();
16       }
17   }
20 // The clobber in ~Bar should persist but those inlined into
21 // bar_dtor_loop not, nor should the loop therein
23 // { dg-final { scan-tree-dump-times "CLOBBER" 1 "cddce1" } }
24 // { dg-final { scan-tree-dump-times "if" 0 "cddce1" } }
25 // { dg-final { cleanup-tree-dump "cddce1" } }