diff options
-rw-r--r-- | src/glsl/glcpp/glcpp-parse.y | 2 | ||||
-rw-r--r-- | src/glsl/glcpp/tests/126-garbage-after-directive.c | 5 | ||||
-rw-r--r-- | src/glsl/glcpp/tests/126-garbage-after-directive.c.expected | 8 |
3 files changed, 14 insertions, 1 deletions
diff --git a/src/glsl/glcpp/glcpp-parse.y b/src/glsl/glcpp/glcpp-parse.y index 267940156c4..21c85b410f5 100644 --- a/src/glsl/glcpp/glcpp-parse.y +++ b/src/glsl/glcpp/glcpp-parse.y @@ -625,7 +625,7 @@ replacement_list: junk: /* empty */ | pp_tokens { - glcpp_warning(&@1, parser, "extra tokens at end of directive"); + glcpp_error(&@1, parser, "extra tokens at end of directive"); } ; diff --git a/src/glsl/glcpp/tests/126-garbage-after-directive.c b/src/glsl/glcpp/tests/126-garbage-after-directive.c new file mode 100644 index 00000000000..4c0d29000a3 --- /dev/null +++ b/src/glsl/glcpp/tests/126-garbage-after-directive.c @@ -0,0 +1,5 @@ +#ifdef MACRO garbage +#endif + +#ifndef MORE garbage +#endif diff --git a/src/glsl/glcpp/tests/126-garbage-after-directive.c.expected b/src/glsl/glcpp/tests/126-garbage-after-directive.c.expected new file mode 100644 index 00000000000..95a9e61ebcb --- /dev/null +++ b/src/glsl/glcpp/tests/126-garbage-after-directive.c.expected @@ -0,0 +1,8 @@ +0:1(15): preprocessor error: extra tokens at end of directive +0:4(14): preprocessor error: extra tokens at end of directive + + + + + + |