aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/validation/mem2reg/stray-phisrc.c
diff options
authorLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2018-03-06 05:02:56 +0100
committerLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2018-07-01 00:18:44 +0200
commitb8c17466f25794ff9bf444f058cadf637745a02d (patch)
tree7e12e80b149f0e1e5d4e1c0dbf2e8c51810cea24 /validation/mem2reg/stray-phisrc.c
parent11380d396ac94f6c808f130268c4ac026ac19f14 (diff)
downloadsparse-dev-b8c17466f25794ff9bf444f058cadf637745a02d.tar.gz
testsuite: improve mem2reg testcases
A few tests are added, some have been renamed to better refect their purposes. Finally, some checks have been added or tweaked. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Diffstat (limited to 'validation/mem2reg/stray-phisrc.c')
-rw-r--r--validation/mem2reg/stray-phisrc.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/validation/mem2reg/stray-phisrc.c b/validation/mem2reg/stray-phisrc.c
new file mode 100644
index 00000000..e9f35c89
--- /dev/null
+++ b/validation/mem2reg/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\\.
+ */