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

#include <testfwk.h>

#ifdef __SDCC
#pragma std_c99
#endif

#include <stdlib.h>

int a;
char b, d;
short c;
short fn1(int p1, int p2) { return p2 >= 2 ? p1 : p1 > p2; }

void
testTortureExecute (void) {
  int *e = &a, *f = &a;
  b = 1;
  for (; b <= 9; b++) {
    c = *e != 5 || d;
    *f = fn1(c || b, a);
  }

  if ((long long) a != 1)
    ASSERT(0);

  return;
}