Mercurial > hg > CbC > CbC_gcc
annotate gcc/testsuite/g++.dg/tree-ssa/array-temp1.C @ 131:84e7813d76e9
gcc-8.2
author | mir3636 |
---|---|
date | Thu, 25 Oct 2018 07:37:49 +0900 |
parents | |
children |
rev | line source |
---|---|
131 | 1 // PR c++/85873 |
2 // Test that these array temporaries are promoted to static variables as an | |
3 // optimization. | |
4 | |
5 // { dg-do compile { target c++11 } } | |
6 // { dg-additional-options -fdump-tree-gimple } | |
7 // { dg-final { scan-tree-dump-not "= 42" "gimple" } } | |
8 | |
9 #include <initializer_list> | |
10 | |
11 int f() | |
12 { | |
13 using AR = const int[]; | |
14 return AR{ 1,42,3,4,5,6,7,8,9,0 }[5]; | |
15 } | |
16 | |
17 int g() | |
18 { | |
19 std::initializer_list<int> a = {1,42,3}; | |
20 return a.begin()[0]; | |
21 } |