struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / bug1810965.c
blob9e00c457a0fe2cf64dfb3c07a7762d9fa82b8210
1 /*
2 bug1810965.c
3 */
5 #include <testfwk.h>
7 /* bug 1810965 */
8 typedef union data_packet
10 struct
12 enum
14 READ_VERSION = 0x00,
15 RESET = 0xFF
16 }cmd;
17 }t;
18 } data_packet;
20 data_packet dataPacket;
22 void bug1810965(void)
24 switch(dataPacket.t.cmd)
26 case READ_VERSION: //error 20: Undefined identifier 'READ_VERSION'
27 //error 62: 'case' expression not constant. Statement ignored
28 break;
32 /* bug 2698805 */
33 static void foo(void)
35 enum foo_tag { e_foo };
36 volatile unsigned char a = e_foo;
39 static void bar(void)
41 enum foo_tag { e_foo }; //error 163: duplicate enum member 'e_foo'
42 //error 0: Duplicate symbol 'e_foo', symbol IGNORED
43 //error 51: typedef/enum 'foo_tag' duplicate. Previous definition Ignored
44 volatile unsigned char a = e_foo;
47 void testBug(void)
49 ASSERT(1);