Imported Upstream version 2.9.0
[debian/cc1111] / support / regression / tests / preproc.c
1 /*
2    preproc.c
3 */
4
5 #include <testfwk.h>
6
7 /*
8  * test for bug 135170
9  */
10 const char *
11 const_str(void)
12 {
13 return "A"
14
15
16
17 /* just for testing, actually nop */
18 #pragma save
19
20
21
22
23
24 "B";
25 #pragma restore
26 }
27
28 /*
29  * test for bug 982435
30  */
31 #if !defined (__GNUC__) && !defined (_MSC_VER)
32 /* since this fails on GCC cpp and MSVC cl -E... */
33 #pragma pedantic_parse_number +
34
35 #define LO_B(x) ((x) & 0xff)
36 #define BAD(x) ((x) & 0xff)
37
38 unsigned char
39 hexeminus(void)
40 {
41 unsigned char a=0x\
42 fe\
43 -\
44 LO_B(3);
45
46 unsigned char b=0xfe-BAD(3);
47
48 return (a + b);
49 }
50 #endif
51
52 void testBug(void)
53 {
54 }