blob: 9d8690510c74bf53e9210985916497eb144acbb1 (
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
|
/*
preproc.c
preprocessor and punctuators tests
*/
#include <testfwk.h>
/*
* the following tests are applicable only for SDCC,
* since they are using SDCC specific pragmas
*/
#ifdef __SDCC
/*
* test for bug 135170
*/
const char *
const_str(void)
{
return "A"
/* just for testing, actually nop */
#pragma save
"B";
#pragma restore
}
/*
* test for bug 982435
*/
#pragma pedantic_parse_number +
#define LO_B(x) ((x) & 0xff)
#define BAD(x) ((x) & 0xff)
unsigned char
hexeminus(void)
{
unsigned char a=0x\
fe\
-\
LO_B(3);
unsigned char b=0xfe-BAD(3);
return (a + b);
}
#endif
/*
* test punctuators, as defined in ISO/IEC 9899:1999, chapter 6.4.6#3
*/
void
testPunctuators (void)
<%
%:define N 10
%:define VAL 123
%:define C(NAME) NAME %:%: ___
int C(a)<:N:>;
C(a)<:0:> = VAL;
ASSERT (a___<:0:> == VAL);
%>
|