aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-ssa/ssa-sink-23.c
blob: f632dc8b95a4df88fe2152320940b08b94b32a98 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-sink1-details" } */

struct S {
    int* x;
    int* y;
};

void __attribute__((noreturn)) bar(const struct S* s);

void foo(int a, int b) {
    struct S s;
    s.x = &a;
    s.y = &b;
    if (a < b) {
        bar(&s);
    }
}

/* { dg-final { scan-tree-dump "Sinking.*s.y" "sink1" } } */
/* { dg-final { scan-tree-dump "Sinking.*s.x" "sink1" } } */