glcpp: Extend the invalid-paste test

The current code lets a few invalid pastes through, such as an string pasted
onto the end of an integer. Extend the invalid-paste test to catch some of
these.

Reviewed-by: Matt Turner <mattst88@gmail.com>
This commit is contained in:
Carl Worth
2012-11-28 12:57:09 -08:00
parent 01b83171c9
commit c86eb0cd65
2 changed files with 20 additions and 0 deletions

View File

@@ -1,2 +1,7 @@
#define PASTE(x,y) x ## y
PASTE(<,>)
PASTE(0,abc)
PASTE(1,=)
PASTE(2,@)
PASTE(3,-4)
PASTE(4,+5.2)

View File

@@ -1,5 +1,20 @@
0:2(7): preprocessor error:
Pasting "<" and ">" does not give a valid preprocessing token.
0:3(7): preprocessor error:
Pasting "0" and "abc" does not give a valid preprocessing token.
0:4(7): preprocessor error:
Pasting "1" and "=" does not give a valid preprocessing token.
0:5(7): preprocessor error:
Pasting "2" and "@" does not give a valid preprocessing token.
0:6(7): preprocessor error:
Pasting "3" and "-" does not give a valid preprocessing token.
0:7(7): preprocessor error:
Pasting "4" and "+" does not give a valid preprocessing token.
<
0
1
2
34
45.2