aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/validation/linear
diff options
Diffstat (limited to 'validation/linear')
-rw-r--r--validation/linear/phi-order01.c17
-rw-r--r--validation/linear/phi-order02.c17
-rw-r--r--validation/linear/phi-order03.c9
-rw-r--r--validation/linear/phi-order04.c12
4 files changed, 55 insertions, 0 deletions
diff --git a/validation/linear/phi-order01.c b/validation/linear/phi-order01.c
new file mode 100644
index 00000000..18f2acbc
--- /dev/null
+++ b/validation/linear/phi-order01.c
@@ -0,0 +1,17 @@
+int fun(void);
+
+static int foo(int a)
+{
+ return a && fun();
+}
+
+static int bar(int a)
+{
+ return a || fun();
+}
+
+/*
+ * check-name: phi-order01
+ * check-command: sparse -vir -flinearize=last $file
+ * check-known-to-fail
+ */
diff --git a/validation/linear/phi-order02.c b/validation/linear/phi-order02.c
new file mode 100644
index 00000000..5dd4b38e
--- /dev/null
+++ b/validation/linear/phi-order02.c
@@ -0,0 +1,17 @@
+int fun(void);
+
+static int foo(int a) { return 0 || fun(); }
+static int bar(int a) { return 1 || fun(); }
+static int baz(int a) { return 0 && fun(); }
+static int qux(int a) { return 1 && fun(); }
+
+static int oof(int a) { return fun() || 1; }
+static int rab(int a) { return fun() || 0; }
+static int zab(int a) { return fun() && 1; }
+static int xuq(int a) { return fun() && 0; }
+
+/*
+ * check-name: phi-order02
+ * check-command: sparse -vir -flinearize=last $file
+ * check-known-to-fail
+ */
diff --git a/validation/linear/phi-order03.c b/validation/linear/phi-order03.c
new file mode 100644
index 00000000..316cfeeb
--- /dev/null
+++ b/validation/linear/phi-order03.c
@@ -0,0 +1,9 @@
+int fun(void);
+
+static int foo(void) { return ((0 || fun()) && fun()); }
+
+/*
+ * check-name: phi-order03
+ * check-command: sparse -vir -flinearize=last $file
+ * check-known-to-fail
+ */
diff --git a/validation/linear/phi-order04.c b/validation/linear/phi-order04.c
new file mode 100644
index 00000000..7548537a
--- /dev/null
+++ b/validation/linear/phi-order04.c
@@ -0,0 +1,12 @@
+static void foo(int *b)
+{
+ if (1) {
+ int c;
+ b = &c;
+ }
+}
+
+/*
+ * check-name: phi-order04
+ * check-command: sparse -vir -flinearize=last $file
+ */