summaryrefslogtreecommitdiff
path: root/support/regression/tests/bug-3257.c
blob: f013d0d1d867adced4ba84905e1809420f113bb1 (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
/*
   bug-3256.c
   A bug in the stm8 code generation for tail calls from __z88dk_callee with stack parameters.
 */

#include <testfwk.h>

char
g (void)
{
  return 23;
}

char
f (unsigned short a, unsigned short b) __z88dk_callee
{
  if (a == b)
    return g ();
  return 42;
}

void
testBug (void)
{
  ASSERT (f (23, 23) == 23);
  ASSERT (f (23, 42) == 42);
}