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

#include <testfwk.h>

struct foo
{
  unsigned char *base;
};

unsigned char s[4] = {'a', 'b', 'c', 0};
struct foo bar = {s};

int ugetc (const void *p)
{
  return *((const char *) p);
}

void netat_outbyte (unsigned char v)
{
  ASSERT (v == 'a');
}

void testBug (void)
{
  netat_outbyte (ugetc (bar.base++));
  ASSERT (*bar.base == 'b');
}