aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/validation/linear
diff options
Diffstat (limited to 'validation/linear')
-rw-r--r--validation/linear/cast-volatile.c14
-rw-r--r--validation/linear/stray-phisrc.c25
2 files changed, 39 insertions, 0 deletions
diff --git a/validation/linear/cast-volatile.c b/validation/linear/cast-volatile.c
new file mode 100644
index 00000000..f8a64937
--- /dev/null
+++ b/validation/linear/cast-volatile.c
@@ -0,0 +1,14 @@
+static int foo(volatile int *a, int v)
+{
+ *a = v;
+ return *a;
+}
+
+/*
+ * check-name: cast-volatile
+ * check-command: test-linearize -fdump-ir=linearize $file
+ *
+ * check-known-to-fail
+ * check-output-ignore
+ * check-output-excludes: scast\\.
+ */
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\\.
+ */