summaryrefslogtreecommitdiff
path: root/support/regression/tests/gcc-torture-execute-20030307-1.c
blob: 1725165df8dda80b07bdd407bdcd23d0adf1640e (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
40
41
42
/*
   20030307-1.c from the execute part of the gcc torture tests.
 */

#include <testfwk.h>

#ifdef __SDCC
#pragma std_c99
#pragma disable_warning 85
#endif
// TODO: Enable when all ports support long long!
#if !defined(__SDCC_pic14) && !defined(__SDCC_pic16)

/* PR optimization/8726 */
/* Originator: Paul Eggert <eggert@twinsun.com> */

/* Verify that GCC doesn't miscompile tail calls on Sparc. */

int fcntl_lock(int fd, int op, long long offset, long long count, int type);

int vfswrap_lock(char *fsp, int fd, int op, long long offset, long long count, int type)
{
  return fcntl_lock(fd, op, offset, count, type);
}

int fcntl_lock(int fd, int op, long long offset, long long count, int type)
{
  return type;
}
#endif

void
testTortureExecute (void)
{
#if !defined(__SDCC_pic14) && !defined(__SDCC_pic16)
  if (vfswrap_lock (0, 1, 2, 3, 4, 5) != 5)
    ASSERT (0);

  return;
#endif
}