aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-ssa/pr97456.c
blob: 5171c9b4577ff5ece012c3b464ab1ea9d2010555 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/* { dg-do run } */
/* { dg-options "-O2 -fwhole-program" } */


float val2 = 1.710780f;
float val3;
volatile float vf;

int __attribute__((noipa))
get_bool (void)
{
  return 1;
}

int __attribute__((noinline))
wrong (float *pos)
{
  _Complex float a;

  __real__ a = *pos;
  __imag__ a = *pos;

  _Complex float b = 0 + 0i;

  b = b + a;

  if (b == 0.0f)
    return 1;

  vf = __imag__ b;
  return 0;
}

int main(int argc, char **argv) {
  float val = get_bool () == 1 ? val2 : val3;

  if ((wrong(&val), wrong(&val)))
    __builtin_abort ();
  return 0;
}