[Aqsis-commits] SF.net SVN: aqsis:[2800] trunk/testing/regression
Brought to you by:
ltatkinson,
pgregory
From: <c4...@us...> - 2009-03-03 13:43:10
|
Revision: 2800 http://aqsis.svn.sourceforge.net/aqsis/?rev=2800&view=rev Author: c42f Date: 2009-03-03 13:43:02 +0000 (Tue, 03 Mar 2009) Log Message: ----------- Add a test case for bug #2644580: "Function overloading in RSL" Modified Paths: -------------- trunk/testing/regression/ShaderCompilerTests/jobs.cfg Added Paths: ----------- trunk/testing/regression/ShaderCompilerTests/function_overloading_bug2644580.sl trunk/testing/regression/referenceShaders/function_overloading_bug2644580.slx Added: trunk/testing/regression/ShaderCompilerTests/function_overloading_bug2644580.sl =================================================================== --- trunk/testing/regression/ShaderCompilerTests/function_overloading_bug2644580.sl (rev 0) +++ trunk/testing/regression/ShaderCompilerTests/function_overloading_bug2644580.sl 2009-03-03 13:43:02 UTC (rev 2800) @@ -0,0 +1,14 @@ +float foo( float a ) { return a; } +vector foo( vector a ) { return a; } +string foo( string a ) { return a; } + +surface function_overloading_bug2644580() +{ + float some_float = 0; + vector some_vector = (1,1,1); + string some_string = "asdf"; + + foo(some_float); + foo(some_vector); + foo(some_string); +} Modified: trunk/testing/regression/ShaderCompilerTests/jobs.cfg =================================================================== --- trunk/testing/regression/ShaderCompilerTests/jobs.cfg 2009-03-03 13:42:08 UTC (rev 2799) +++ trunk/testing/regression/ShaderCompilerTests/jobs.cfg 2009-03-03 13:43:02 UTC (rev 2800) @@ -4,39 +4,64 @@ SLCompilerJob( workingdir = "", - shader = "plastic.sl", - returnCode = 0, - stderr = "", + shader = "plastic.sl", + returnCode = 0, + stderr = "", description = "Standard plastic shader." ) SLCompilerJob( workingdir = "", - shader = "missing_semicolon.sl", - returnCode = 1, - stdout = "", - stderr = + shader = "missing_semicolon.sl", + returnCode = 1, + stdout = "", + stderr = """08/11/2008 22:45:07 ERROR: missing_semicolon.sl : 5 : syntax error 08/11/2008 22:45:07 ERROR: Shader not compiled""", - outputFiles = None, + outputFiles = None, description = "A shader with a missing semicolon." ) SLCompilerJob( - shader = "array_initialiser_bug1502751.sl", - returnCode = 1, - stdout = "", - stderr = + shader = "array_initialiser_bug1502751.sl", + returnCode = 1, + stdout = "", + stderr = """08/26/2008 08:57:22 ERROR: array_initialiser_bug1502751.sl : 9 : Error: expected exactly 4 initialisers, got 5 08/26/2008 08:57:22 ERROR: Shader not compiled""", - outputFiles = None, - description=""" - <b>Bug 1502751: Invalid array size crashes aqsis</b> - <p> - The problem is that an array inside the shader is declared as having 4 - colors but the initializer list has 5 colors. Aqsl previously compiled - the shader without a warning or error, but when the shader was used - Aqsis would crash. - </p>""") + outputFiles = None, + description=""" + <b>Bug 1502751: Invalid array size crashes aqsis</b> + <p> + The problem is that an array inside the shader is declared as having 4 + colors but the initializer list has 5 colors. Aqsl previously compiled + the shader without a warning or error, but when the shader was used + Aqsis would crash. + </p>""" +) +SLCompilerJob( + shader = "function_overloading_bug2644580.sl", + returnCode = 0, + stderr = "", + description = """ + <b>Bug 2644580: Function overloading in RSL</b> + <p> + The test case contains several overloaded versions of a function foo(), all + of which have the same name "a" for the formal parameter. The variable + declarations from different overloaded versions of the function were + clashing with the result that the compiler refused to compile the code, + complaining about no conversion from vector to string. + </p> + <p> + The problem was that the scanner places all symbols into a big global symbol + table, relying on unique prefixes to uniqueify variables in different scopes + with the same name. Unfortunately the scope prefix for a function was just the + function name, and this isn't unique for overloaded functions. This meant that + a variable "a" in a function "float foo()" could clash with a variable of the + same name "a" in an overloaded function "vector foo()". + </p>""" +) + + Added: trunk/testing/regression/referenceShaders/function_overloading_bug2644580.slx =================================================================== --- trunk/testing/regression/referenceShaders/function_overloading_bug2644580.slx (rev 0) +++ trunk/testing/regression/referenceShaders/function_overloading_bug2644580.slx 2009-03-03 13:43:02 UTC (rev 2800) @@ -0,0 +1,32 @@ +surface +AQSIS_V 1.5.0 + + +segment Data + +USES 0 + +varying float some_float +varying vector some_vector +varying string some_string + + +segment Init + + +segment Code + pushif 0 + pop some_float + pushif 1 + pushif 1 + pushif 1 + settv + pop some_vector + pushis "asdf" + pop some_string + pushv some_float + drop + pushv some_vector + drop + pushv some_string + drop This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |