Test that main doesn't take any parameters.
authorEric Anholt <eric@anholt.net>
Wed, 31 Mar 2010 09:37:51 +0000 (23:37 -1000)
committerEric Anholt <eric@anholt.net>
Wed, 31 Mar 2010 09:37:51 +0000 (23:37 -1000)
Fixes main2.vert.

ast_to_hir.cpp

index 1f81a9432796f7df6614c88ac849993f1052472b..a0fe37b548514434548126ae1095ee9a20308401 100644 (file)
@@ -1462,6 +1462,12 @@ ast_function_definition::hir(exec_list *instructions,
 
         _mesa_glsl_error(& loc, state, "main() must return void");
       }
+
+      if (!parameters.is_empty()) {
+        YYLTYPE loc = this->get_location();
+
+        _mesa_glsl_error(& loc, state, "main() must not take any parameters");
+      }
    }
 
    /* Finish storing the information about this new function in its signature.