new file mode 100644
@@ -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
+ */
new file mode 100644
@@ -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-contains: ret.*\\$1
+ */
new file mode 100644
@@ -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-contains: ret\\..*\\$1
+ */
Because of the lack of type information, compare instruction are not always handled correctly. So, add some testcases for this. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com> --- validation/optim/cmp-op-type.c | 18 ++++++++++++++++++ validation/optim/cmp-type0.c | 13 +++++++++++++ validation/optim/cmp-type1.c | 16 ++++++++++++++++ 3 files changed, 47 insertions(+) create mode 100644 validation/optim/cmp-op-type.c create mode 100644 validation/optim/cmp-type0.c create mode 100644 validation/optim/cmp-type1.c