summaryrefslogtreecommitdiff
path: root/support/regression/tests/gcc-torture-execute-loop-8.c
blob: 227fc20c6aa54e012a832bf67943c0f62021ac06 (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
36
37
38
39
40
/*
   loop-8.c from the execute part of the gcc torture tests.
 */

#include <testfwk.h>

#ifdef __SDCC
#pragma std_c99
#endif

#pragma disable_warning 93 // Using float for double.

#ifndef __SDCC_pdk14 // Lackof memory
double a[3] = { 0.0, 1.0, 2.0 };

void bar (int x, double *y)
{
  if (x || *y != 1.0)
    ASSERT (0);
}
#endif

void
testTortureExecute (void)
{
#ifndef __SDCC_pdk14 // Lackof memory
  double c;
  int d;
  for (d = 0; d < 3; d++)
  {
    c = a[d];
    if (c > 0.0) goto e;
  }
  bar(1, &c);
  return;
e:
  bar(0, &c);
  return;
#endif
}