mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 13:58:04 +02:00
glcpp: Add two new tests for testing redefined macros.
The specification says that redefining a macro is an error, unless the new definitions is identical to the old one, (identical replacement lists but ignoring differing amounts of whitespace).
This commit is contained in:
parent
97638aa77c
commit
105e2137d6
4 changed files with 58 additions and 0 deletions
5
src/glsl/glcpp/tests/088-redefine-macro-legitimate.c
Normal file
5
src/glsl/glcpp/tests/088-redefine-macro-legitimate.c
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
#define abc 123
|
||||
#define abc 123
|
||||
|
||||
#define foo(x) (x)+23
|
||||
#define foo(x) ( x ) + 23
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
17
src/glsl/glcpp/tests/089-redefine-macro-error.c
Normal file
17
src/glsl/glcpp/tests/089-redefine-macro-error.c
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
#define x y
|
||||
#define x z
|
||||
|
||||
#define abc 123
|
||||
#define abc() 123
|
||||
|
||||
#define foo() bar
|
||||
#define foo(x) bar
|
||||
|
||||
#define bar() baz
|
||||
#define bar baz
|
||||
|
||||
#define biff(a,b) a+b
|
||||
#define biff(a,b,c) a+b
|
||||
|
||||
#define oper(a,b) a+b
|
||||
#define oper(a,b) a*b
|
||||
30
src/glsl/glcpp/tests/089-redefine-macro-error.c.expected
Normal file
30
src/glsl/glcpp/tests/089-redefine-macro-error.c.expected
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
0:2(9): preprocessor error: Redefinition of macro x
|
||||
|
||||
0:5(9): preprocessor error: Redefinition of macro abc
|
||||
|
||||
0:8(9): preprocessor error: Redefinition of macro foo
|
||||
|
||||
0:11(9): preprocessor error: Redefinition of macro bar
|
||||
|
||||
0:14(9): preprocessor error: Redefinition of macro biff
|
||||
|
||||
0:17(9): preprocessor error: Redefinition of macro oper
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Loading…
Add table
Reference in a new issue