summaryrefslogtreecommitdiff
path: root/support/regression/tests/gcc-torture-execute-20140212-1.c
blob: b730fa4afba543bc076b699f7308dc2057d64bcf (plain) (blame)
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
41
42
43
44
/*
   20140212-1.c from the execute part of the gcc torture suite.
 */

#include <testfwk.h>

#ifdef __SDCC
#pragma std_c99
#pragma disable_warning 180
#endif

/* PR rtl-optimization/60116 */
/* Reported by Zhendong Su <su@cs.ucdavis.edu> */

int a, b, c, d = 1, e, f = 1, h, i, k;
char g, j;

void
fn1 (void)
{
  int l;
  e = 0;
  c = 0;
  for (;;)
    {
      k = a && b;
      j = k * 54;
      g = j * 147;
      l = ~g + (long long) e && 1;
      if (d)
        c = l;
      else
        h = i = l * 9UL;
      if (f)
        return;
    }
}

void
testTortureExecute (void)
{
  fn1 ();
  ASSERT (c == 1);
}