summaryrefslogtreecommitdiff
path: root/support/regression/tests/gcc-torture-execute-pr85529-1.c
blob: 55292923f805f2cc80957bc9dea4a003e06d5a9a (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
/*
pr85529-1.c from the execute part of the gcc torture tests.
*/

#include <testfwk.h>

/* PR tree-optimization/85529 */

struct S { int a; };

int b, c = 1, d, e, f;
static int g;
volatile struct S s;

signed char
foo (signed char i, int j)
{
  return i < 0 ? i : i << j;
}

void
testTortureExecute (void)
{
#if !(defined (__GNUC__) && (__GNUC__ < 8))
  signed char k = -83;
  if (!d)
    goto L;
  k = e || f;
L:
  for (; b < 1; b++)
    s.a != (k < foo (k, 2) && (c = k = g));
  if (c != 1)
    ASSERT (0);
  return;
#endif
}