summaryrefslogtreecommitdiff
path: root/support/regression/tests/bug-2306.c
blob: 84a67242668f906e511e79df8668c3fd727f0791 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/*
   bug-2306.c frame pointer omission triggered a code generation bug in 16-bit addition short functions.
 */

#include <testfwk.h>

int add(int pa, int pb)
{
	return pa * 2 + pb;
}

void testBug(void)
{
	ASSERT (add(0x0023, 0x0042) == 0x0023 * 2 + 0x0042);
	ASSERT (add(0x2300, 0x4200) == 0x2300 * 2 + 0x4200);
}