Debian Codegraph @

gcc/testsuite/g++.dg/tree-ssa/pr57380.C

raw
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fdump-tree-phiopt2" } */
3 /* { dg-add-options bind_pic_locally } */
4
5 struct my_array {
6 int data[4];
7 };
8
9 const int& my_max(const int& a, const int& b) {
10 return a < b ? b : a;
11 }
12
13 int f(my_array a, my_array b) {
14 int res = 0;
15 for (int i = 0; i < 4; ++i) {
16 res += my_max(a.data[i], b.data[i]);
17 }
18 return res;
19 }
20
21 /* { dg-final { scan-tree-dump "MAX_EXPR" "phiopt2" } } */