diff options
| author | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2020-11-18 20:18:45 +0100 |
|---|---|---|
| committer | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2020-11-18 21:57:55 +0100 |
| commit | d1351f69d73dc44529c03edaa9557f3318b0212c (patch) | |
| tree | 7b602a9e379b14712eab5811478a52bac79ed813 /validation/eval/unqual-postop.c | |
| parent | 626c474204e8262467a316099b6074cab964237c (diff) | |
| download | sparse-dev-d1351f69d73dc44529c03edaa9557f3318b0212c.tar.gz | |
unqual: add testcases
Add some testcases related to qualifier dropping / lvalue conversion.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Diffstat (limited to 'validation/eval/unqual-postop.c')
| -rw-r--r-- | validation/eval/unqual-postop.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/validation/eval/unqual-postop.c b/validation/eval/unqual-postop.c new file mode 100644 index 00000000..fb3082dc --- /dev/null +++ b/validation/eval/unqual-postop.c @@ -0,0 +1,23 @@ +static void test_volatile(void) +{ + volatile int x = 0; + int *pp; + + typeof(++x) v1; pp = &v1; // KO + typeof(x++) v2; pp = &v2; // KO +} + +/* + * check-name: unqual-postop + * check-command: sparse -Wno-declaration-after-statement $file + * check-known-to-fail + * + * check-error-start +eval/unqual-postop.c:6:40: warning: incorrect type in assignment (different modifiers) +eval/unqual-postop.c:6:40: expected int *pp +eval/unqual-postop.c:6:40: got int volatile * +eval/unqual-postop.c:7:40: warning: incorrect type in assignment (different modifiers) +eval/unqual-postop.c:7:40: expected int *pp +eval/unqual-postop.c:7:40: got int volatile * + * check-error-end + */ |
