diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/glsl/glcpp/tests/088-redefine-macro-legitimate.c | 2 | ||||
-rw-r--r-- | src/glsl/glcpp/tests/122-redefine-whitespace.c | 16 | ||||
-rw-r--r-- | src/glsl/glcpp/tests/122-redefine-whitespace.c.expected | 23 |
3 files changed, 40 insertions, 1 deletions
diff --git a/src/glsl/glcpp/tests/088-redefine-macro-legitimate.c b/src/glsl/glcpp/tests/088-redefine-macro-legitimate.c index 0e0666b8b35..422c6546414 100644 --- a/src/glsl/glcpp/tests/088-redefine-macro-legitimate.c +++ b/src/glsl/glcpp/tests/088-redefine-macro-legitimate.c @@ -1,5 +1,5 @@ #define abc 123 #define abc 123 -#define foo(x) (x)+23 #define foo(x) ( x ) + 23 +#define foo(x) ( x ) + 23 diff --git a/src/glsl/glcpp/tests/122-redefine-whitespace.c b/src/glsl/glcpp/tests/122-redefine-whitespace.c new file mode 100644 index 00000000000..ae7ea09f67e --- /dev/null +++ b/src/glsl/glcpp/tests/122-redefine-whitespace.c @@ -0,0 +1,16 @@ +/* Original definitions. */ +#define TWO ( 1+1 ) +#define FOUR (2 + 2) +#define SIX (3 + 3) + +/* Redefinitions with whitespace in same places, but different amounts, (so no + * error). */ +#define TWO ( 1+1 ) +#define FOUR (2 + 2) +#define SIX (3/*comment is whitespace*/+ /* collapsed */ /* to */ /* one */ /* space */ 3) + +/* Redefinitions with whitespace in different places. Each of these should + * trigger an error. */ +#define TWO (1 + 1) +#define FOUR ( 2+2 ) +#define SIX (/*not*/3 + 3/*expected*/) diff --git a/src/glsl/glcpp/tests/122-redefine-whitespace.c.expected b/src/glsl/glcpp/tests/122-redefine-whitespace.c.expected new file mode 100644 index 00000000000..193ebc40bb8 --- /dev/null +++ b/src/glsl/glcpp/tests/122-redefine-whitespace.c.expected @@ -0,0 +1,23 @@ +0:14(9): preprocessor error: Redefinition of macro TWO + +0:15(9): preprocessor error: Redefinition of macro FOUR + +0:16(9): preprocessor error: Redefinition of macro SIX + + + + + + + + + + + + + + + + + + |