aboutsummaryrefslogtreecommitdiffstats
path: root/src/glsl/glcpp/tests/124-preprocessing-numbers.c
blob: 947ba1885ec79bd6770e99bcd8b6dcabeb877272 (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
25
26
27
28
29
30
31
32
33
34
35
36
37
#define e THIS_SHOULD_NOT_BE_EXPANDED
#define E NOR_THIS
#define p NOT_THIS_EITHER
#define P AND_SURELY_NOT_THIS
#define OK CRAZY_BUT_TRUE_THIS_NEITHER

/* This one is actually meant to be expanded */
#define MUST_EXPAND GO

/* The following are "preprocessing numbers" and should not trigger macro
 * expansion. */
1e
1OK

/* These are also "preprocessing numbers", so no expansion */
123e+OK
.23E+OK
1.3e-OK
12.E-OK
123p+OK
.23P+OK
1.3p-OK
12.P-OK
123..OK
.23.OK.OK

/* Importantly, just before the MUST_EXPAND in each of these, the preceding
 * "preprocessing number" ends and we have an actual expression. So the
 * MUST_EXPAND macro must be expanded (who would have though?) in each case. */
123ef+MUST_EXPAND
.23E3-MUST_EXPAND
1.3e--MUST_EXPAND
12.E-&MUST_EXPAND
123p+OK+MUST_EXPAND
.23P+OK;MUST_EXPAND
1.3p-OK-MUST_EXPAND
12.P-OK&MUST_EXPAND