From e06c9268c4e96f4d011d46ee8bbe5de7e264d0fa Mon Sep 17 00:00:00 2001 From: Luc Van Oostenryck Date: Fri, 19 Jun 2020 15:42:07 +0200 Subject: gensel: add testcases from DR481 Following the resolution of DR481, the controlling expression is subject to a few different rules. Add the testcases from this defect report. Signed-off-by: Luc Van Oostenryck --- validation/generic-dr481.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 validation/generic-dr481.c diff --git a/validation/generic-dr481.c b/validation/generic-dr481.c new file mode 100644 index 00000000..2ed15c9b --- /dev/null +++ b/validation/generic-dr481.c @@ -0,0 +1,17 @@ +static char const* a = _Generic("bla", char*: "blu"); +static char const* b = _Generic("bla", char[4]: "blu"); +static char const* c = _Generic((int const){ 0 }, int: "blu"); +static char const* d = _Generic((int const){ 0 }, int const: "blu"); +static char const* e = _Generic(+(int const){ 0 }, int: "blu"); +static char const* f = _Generic(+(int const){ 0 }, int const: "blu"); + +/* + * check-name: generic-dr481 + * check-known-to-fail + * + * check-error-start +generic-dr481.c:2:32: error: no generic selection for 'char *' +generic-dr481.c:4:32: error: no generic selection for 'int const [toplevel]' +generic-dr481.c:6:32: error: no generic selection for 'int' + * check-error-end + */ -- cgit 1.2.3-korg