]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/testsuite/gdc.dg/pr90136a.d
Update copyright years.
[thirdparty/gcc.git] / gcc / testsuite / gdc.dg / pr90136a.d
1 // https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93038
2 // { dg-do compile }
3 // { dg-options "-fdump-tree-optimized" }
4 // { dg-final { scan-tree-dump-times "sum_array \\(array\\)" 0 "optimized"} }
5
6 import gcc.attributes;
7
8 @attribute("always_inline") int sum_array(int[] input);
9
10 int sum_array(int[] input)
11 {
12 int sum = 0;
13 foreach (elem; input)
14 sum += elem;
15 return sum;
16 }
17
18 int test(int[] array)
19 {
20 return sum_array(array);
21 }