summaryrefslogtreecommitdiff
path: root/support/regression/tests/bug-2715.c
blob: 3bdf7b1ddd3842177b999afe84ca8da2ffbe10e9 (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
/*
   bug-2715.c
*/

#include <testfwk.h>

#pragma disable_warning 85

struct foo;
typedef struct foo FILE;

void pc(FILE *fp, char c)
{
}

void pd(FILE *fp, int n)
{
	int c;

	c = n%10 + '0'; // This addition has operands smaller than the result, resulting in a crash in the z80 backend.
	if (n != 0)
		pd(fp, n);
	pc(fp, c);
}

void testBug(void)
{
	pd(0, 0);
}