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

#include <testfwk.h>

#ifdef __SDCC
#pragma std_c99
#endif

/* PR rtl-optimization/64260 */

int a = 1, b;

void
foo (char p)
{
  int t = 0;
  for (; b < 1; b++)
    {
      int *s = &a;
      if (--t)
	*s &= p;
      *s &= 1;
    }
}

void
testTortureExecute (void)
{
  foo (0);
  if (a != 0)
    ASSERT (0);
  return;
}