blob: b0c5ee28e151a66cfe7f9d2fc41613e222e3f5bb (
plain)
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
|
/*
pr44575.c from the execute part of the gcc torture tests.
*/
#include <testfwk.h>
#ifdef __SDCC
#pragma std_c99
#endif
/* PR target/44575 */
#include <stdarg.h>
#ifndef __SDCC_pdk14 // Lack of memory
int fails = 0;
struct S { float a[3]; };
struct S a[5];
void
check (int z, ...)
{
struct S arg, *p;
va_list ap;
int j = 0, k = 0;
int i;
va_start (ap, z);
for (i = 2; i < 4; ++i)
{
p = 0;
j++;
k += 2;
switch ((z << 4) | i)
{
case 0x12:
case 0x13:
p = &a[2];
arg = va_arg (ap, struct S);
break;
default:
++fails;
break;
}
if (p && p->a[2] != arg.a[2])
++fails;
if (fails)
break;
}
va_end (ap);
}
#endif
void
testTortureExecute (void)
{
#ifndef __SDCC_pdk14 // Lack of memory
a[2].a[2] = -49026;
check (1, a[2], a[2]);
if (fails)
ASSERT (0);
return;
#endif
}
|