summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/glsl/glcpp/glcpp-lex.l2
-rw-r--r--src/glsl/glcpp/tests/141-pragma-and-__LINE__.c6
-rw-r--r--src/glsl/glcpp/tests/141-pragma-and-__LINE__.c.expected6
3 files changed, 12 insertions, 2 deletions
diff --git a/src/glsl/glcpp/glcpp-lex.l b/src/glsl/glcpp/glcpp-lex.l
index 2b92fd37e2b..430abd4bfa3 100644
--- a/src/glsl/glcpp/glcpp-lex.l
+++ b/src/glsl/glcpp/glcpp-lex.l
@@ -291,8 +291,6 @@ HEXADECIMAL_INTEGER 0[xX][0-9a-fA-F]+[uU]?
* Simply pass them through to the main compiler's lexer/parser. */
<HASH>(extension|pragma)[^\r\n]* {
BEGIN INITIAL;
- yylineno++;
- yycolumn = 0;
RETURN_STRING_TOKEN (PRAGMA);
}
diff --git a/src/glsl/glcpp/tests/141-pragma-and-__LINE__.c b/src/glsl/glcpp/tests/141-pragma-and-__LINE__.c
new file mode 100644
index 00000000000..a93f3ce35fd
--- /dev/null
+++ b/src/glsl/glcpp/tests/141-pragma-and-__LINE__.c
@@ -0,0 +1,6 @@
+Line 1 /* Test for a bug where #pragma was throwing off the __LINE__ count. */
+Line __LINE__ /* Line 2 */
+#pragma Line 3
+Line __LINE__ /* Line 4 */
+#pragma Line 5
+Line __LINE__ /* Line 6 */
diff --git a/src/glsl/glcpp/tests/141-pragma-and-__LINE__.c.expected b/src/glsl/glcpp/tests/141-pragma-and-__LINE__.c.expected
new file mode 100644
index 00000000000..330731dc800
--- /dev/null
+++ b/src/glsl/glcpp/tests/141-pragma-and-__LINE__.c.expected
@@ -0,0 +1,6 @@
+Line 1
+Line 2
+#pragma Line 3
+Line 4
+#pragma Line 5
+Line 6