summaryrefslogtreecommitdiff
path: root/support/regression/tests/bug-3465.c
blob: b5e61bdbbb6d2fcdfdf2e2fbe0c59081e30e745c (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
/* bug-3465.c
   Symbols for previous parameters were not available for the array dimension of a parameter.
 */

#include <testfwk.h>
#include <string.h>

#pragma disable_warning 85

void f(unsigned int j, char d[sizeof(j)])
{
	unsigned int k;
	memcpy (d, &j, sizeof(j));
}

void
testBug(void)
{
	unsigned int j = 0xaa55;
	char d[sizeof(j)];
	f(j, d);
	ASSERT(!memcmp(&j, d, sizeof(j)));
}