mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-25 00:00:11 +01:00
glsl: Add glcpp tests for a macro used twice
This test cases exposes a bug as described in this bug report: "ralloc.c:78: get_header: Assertion `info->canary == 0x5A1106' failed." when using a macro in GLSL https://bugs.freedesktop.org/show_bug.cgi?id=45082 Clearly, some memory is getting (incorrectly) freed on the first macro invocation, leading to problems with the second macro invocation. Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
This commit is contained in:
parent
7ab1c7f792
commit
64fd26a8a8
2 changed files with 33 additions and 0 deletions
16
src/glsl/glcpp/tests/101-macros-used-twice.c
Normal file
16
src/glsl/glcpp/tests/101-macros-used-twice.c
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
#define object 1
|
||||
#define function(x) 1
|
||||
|
||||
#if object
|
||||
once
|
||||
#endif
|
||||
#if object
|
||||
twice
|
||||
#endif
|
||||
|
||||
#if function(0)
|
||||
once
|
||||
#endif
|
||||
#if function(0)
|
||||
once again
|
||||
#endif
|
||||
17
src/glsl/glcpp/tests/101-macros-used-twice.c.expected
Normal file
17
src/glsl/glcpp/tests/101-macros-used-twice.c.expected
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
|
||||
|
||||
|
||||
|
||||
once
|
||||
|
||||
|
||||
twice
|
||||
|
||||
|
||||
|
||||
once
|
||||
|
||||
|
||||
once again
|
||||
|
||||
|
||||
Loading…
Add table
Reference in a new issue