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

#include <testfwk.h>

#ifdef __SDCC
#pragma std_c99
#endif

#include <string.h>

int foo (void *, void *, unsigned int c);

int src[10];
int dst[10];

void
testTortureExecute (void)
{
#ifndef __SDCC_pdk14 // Lack of memory
   if (foo (dst, src, 10) != 0)
     ASSERT (0);
   return;
#endif
}

#ifndef __SDCC_pdk14 // Lack of memory
int foo (void *a, void *b, unsigned int c)
{
  if (c == 0)
    return 1;

  memcpy (a, b, c);
  return 0;
}
#endif