diff options
| author | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2017-02-26 06:27:16 +0100 |
|---|---|---|
| committer | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2017-11-13 14:16:51 +0100 |
| commit | d3936a687de422ee39824e6f091822da76cc8ae4 (patch) | |
| tree | 35b3015b581d0ab1a5b190a52a523c5f1a2664eb | |
| parent | 5dab1f97a535ffd94337b9e9a5ce84464557a616 (diff) | |
| download | sparse-dev-d3936a687de422ee39824e6f091822da76cc8ae4.tar.gz | |
add test case for memory to register problem
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
| -rw-r--r-- | validation/linear/stray-phisrc.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/validation/linear/stray-phisrc.c b/validation/linear/stray-phisrc.c new file mode 100644 index 00000000..e9f35c89 --- /dev/null +++ b/validation/linear/stray-phisrc.c @@ -0,0 +1,25 @@ +static int foo(int **g) +{ + int i = 1; + int *a[2]; + int **p; + + a[1] = &i; + if (g) + p = g; + else + p = &a[0]; + p += 1; // will point to a[1] = &i + if (!g) + **p = 0; + return i; +} + +/* + * check-name: stray phisrc + * check-command: test-linearize -Wno-decl $file + * check-known-to-fail + * + * check-output-ignore + * check-output-excludes: phisrc\\. + */ |
