diff options
| author | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2018-07-24 16:48:44 +0200 |
|---|---|---|
| committer | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2018-07-25 11:38:06 +0200 |
| commit | 57d11fc64aebe648c0c64e10e47503d3e2f60218 (patch) | |
| tree | 36e31cc6a449a768030b279addfcc737efa5a0d1 /validation | |
| parent | 0e733d7e130cfb6a9ef174b1aea3760a8ce670e4 (diff) | |
| download | sparse-dev-57d11fc64aebe648c0c64e10e47503d3e2f60218.tar.gz | |
testcases: add testcase for missing detection of out-of-bound stores
Apparently, only loads are detected, stores are not.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Diffstat (limited to 'validation')
| -rw-r--r-- | validation/check_access-store.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/validation/check_access-store.c b/validation/check_access-store.c new file mode 100644 index 00000000..489507fd --- /dev/null +++ b/validation/check_access-store.c @@ -0,0 +1,21 @@ +extern int a[1]; + +static int r(void) +{ + return a[1]; +} + +static void w(void) +{ + a[1] = 2; +} + +/* + * check-name: check_access-store + * check-known-to-fail + * + * check-error-start +check_access-store.c:5:17: warning: invalid access past the end of 'a' (4 4) +check_access-store.c:10:17: warning: invalid access past the end of 'a' (4 4) + * check-error-end + */ |
