diff options
| author | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2020-11-01 07:09:11 +0100 |
|---|---|---|
| committer | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2020-11-01 07:09:11 +0100 |
| commit | f680124b794b246c8a20f2cb54b2fc7ff989625d (patch) | |
| tree | f480814f46fbfc9f462a1221a120ec8e406f41cb /validation | |
| parent | 0c7b00977c8826b1cd172f7e90ad14e980190467 (diff) | |
| parent | 226b62bc2ee4779447ce788d83aa0b409e384ec8 (diff) | |
| download | sparse-dev-f680124b794b246c8a20f2cb54b2fc7ff989625d.tar.gz | |
Merge branch 'typed-cmp'
* give an explicit type to compare's operands
Diffstat (limited to 'validation')
| -rw-r--r-- | validation/optim/cmp-op-type.c | 18 | ||||
| -rw-r--r-- | validation/optim/cmp-type0.c | 12 | ||||
| -rw-r--r-- | validation/optim/cmp-type1.c | 15 |
3 files changed, 45 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..15115b9f --- /dev/null +++ b/validation/optim/cmp-type0.c @@ -0,0 +1,12 @@ +static int foo(long long a) +{ + return 0LL < (0x80000000LL + (a - a)); +} + +/* + * check-name: cmp-type0 + * check-command: test-linearize $file + * + * 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..6df6376b --- /dev/null +++ b/validation/optim/cmp-type1.c @@ -0,0 +1,15 @@ +int foo(void) +{ + int r; + long n; + n = 0; + return n < 2147483648U; +} + +/* + * check-name: cmp-type1 + * check-command: test-linearize -Wno-decl $file + * + * check-output-ignore + * check-output-returns: 1 + */ |
