blob: d7c8c3ec79aeb65b0272aad87ab8d54a67eca10c (
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
|
/*
va-arg-4.c from the execute part of the gcc torture tests.
*/
#include <testfwk.h>
/* On the i960 any arg bigger than 16 bytes causes all subsequent args
to be passed on the stack. We test this. */
#include <stdarg.h>
typedef struct {
char a[32];
} big;
#if 0 // TODO: enable when SDCC can pass struct
void
f (big x, char *s, ...)
{
va_list ap;
if (x.a[0] != 'a' || x.a[1] != 'b' || x.a[2] != 'c')
ASSERT (0);
va_start (ap, s);
if (va_arg (ap, int) != 42)
ASSERT (0);
if (va_arg (ap, int) != 'x')
ASSERT (0);
if (va_arg (ap, int) != 0)
ASSERT (0);
va_end (ap);
}
#endif
void
testTortureExecute (void)
{
#if 0
static big x = { "abc" };
f (x, "", 42, 'x', 0);
return;
#endif
}
|