summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2010-03-30 23:37:51 -1000
committerEric Anholt <eric@anholt.net>2010-03-30 23:37:51 -1000
commit174cc03edcd6861ba416cc1afb19d4d43933ac84 (patch)
treea99b54674484e0952c675f10358198bc0e60bf2a
parentaad7c7793788f34e98fb7264dc2219fc73002877 (diff)
Test that main doesn't take any parameters.
Fixes main2.vert.
-rw-r--r--ast_to_hir.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/ast_to_hir.cpp b/ast_to_hir.cpp
index 1f81a94327..a0fe37b548 100644
--- a/ast_to_hir.cpp
+++ b/ast_to_hir.cpp
@@ -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.