Added error output to the preprocessor.
This patch distinguishes preprocessing errors with normal parsing errors and gives glslangValidator the ability to output preprocessing errors.
This commit is contained in:
2
Test/baseResults/preprocessor.edge_cases.vert.err
Normal file
2
Test/baseResults/preprocessor.edge_cases.vert.err
Normal file
@@ -0,0 +1,2 @@
|
||||
Warning, version 310 is not yet complete; most version-specific features are present, but some are missing.
|
||||
|
||||
8
Test/baseResults/preprocessor.errors.vert.err
Normal file
8
Test/baseResults/preprocessor.errors.vert.err
Normal file
@@ -0,0 +1,8 @@
|
||||
Warning, version 310 is not yet complete; most version-specific features are present, but some are missing.
|
||||
ERROR: 0:9: '#error' : This should show up in pp output .
|
||||
ERROR: 0:14: '#' : invalid directive: def
|
||||
ERROR: 0:15: 'preprocessor evaluation' : undefined macro in expression not allowed in es profile Y
|
||||
ERROR: 0:21: '' : missing #endif
|
||||
ERROR: 4 compilation errors. No code generated.
|
||||
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
#version 310 es
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#error This should show up in pp output .
|
||||
|
||||
|
||||
|
||||
|
||||
int main(){
|
||||
}
|
||||
|
||||
|
||||
4
Test/baseResults/preprocessor.extensions.vert.err
Normal file
4
Test/baseResults/preprocessor.extensions.vert.err
Normal file
@@ -0,0 +1,4 @@
|
||||
Warning, version 310 is not yet complete; most version-specific features are present, but some are missing.
|
||||
WARNING: 0:5: '#extension' : extension is only partially supported: GL_EXT_gpu_shader5
|
||||
WARNING: 0:6: '#extension' : extension not supported: GL_EXT_shader_texture_image_samples
|
||||
|
||||
2
Test/baseResults/preprocessor.function_macro.vert.err
Normal file
2
Test/baseResults/preprocessor.function_macro.vert.err
Normal file
@@ -0,0 +1,2 @@
|
||||
Warning, version 310 is not yet complete; most version-specific features are present, but some are missing.
|
||||
|
||||
0
Test/baseResults/preprocessor.line.vert.err
Normal file
0
Test/baseResults/preprocessor.line.vert.err
Normal file
2
Test/baseResults/preprocessor.pragma.vert.err
Normal file
2
Test/baseResults/preprocessor.pragma.vert.err
Normal file
@@ -0,0 +1,2 @@
|
||||
Warning, version 310 is not yet complete; most version-specific features are present, but some are missing.
|
||||
|
||||
2
Test/baseResults/preprocessor.simple.vert.err
Normal file
2
Test/baseResults/preprocessor.simple.vert.err
Normal file
@@ -0,0 +1,2 @@
|
||||
Warning, version 310 is not yet complete; most version-specific features are present, but some are missing.
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
int x(){
|
||||
something that shouldnt compile;
|
||||
}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
#version 310 es
|
||||
|
||||
#define X
|
||||
#define X 1
|
||||
|
||||
#if X
|
||||
#if Y
|
||||
#ifdef Y
|
||||
#error This should not show up in pp output.
|
||||
#endif
|
||||
#error This should show up in pp output.
|
||||
@@ -11,5 +11,10 @@
|
||||
#error This should not show up in pp output.
|
||||
#endif
|
||||
|
||||
#def X
|
||||
#if Y
|
||||
|
||||
#extension a
|
||||
|
||||
int main() {
|
||||
}
|
||||
|
||||
4
Test/preprocessor.success_if_parse_would_fail.vert
Normal file
4
Test/preprocessor.success_if_parse_would_fail.vert
Normal file
@@ -0,0 +1,4 @@
|
||||
int x() {
|
||||
something that shouldnt compile;
|
||||
}
|
||||
|
||||
@@ -61,8 +61,9 @@ rm -f comp.spv frag.spv geom.spv tesc.spv tese.spv vert.spv
|
||||
while read t; do
|
||||
echo Running Preprocessor $t...
|
||||
b=`basename $t`
|
||||
$EXE -E $t > $TARGETDIR/$b.out
|
||||
$EXE -E $t > $TARGETDIR/$b.out 2> $TARGETDIR/$b.err
|
||||
diff -b $BASEDIR/$b.out $TARGETDIR/$b.out || HASERROR=1
|
||||
diff -b $BASEDIR/$b.err $TARGETDIR/$b.err || HASERROR=1
|
||||
done < test-preprocessor-list
|
||||
|
||||
#
|
||||
|
||||
@@ -5,3 +5,4 @@ preprocessor.function_macro.vert
|
||||
preprocessor.line.vert
|
||||
preprocessor.pragma.vert
|
||||
preprocessor.simple.vert
|
||||
preprocessor.success_if_parse_would_fail.vert
|
||||
|
||||
Reference in New Issue
Block a user