aboutsummaryrefslogtreecommitdiff
path: root/test/standalone.cpp
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2015-11-27 10:52:31 -0700
committerAndrew Kelley <superjoe30@gmail.com>2015-11-27 10:52:31 -0700
commit9ca9a2c5540683a54bae597c59152d06d095beef (patch)
tree6a0b9c01c5bfaeaeaa230ea184baf9561f3ed03c /test/standalone.cpp
parent821907317eb77a96dc53adf20ac705b4501e2ab8 (diff)
downloadzig-9ca9a2c5540683a54bae597c59152d06d095beef.tar.gz
zig-9ca9a2c5540683a54bae597c59152d06d095beef.zip
allow empty function and return with no expression
Diffstat (limited to 'test/standalone.cpp')
-rw-r--r--test/standalone.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/test/standalone.cpp b/test/standalone.cpp
index caeb926a06..a4848db127 100644
--- a/test/standalone.cpp
+++ b/test/standalone.cpp
@@ -66,7 +66,12 @@ static void add_all_test_cases(void) {
fn exit(code: i32) -> unreachable;
}
+ fn empty_function_1() {}
+ fn empty_function_2() { return; }
+
fn _start() -> unreachable {
+ empty_function_1();
+ empty_function_2();
this_is_a_function();
}
@@ -86,7 +91,7 @@ static void add_all_test_cases(void) {
/**
* multi line doc comment
*/
- fn another_function() -> i32 { return 0; }
+ fn another_function() {}
/// this is a documentation comment
/// doc comment line 2