Mercurial > hg > CbC > CbC_gcc
annotate gcc/testsuite/gcc.dg/nrv2.c @ 131:84e7813d76e9
gcc-8.2
author | mir3636 |
---|---|
date | Thu, 25 Oct 2018 07:37:49 +0900 |
parents | 04ced10e8804 |
children |
rev | line source |
---|---|
111 | 1 /* Test that the tree_nrv pass works by making sure that we don't generate |
2 a memcpy. Throw in a bit of control flow to make its job a bit harder. */ | |
3 | |
4 /* { dg-options "-O" } */ | |
5 | |
6 struct A { int i[100]; }; | |
7 | |
8 int b; | |
9 | |
10 struct A f () | |
11 { | |
12 struct A a; | |
13 if (b) | |
14 { | |
15 a.i[0] = 42; | |
16 return a; | |
17 } | |
18 else | |
19 { | |
20 a.i[42] = 1; | |
21 return a; | |
22 } | |
23 } | |
24 | |
25 /* { dg-final { scan-assembler-not "memcpy" } } */ |