summaryrefslogtreecommitdiff
path: root/support/regression/tests/bug3501942.c
blob: 65c9942dc54d0281b0ff944eee52d7527abb5732 (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
/* bug3501942, an issue with operandsNotrelated() in peepholes for z80-related ports.
 */

#include <testfwk.h>
#include <math.h>

int value;

int f(void)
{
	return 1;
}

void g(void) 
{
	if (value = f()) /* Bug was triggered here. */
		return;
}

void testBug(void)
{
	value = 0;
	g();
	ASSERT (value == 1);
}