1 /* { dg-do compile } */
2 /* { dg-options "-fdump-tree-phiopt-details -ffat-lto-objects isa>=4" } */
3 /* { dg-skip-if "code quality test" { *-*-* } { "-O0" "-O1" } { "" } } */
4 /* This is testing for errors which can only happen in assembly generation.
5 dg-error does not guarantee assembly generation, so we need to do it
6 manually by using -ffat-lto-objects. */
7
8 typedef struct s {
9 int v;
10 int b;
11 struct s *l;
12 struct s *r;
13 } S;
14
15 /* Test requires conditional moves. */
16 NOMIPS16 int foo(S *s)
17 {
18 S *this;
19 S *next;
20
21 this = s;
22 if (this->b)
23 next = this->l;
24 else
25 next = this->r;
26
27 return next->v;
28 }
29
30 /* { dg-final { scan-tree-dump "Hoisting adjacent loads" "phiopt1" } } */