aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
-rw-r--r--validation/optim/cmp-op-type.c18
-rw-r--r--validation/optim/cmp-type0.c13
-rw-r--r--validation/optim/cmp-type1.c16
3 files changed, 47 insertions, 0 deletions
diff --git a/validation/optim/cmp-op-type.c b/validation/optim/cmp-op-type.c
new file mode 100644
index 00000000..037272f8
--- /dev/null
+++ b/validation/optim/cmp-op-type.c
@@ -0,0 +1,18 @@
+extern int get(void);
+
+static int array[8192];
+
+static int foo(void)
+{
+ int n = -1;
+ if (n < 0)
+ n = get();
+ return array[n];
+}
+
+/*
+ * check-name: cmp-op-type
+ * check-command: test-linearize -Wno-decl $file
+ *
+ * check-output-ignore
+ */
diff --git a/validation/optim/cmp-type0.c b/validation/optim/cmp-type0.c
new file mode 100644
index 00000000..ab9d53d4
--- /dev/null
+++ b/validation/optim/cmp-type0.c
@@ -0,0 +1,13 @@
+static int foo(long long a)
+{
+ return 0LL < (0x80000000LL + (a - a));
+}
+
+/*
+ * check-name: cmp-type0
+ * check-command: test-linearize $file
+ * check-known-to-fail
+ *
+ * check-output-ignore
+ * check-output-returns: 1
+ */
diff --git a/validation/optim/cmp-type1.c b/validation/optim/cmp-type1.c
new file mode 100644
index 00000000..ee0bd75a
--- /dev/null
+++ b/validation/optim/cmp-type1.c
@@ -0,0 +1,16 @@
+int foo(void)
+{
+ int r;
+ long n;
+ n = 0;
+ return n < 2147483648U;
+}
+
+/*
+ * check-name: cmp-type1
+ * check-command: test-linearize -Wno-decl $file
+ * check-known-to-fail
+ *
+ * check-output-ignore
+ * check-output-returns: 1
+ */