diff options
| author | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2021-04-17 16:05:34 +0200 |
|---|---|---|
| committer | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2021-04-17 16:05:34 +0200 |
| commit | e19144ebc795f522a271763b0384610da792bd1a (patch) | |
| tree | f9d9418332d8fb54d993bd295d3d6ceba8c44d80 /validation | |
| parent | 038c1f95e46b9ce6191f191b90b8ef2655f45c84 (diff) | |
| parent | 23109ddefaadf1a476ea47d123994e5f073f701e (diff) | |
| download | sparse-dev-e19144ebc795f522a271763b0384610da792bd1a.tar.gz | |
Merge branch 'deadstore'
* memops: kill more dead stores
Diffstat (limited to 'validation')
| -rw-r--r-- | validation/memops/kill-dead-store-parent0.c | 14 | ||||
| -rw-r--r-- | validation/memops/kill-dead-store-parent2.c | 25 | ||||
| -rw-r--r-- | validation/memops/kill-redundant-store0.c | 13 |
3 files changed, 52 insertions, 0 deletions
diff --git a/validation/memops/kill-dead-store-parent0.c b/validation/memops/kill-dead-store-parent0.c new file mode 100644 index 00000000..c1b2466c --- /dev/null +++ b/validation/memops/kill-dead-store-parent0.c @@ -0,0 +1,14 @@ +void foo(int *ptr, int p) +{ + if (p) + *ptr = 1; + *ptr = 0; +} + +/* + * check-name: kill-dead-store-parent0 + * check-command: test-linearize -Wno-decl $file + * + * check-output-ignore + * check-output-pattern(1): store + */ diff --git a/validation/memops/kill-dead-store-parent2.c b/validation/memops/kill-dead-store-parent2.c new file mode 100644 index 00000000..4f7b9dd9 --- /dev/null +++ b/validation/memops/kill-dead-store-parent2.c @@ -0,0 +1,25 @@ +int ladder02(int *ptr, int p, int x) +{ + *ptr = x++; + if (p) + goto l11; + else + goto l12; +l11: + *ptr = x++; + goto l20; +l12: + *ptr = x++; + goto l20; +l20: + *ptr = x++; + return *ptr; +} + +/* + * check-name: kill-dead-store-parent2 + * check-command: test-linearize -Wno-decl $file + * + * check-output-ignore + * check-output-pattern(1): store + */ diff --git a/validation/memops/kill-redundant-store0.c b/validation/memops/kill-redundant-store0.c new file mode 100644 index 00000000..8819938f --- /dev/null +++ b/validation/memops/kill-redundant-store0.c @@ -0,0 +1,13 @@ +void foo(int *ptr) +{ + int i = *ptr; + *ptr = i; +} + +/* + * check-name: kill-redundant-store0 + * check-command: test-linearize -Wno-decl $file + * + * check-output-ignore + * check-output-excludes: store + */ |
