diff options
| author | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2020-06-19 15:42:07 +0200 |
|---|---|---|
| committer | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2020-06-19 15:44:52 +0200 |
| commit | e06c9268c4e96f4d011d46ee8bbe5de7e264d0fa (patch) | |
| tree | 5016eab52e89971f5e03bc3e2cae762aeb71ae1f /validation | |
| parent | c290ad8ed9bce2634231af82b62e1589ff4b0e57 (diff) | |
| download | sparse-dev-e06c9268c4e96f4d011d46ee8bbe5de7e264d0fa.tar.gz | |
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 <luc.vanoostenryck@gmail.com>
Diffstat (limited to 'validation')
| -rw-r--r-- | validation/generic-dr481.c | 17 |
1 files changed, 17 insertions, 0 deletions
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 + */ |
