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

#include <testfwk.h>

#ifdef __SDCC
#pragma std_c99
#endif

int loop_1 = 100;
int loop_2 = 7;
int flag = 0;

int test (void)
{
    int i;
    int counter  = 0;

    while (loop_1 > counter) {
        if (flag & 1) {
            for (i = 0; i < loop_2; i++) {
                counter++;
            }
        }
        flag++;
    }
    return 1;
}

void
testTortureExecute (void)
{
    if (test () != 1)
      ASSERT (0);
    
    return;
}