blob: 5d4d2ac1045cdef14a669723b5d740f762efe318 (
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
|
/*
bug-3240.c. Stack register parameters were not correctly checked for having their address taken
resulting in incorrect tail call optimization, thus calls where spilt local variables in the calle
overwrote the spilt register parameter.
*/
#include <testfwk.h>
#include <string.h>
void bar(void);
int *p;
void foo(int a) __z88dk_callee
{
p = &a;
bar();
}
void check(char *buffer)
{
ASSERT (*p == 23);
ASSERT (buffer[0] == 42);
}
void bar(void)
{
char buffer[8];
memset(buffer, 42, 8);
check(buffer);
}
void
testBug (void)
{
foo(23);
return;
}
|