comparison gcc/testsuite/gdc.dg/pr90136a.d @ 152:2b5abeee2509

update gcc11
author anatofuz
date Mon, 25 May 2020 07:50:57 +0900
parents
children
comparison
equal deleted inserted replaced
145:1830386684a0 152:2b5abeee2509
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.attribute;
7
8 @attribute("forceinline") 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 }