Which are proving to be useful since some of these tests are not yet
acting as desired, (in particular, the unterminated if test is not
generating any diagnostic).
20 files changed:
--- /dev/null
+#if UNDEFINED_MACRO
+#endif
--- /dev/null
+0:1(21): preprocessor error: syntax error, unexpected IDENTIFIER
+
--- /dev/null
+0:1(2): preprocessor error: else without #if
+
+
+
--- /dev/null
+#elif defined FOO
--- /dev/null
+0:1(2): preprocessor error: elif without #if
+
+
+
--- /dev/null
+0:1(2): preprocessor error: #endif without #if
+
+
+
--- /dev/null
+/* Error message for unskipped #if with no expression. */
+#if
+#endif
+
--- /dev/null
+0:2(1): preprocessor error: #if with no expression
+
+
--- /dev/null
+#if 0
+#elif
+#endif
--- /dev/null
+0:2(1): preprocessor error: #elif with no expression
+
+
+
+
+
--- /dev/null
+#define PASTE(x,y) x ## y
+PASTE(<,>)
--- /dev/null
+0:2(7): preprocessor error:
+Pasting "<" and ">" does not give a valid preprocessing token.
+
+<
+
--- /dev/null
+#define FUNC(x) (2*(x))
+FUNC(23
--- /dev/null
+#define MULT(x,y) ((x)*(y))
+MULT()
+MULT(1)
+MULT(1,2,3)
+
--- /dev/null
+0:2(1): preprocessor error: Error: macro MULT invoked with 1 arguments (expected 2)
+
+0:3(1): preprocessor error: Error: macro MULT invoked with 1 arguments (expected 2)
+
+0:4(1): preprocessor error: Error: macro MULT invoked with 3 arguments (expected 2)
+
+
+MULT()
+MULT(1)
+MULT(1,2,3)
+
+
--- /dev/null
+#define __BAD reserved
+#define GL_ALSO_BAD() also reserved
--- /dev/null
+0:1(10): preprocessor error: Macro names starting with "__" are reserved.
+
+0:2(9): preprocessor error: Macro names starting with "GL_" are reserved.
+
+
+
+