Fix line number handling in line directive callback.
The line argument passed into the lineCallback function is the literal value of the first argument of the #line directive. lastLine in DoPreprocessing() should be updated taking into consideration the different definitions for #line between specs. Add a test to reveal the bug.
This commit is contained in:
2
Test/baseResults/preprocessor.line.frag.err
Normal file
2
Test/baseResults/preprocessor.line.frag.err
Normal file
@@ -0,0 +1,2 @@
|
||||
Warning, version 310 is not yet complete; most version-specific features are present, but some are missing.
|
||||
|
||||
6
Test/baseResults/preprocessor.line.frag.out
Normal file
6
Test/baseResults/preprocessor.line.frag.out
Normal file
@@ -0,0 +1,6 @@
|
||||
#version 310 es
|
||||
|
||||
#line 1 2
|
||||
#pragma something
|
||||
void main(){ }
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
#line 2
|
||||
|
||||
#line 0
|
||||
|
||||
#line 4
|
||||
|
||||
#line 8
|
||||
|
||||
4
Test/preprocessor.line.frag
Normal file
4
Test/preprocessor.line.frag
Normal file
@@ -0,0 +1,4 @@
|
||||
#version 310 es
|
||||
#line 1 2
|
||||
#pragma something
|
||||
void main() {}
|
||||
@@ -3,5 +3,6 @@ preprocessor.errors.vert
|
||||
preprocessor.extensions.vert
|
||||
preprocessor.function_macro.vert
|
||||
preprocessor.line.vert
|
||||
preprocessor.line.frag
|
||||
preprocessor.pragma.vert
|
||||
preprocessor.simple.vert
|
||||
|
||||
Reference in New Issue
Block a user