aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.c-torture/execute/pr104604.c
blob: c937e17085bed9bf7a5c86e88ec4296f808896a7 (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
/* PR tree-optimization/104604 */

unsigned char g;

__attribute__((noipa))
unsigned char
foo (_Complex unsigned c)
{
  unsigned char v = g;
  _Complex unsigned t = 3;
  t /= c;
  return v + t;
}

__attribute__((noipa))
unsigned char
bar (_Complex unsigned c)
{
  unsigned char v = g;
  _Complex unsigned t = 42;
  t /= c;
  return v + t;
}

int
main ()
{
  unsigned char x = foo (7);
  if (x)
    __builtin_abort ();
  if (bar (7) != 6)
    __builtin_abort ();
  return 0;
}