From 8a207a4dc7e1f548bcca82c6ed56559f9aa80668 Mon Sep 17 00:00:00 2001 From: Rui Ueyama Date: Thu, 15 Aug 2019 17:21:15 +0900 Subject: [PATCH] Allow functions returning void --- tests | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests b/tests index 3068907..f0ed45c 100644 --- a/tests +++ b/tests @@ -70,6 +70,8 @@ static int static_fn() { return 3; } int param_decay(int x[]) { return x[0]; } +void voidfn() {} + int main() { assert(8, ({ int a=3; int z=5; a+z; }), "int a=3; int z=5; a+z;"); @@ -451,6 +453,8 @@ int main() { assert(2, ({ int i=0; switch(1) { case 0: 0; case 1: 0; case 2: 0; i=2; } i; }), "int i=0; switch(1) { case 0: 0; case 1: 0; case 2: 0; i=2; } i;"); assert(0, ({ int i=0; switch(3) { case 0: 0; case 1: 0; case 2: 0; i=2; } i; }), "int i=0; switch(3) { case 0: 0; case 1: 0; case 2: 0; i=2; } i;"); + voidfn(); + printf("OK\n"); return 0; } -- GitLab