From 92169b2aecd4794b7eee21f869228967245c87e2 Mon Sep 17 00:00:00 2001 From: Luc Van Oostenryck Date: Sat, 2 Jan 2021 22:30:40 +0100 Subject: add testcases for stores simplifications Signed-off-by: Luc Van Oostenryck --- validation/memops/kill-dead-store-parent0.c | 15 +++++++++++++++ validation/memops/kill-dead-store-parent2.c | 26 ++++++++++++++++++++++++++ validation/memops/kill-redundant-store0.c | 14 ++++++++++++++ 3 files changed, 55 insertions(+) create mode 100644 validation/memops/kill-dead-store-parent0.c create mode 100644 validation/memops/kill-dead-store-parent2.c create mode 100644 validation/memops/kill-redundant-store0.c diff --git a/validation/memops/kill-dead-store-parent0.c b/validation/memops/kill-dead-store-parent0.c new file mode 100644 index 00000000..1413134b --- /dev/null +++ b/validation/memops/kill-dead-store-parent0.c @@ -0,0 +1,15 @@ +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-known-to-fail + * + * 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..b563fd31 --- /dev/null +++ b/validation/memops/kill-dead-store-parent2.c @@ -0,0 +1,26 @@ +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-known-to-fail + * + * 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..e911166d --- /dev/null +++ b/validation/memops/kill-redundant-store0.c @@ -0,0 +1,14 @@ +void foo(int *ptr) +{ + int i = *ptr; + *ptr = i; +} + +/* + * check-name: kill-redundant-store0 + * check-command: test-linearize -Wno-decl $file + * check-known-to-fail + * + * check-output-ignore + * check-output-excludes: store + */ -- cgit 1.2.3-korg