From cb5ea0c79bd74ea6263d54302ed19c243ceb05de Mon Sep 17 00:00:00 2001 From: Carl Worth Date: Wed, 11 Aug 2010 13:48:13 -0700 Subject: glcpp: Add several tests for diagnostics. 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). --- src/glsl/glcpp/tests/081-elif-without-expression.c.expected | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 src/glsl/glcpp/tests/081-elif-without-expression.c.expected (limited to 'src/glsl/glcpp/tests/081-elif-without-expression.c.expected') diff --git a/src/glsl/glcpp/tests/081-elif-without-expression.c.expected b/src/glsl/glcpp/tests/081-elif-without-expression.c.expected new file mode 100644 index 0000000000..37dcdc3238 --- /dev/null +++ b/src/glsl/glcpp/tests/081-elif-without-expression.c.expected @@ -0,0 +1,6 @@ +0:2(1): preprocessor error: #elif with no expression + + + + + -- cgit v1.2.3 From 624dd585c72103e5bffbc600cdf7bdfba5305a15 Mon Sep 17 00:00:00 2001 From: Carl Worth Date: Wed, 11 Aug 2010 13:50:51 -0700 Subject: glcpp: Reword diagnostic for #elif with no expression Rather than telling the user what to fix, the standard convention is to describe what the detected problem is. With this change, test 081-elif-without-expression now passes. --- src/glsl/glcpp/glcpp-parse.c | 2 +- src/glsl/glcpp/glcpp-parse.y | 2 +- src/glsl/glcpp/tests/081-elif-without-expression.c.expected | 1 - 3 files changed, 2 insertions(+), 3 deletions(-) (limited to 'src/glsl/glcpp/tests/081-elif-without-expression.c.expected') diff --git a/src/glsl/glcpp/glcpp-parse.c b/src/glsl/glcpp/glcpp-parse.c index 498d018764..05bb7ca48b 100644 --- a/src/glsl/glcpp/glcpp-parse.c +++ b/src/glsl/glcpp/glcpp-parse.c @@ -1950,7 +1950,7 @@ yyreduce: if (parser->skip_stack && parser->skip_stack->type == SKIP_TO_ELSE) { - glcpp_error(& (yylsp[(1) - (2)]), parser, "#elif needs an expression"); + glcpp_error(& (yylsp[(1) - (2)]), parser, "#elif with no expression"); } else { diff --git a/src/glsl/glcpp/glcpp-parse.y b/src/glsl/glcpp/glcpp-parse.y index 643c449d0e..795030ecfe 100644 --- a/src/glsl/glcpp/glcpp-parse.y +++ b/src/glsl/glcpp/glcpp-parse.y @@ -276,7 +276,7 @@ control_line: if (parser->skip_stack && parser->skip_stack->type == SKIP_TO_ELSE) { - glcpp_error(& @1, parser, "#elif needs an expression"); + glcpp_error(& @1, parser, "#elif with no expression"); } else { diff --git a/src/glsl/glcpp/tests/081-elif-without-expression.c.expected b/src/glsl/glcpp/tests/081-elif-without-expression.c.expected index 37dcdc3238..974f0f550e 100644 --- a/src/glsl/glcpp/tests/081-elif-without-expression.c.expected +++ b/src/glsl/glcpp/tests/081-elif-without-expression.c.expected @@ -3,4 +3,3 @@ - -- cgit v1.2.3