comparison gcc/testsuite/g++.dg/opt/nrv12.C @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children
comparison
equal deleted inserted replaced
68:561a7518be6b 111:04ced10e8804
1 /* Verify that gimple-level NRV is occurring even for RESULT_DECLs. */
2 /* { dg-do compile { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
3 /* { dg-options "-O -fdump-tree-optimized" } */
4
5 struct P
6 {
7 long long l;
8 int a;
9 unsigned int b;
10 P(long long x) : l(x) {}
11 };
12
13 P foo (P);
14 P bar (P);
15
16 P foo (P x)
17 {
18 P y = P (-1LL);
19 y = bar (x);
20 return y;
21 }
22
23 /* { dg-final { scan-tree-dump-times "return slot optimization" 1 "optimized" } } */