aboutsummaryrefslogtreecommitdiff
path: root/test/run_tests.cpp
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2016-05-13 13:08:54 -0700
committerAndrew Kelley <superjoe30@gmail.com>2016-05-13 13:08:54 -0700
commit33e3d5645344d5c8076a1f020d49917334f6902a (patch)
treecef7fac7e9eedd1c5004bdcf3aa02b0bacb9fb1c /test/run_tests.cpp
parent65e0e85685ac704088cc0ee319c6e4c51adb0c8b (diff)
downloadzig-33e3d5645344d5c8076a1f020d49917334f6902a.tar.gz
zig-33e3d5645344d5c8076a1f020d49917334f6902a.zip
add error for wrong return type of main
Diffstat (limited to 'test/run_tests.cpp')
-rw-r--r--test/run_tests.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/test/run_tests.cpp b/test/run_tests.cpp
index 1d7e82e0b0..5df005e648 100644
--- a/test/run_tests.cpp
+++ b/test/run_tests.cpp
@@ -1391,6 +1391,10 @@ fn something() -> %void { }
".tmp_source.zig:3:5: error: %return statement in function with return type 'void'",
".tmp_source.zig:2:8: note: function return type here");
+ add_compile_fail_case("wrong return type for main", R"SOURCE(
+pub fn main(args: [][]u8) { }
+ )SOURCE", 1, ".tmp_source.zig:2:27: error: expected return type of main to be '%void', instead is 'void'");
+
}
//////////////////////////////////////////////////////////////////////////////