diff options
author | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2019-11-03 20:53:38 +0100 |
---|---|---|
committer | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2020-12-29 14:39:38 +0100 |
commit | 1d2355e60f36b49ca680c892b60bf8e4a7f59942 (patch) | |
tree | 86bbd888906960516397ba0fc651bf72b60a5c96 | |
parent | 6d8a3e9551de00258d1663adf87d29954ef96555 (diff) | |
download | sparse-1d2355e60f36b49ca680c892b60bf8e4a7f59942.tar.gz |
add testcases for enum attributes
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
-rw-r--r-- | validation/parsing/enum-attr.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/validation/parsing/enum-attr.c b/validation/parsing/enum-attr.c new file mode 100644 index 00000000..a962d8b4 --- /dev/null +++ b/validation/parsing/enum-attr.c @@ -0,0 +1,29 @@ +#define __attr __attribute__((deprecated)) + +enum { + old __attr, + cur __attr = 42, + new, +}; + +enum odd { + odd = __attr 33, +}; + +enum bad { + bad = 43 __attr, +}; + +/* + * check-name: enum-attr + * + * check-error-start +parsing/enum-attr.c:10:15: error: typename in expression +parsing/enum-attr.c:10:15: error: undefined identifier '__attribute__' +parsing/enum-attr.c:10:15: error: bad constant expression type +parsing/enum-attr.c:10:22: error: Expected } at end of struct-union-enum-specifier +parsing/enum-attr.c:10:22: error: got 33 +parsing/enum-attr.c:14:18: error: Expected } at end of struct-union-enum-specifier +parsing/enum-attr.c:14:18: error: got __attribute__ + * check-error-end + */ |