From 0394c281af257abb24774bd6f081b7abb9f821e3 Mon Sep 17 00:00:00 2001 From: Luc Van Oostenryck Date: Sat, 11 Jul 2020 15:38:34 +0200 Subject: add testcase for incorrect empty expressions Signed-off-by: Luc Van Oostenryck --- validation/empty-assign.c | 14 ++++++++++++++ validation/empty-initializer.c | 10 ++++++++++ 2 files changed, 24 insertions(+) create mode 100644 validation/empty-assign.c create mode 100644 validation/empty-initializer.c diff --git a/validation/empty-assign.c b/validation/empty-assign.c new file mode 100644 index 00000000..48ac626d --- /dev/null +++ b/validation/empty-assign.c @@ -0,0 +1,14 @@ +static int foo(int a) +{ + a = ; // KO + return a; +} + +/* + * check-name: empty-assign + * check-known-to-fail + * + * check-error-start +empty-assign.c:3:11: error: expression expected before ';' + * check-error-end + */ diff --git a/validation/empty-initializer.c b/validation/empty-initializer.c new file mode 100644 index 00000000..0ca763f6 --- /dev/null +++ b/validation/empty-initializer.c @@ -0,0 +1,10 @@ +static int i = ; // KO + +/* + * check-name: empty-initializer + * check-known-to-fail + * + * check-error-start +empty-initializer.c:1:16: error: expression expected before ';' + * check-error-end + */ -- cgit 1.2.3-korg