From 52f02114bad02a2a705ecc3fe5904ff449196f50 Mon Sep 17 00:00:00 2001 From: Luc Van Oostenryck Date: Wed, 17 Mar 2021 00:00:23 +0100 Subject: add testcases to check if phi-sources from removed targets are removed too Signed-off-by: Luc Van Oostenryck --- validation/optim/bad-phisrc1.c | 16 ++++++++++++++++ validation/optim/bad-phisrc1a.c | 24 ++++++++++++++++++++++++ validation/optim/bad-phisrc2.c | 17 +++++++++++++++++ validation/optim/bad-phisrc3.c | 21 +++++++++++++++++++++ 4 files changed, 78 insertions(+) create mode 100644 validation/optim/bad-phisrc1.c create mode 100644 validation/optim/bad-phisrc1a.c create mode 100644 validation/optim/bad-phisrc2.c create mode 100644 validation/optim/bad-phisrc3.c diff --git a/validation/optim/bad-phisrc1.c b/validation/optim/bad-phisrc1.c new file mode 100644 index 00000000..59c5e4f1 --- /dev/null +++ b/validation/optim/bad-phisrc1.c @@ -0,0 +1,16 @@ +void foo(int a, int b) +{ + if (b) + while ((a += 5) > a) + ; +} + +/* + * check-name: bad-phisrc1 + * check-command: test-linearize -Wno-decl $file + * check-known-to-fail + * + * check-output-ignore + * check-output-excludes: phi\\. + * check-output-excludes: phisource\\. + */ diff --git a/validation/optim/bad-phisrc1a.c b/validation/optim/bad-phisrc1a.c new file mode 100644 index 00000000..cf07573b --- /dev/null +++ b/validation/optim/bad-phisrc1a.c @@ -0,0 +1,24 @@ +int def(void); + +int fun4(struct xfrm_state *net, int cnt) +{ + int err = 0; + if (err) + goto out; + for (; net;) + err = def(); + if (cnt) +out: + return err; + return 0; +} + +/* + * check-name: bad-phisrc1a + * check-command: test-linearize -Wno-decl $file + * check-known-to-fail + * + * check-output-ignore + * check-output-contains: select\\. + */ + diff --git a/validation/optim/bad-phisrc2.c b/validation/optim/bad-phisrc2.c new file mode 100644 index 00000000..3eade688 --- /dev/null +++ b/validation/optim/bad-phisrc2.c @@ -0,0 +1,17 @@ +int bad_phisrc2(int p, int a, int r) +{ + if (p) + r = a; + else if (r) + ; + return r; +} + +/* + * check-name: bad-phisrc2 + * check-command: test-linearize -Wno-decl $file + * check-known-to-fail + * + * check-output-ignore + * check-output-contains: select\\. + */ diff --git a/validation/optim/bad-phisrc3.c b/validation/optim/bad-phisrc3.c new file mode 100644 index 00000000..6e437771 --- /dev/null +++ b/validation/optim/bad-phisrc3.c @@ -0,0 +1,21 @@ +void foo(void) +{ + int c = 1; + switch (3) { + case 0: + do { + ; + case 3: ; + } while (c++); + } +} + +/* + * check-name: bad-phisrc3 + * check-command: test-linearize -Wno-decl $file + * check-known-to-fail + * + * check-output-ignore + * check-output-pattern(2): phisrc\\. + * check-output-pattern(1): phi\\. + */ -- cgit 1.2.3-korg