Add an expected file for 094-divide-by-zero-short-circuit

The expected file here captures the current behavior of glcpp (which
is to generate a division-by-zero error) for this case.

It's easy to argue that it should be short-circuiting the evaluation
and not generating the diagnostic (which happens to be what gcc does).
But it doesn't seem like we should force this behavior on our
pre-processor, (and, as always, the GLSL specification of the
pre-processor is too vague on this point).
This commit is contained in:
Carl Worth
2011-04-14 14:35:11 -07:00
parent ea3b2560b1
commit d3c6ed382d
2 changed files with 26 additions and 0 deletions

View File

@@ -1,2 +1,13 @@
/* glcpp is generating a division-by-zero error for this case. It's
* easy to argue that it should be short-circuiting the evaluation and
* not generating the diagnostic (which happens to be what gcc does).
* But it doesn't seem like we should force this behavior on our
* pre-processor, (and, as always, the GLSL specification of the
* pre-processor is too vague on this point).
*
* If a short-circuit evaluation optimization does get added to the
* pre-processor then it would legitimate to update the expected file
* for this test.
*/
#if 1 || (1 / 0)
#endif

View File

@@ -0,0 +1,15 @@
0:12(17): preprocessor error: division by 0 in preprocessor directive