Track whether function declarations are prototypes, and only allow at most one prototype for ES 100.

git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@24342 e7fa87d3-cd2b-0410-9028-fcbf551c1848
This commit is contained in:
John Kessenich 2013-12-04 19:43:05 +00:00
parent e1f0f5b31f
commit b88c60b03f
13 changed files with 101 additions and 25 deletions

View file

@ -164,6 +164,16 @@ void foo323433()
}
int fgfg(float f, mediump int i);
int fgfg(float f, highp int i); // ERROR, precision qualifier difference
int fgfg(float f, highp int i) { return 2; } // ERROR, precision qualifier difference
int fffg(float f);
int fffg(float f); // ERROR, can't have multiple prototypes
int gggf(float f);
int gggf(float f) { return 2; }
int agggf(float f) { return 2; }
int agggf(float f);
int agggf(float f); // ERROR, second prototype
uniform samplerExternalOES badExt; // syntax ERROR

View file

@ -147,3 +147,13 @@ int[] foo213234(); // ERROR
int foo234234(float[]); // ERROR
int foo234235(vec2[] v); // ERROR
precision highp float[2]; // ERROR
int fffg(float f);
int fffg(float f);
int gggf(float f);
int gggf(float f) { return 2; }
int gggf(float f);
int agggf(float f) { return 2; }
int agggf(float f);

View file

@ -63,8 +63,10 @@ ERROR: 0:147: 'texture2DProjGradEXT' : required extension not requested: GL_EXT_
ERROR: 0:151: 'floating-point suffix' : not supported for this version or the enabled extensions
ERROR: 0:152: 'floating-point suffix' : not supported for this version or the enabled extensions
ERROR: 0:167: 'highp' : overloaded functions must have the same parameter precision qualifiers for argument 2
ERROR: 0:169: '' : syntax error
ERROR: 58 compilation errors. No code generated.
ERROR: 0:170: 'multiple prototypes for same function' : not supported for this version or the enabled extensions
ERROR: 0:177: 'multiple prototypes for same function' : not supported for this version or the enabled extensions
ERROR: 0:179: '' : syntax error
ERROR: 60 compilation errors. No code generated.
ERROR: node is still EOpNull!
@ -294,6 +296,28 @@ ERROR: node is still EOpNull!
0:163 'f13' (invariant mediump float)
0:163 Construct vec3 (3-component vector of float)
0:163 'f13' (invariant mediump float)
0:167 Function Definition: fgfg(f1;i1; (mediump int)
0:167 Function Parameters:
0:167 'f' (in mediump float)
0:167 'i' (in highp int)
0:167 Sequence
0:167 Branch: Return with expression
0:167 Constant:
0:167 2 (const int)
0:173 Function Definition: gggf(f1; (mediump int)
0:173 Function Parameters:
0:173 'f' (in mediump float)
0:173 Sequence
0:173 Branch: Return with expression
0:173 Constant:
0:173 2 (const int)
0:175 Function Definition: agggf(f1; (mediump int)
0:175 Function Parameters:
0:175 'f' (in mediump float)
0:175 Sequence
0:175 Branch: Return with expression
0:175 Constant:
0:175 2 (const int)
0:? Linker Objects
0:? 'a' (3-element array of mediump int)
0:? 'uint' (mediump int)

View file

@ -1,6 +1,6 @@
100scope.vert
ERROR: 0:5: 'a' : redefinition
ERROR: 0:17: 'b' : redeclaration of existing name
ERROR: 0:17: 'b' : function name is redeclaration of existing name
ERROR: 0:19: 'f' : redefinition
ERROR: 0:21: 'redefinition of built-in function' : not supported with this profile: es
ERROR: 0:22: 'redefinition of built-in function' : not supported with this profile: es

View file

@ -241,6 +241,20 @@ ERROR: node is still EOpNull!
0:143 move second child to first child (3-element array of highp float)
0:143 'w' (3-element array of highp float)
0:143 'y' (3-element array of highp float)
0:155 Function Definition: gggf(f1; (highp int)
0:155 Function Parameters:
0:155 'f' (in highp float)
0:155 Sequence
0:155 Branch: Return with expression
0:155 Constant:
0:155 2 (const int)
0:158 Function Definition: agggf(f1; (highp int)
0:158 Function Parameters:
0:158 'f' (in highp float)
0:158 Sequence
0:158 Branch: Return with expression
0:158 Constant:
0:158 2 (const int)
0:? Linker Objects
0:? 'm43' (uniform highp 4X3 matrix of float)
0:? 'm33' (uniform highp 3X3 matrix of float)

View file

@ -1,15 +1,15 @@
300scope.vert
ERROR: 0:5: 'a' : redefinition
ERROR: 0:17: 'b' : redeclaration of existing name
ERROR: 0:17: 'b' : function name is redeclaration of existing name
ERROR: 0:19: 'f' : redefinition
ERROR: 0:20: 'tan' : redefinition
ERROR: 0:21: 'redefinition of built-in function' : not supported with this profile: es
ERROR: 0:21: 'sin' : redeclaration of existing name
ERROR: 0:21: 'sin' : function name is redeclaration of existing name
ERROR: 0:22: 'redefinition of built-in function' : not supported with this profile: es
ERROR: 0:22: 'cos' : redeclaration of existing name
ERROR: 0:22: 'cos' : function name is redeclaration of existing name
ERROR: 0:22: 'cos' : function already has a body
ERROR: 0:24: 'return' : void function cannot return a value
ERROR: 0:26: 'radians' : redeclaration of existing name
ERROR: 0:26: 'radians' : function name is redeclaration of existing name
ERROR: 0:26: 'radians' : can't find function
ERROR: 0:28: 'return' : void function cannot return a value
ERROR: 0:35: 'local function declaration' : not supported with this profile: es

View file

@ -1,7 +1,7 @@
430scope.vert
Warning, version 430 is not yet complete; some version-specific features are present, but many are missing.
ERROR: 0:5: 'a' : redefinition
ERROR: 0:17: 'b' : redeclaration of existing name
ERROR: 0:17: 'b' : function name is redeclaration of existing name
ERROR: 0:19: 'f' : redefinition
ERROR: 0:54: 'z' : undeclared identifier
ERROR: 0:54: 'z' : redefinition