summaryrefslogtreecommitdiff
path: root/support/regression/tests/bug1810965.c
blob: 8d6b4a6cc1e90aae9301f832c64215c96166b358 (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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/*
   bug1810965.c
*/

#include <testfwk.h>

/* bug 1810965 */
typedef union data_packet
{
	struct
	{
		enum
		{
			READ_VERSION = 0x00,
			RESET = 0xFF
		}cmd;
	}t;
} data_packet;

data_packet dataPacket;

void bug1810965(void)
{
	switch(dataPacket.t.cmd)
	{
	case READ_VERSION:		//error 20: Undefined identifier 'READ_VERSION'
					//error 62: 'case' expression not constant. Statement ignored
		break;
	}
}

/* bug 2698805 */
static void foo(void)
{
	enum foo_tag { e_foo };
	volatile unsigned char a = e_foo;
}

static void bar(void)
{
	enum foo_tag { e_foo };		//error 163: duplicate enum member 'e_foo'
					//error 0: Duplicate symbol 'e_foo', symbol IGNORED
					//error 51: typedef/enum 'foo_tag' duplicate. Previous definiton Ignored
	volatile unsigned char a = e_foo;
}

void testBug(void)
{
	ASSERT(1);
}