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

#include <testfwk.h>

#ifdef __SDCC
#pragma std_c99
#endif

/* Verify that we do not lose side effects on a MOD expression.  */

#include <stdlib.h>
#include <stdio.h>

int
foo (int a)
{
  int x = 0 % a++;
  return a;
}

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