summaryrefslogtreecommitdiffstats
path: root/src/glsl/glcpp/tests/101-macros-used-twice.c
diff options
context:
space:
mode:
authorCarl Worth <[email protected]>2012-02-02 11:27:55 -0800
committerCarl Worth <[email protected]>2012-02-02 12:05:21 -0800
commit64fd26a8a812f66f1291d897df7953b8ac9e2f1b (patch)
tree9567176a4a428d0fe29fa911739b911688ea9980 /src/glsl/glcpp/tests/101-macros-used-twice.c
parent7ab1c7f7926c75a07f33eb149d0fc17dcfaffd5e (diff)
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 <[email protected]>
Diffstat (limited to 'src/glsl/glcpp/tests/101-macros-used-twice.c')
-rw-r--r--src/glsl/glcpp/tests/101-macros-used-twice.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/glsl/glcpp/tests/101-macros-used-twice.c b/src/glsl/glcpp/tests/101-macros-used-twice.c
new file mode 100644
index 00000000000..e1693805b6a
--- /dev/null
+++ b/src/glsl/glcpp/tests/101-macros-used-twice.c
@@ -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