Avoid expicit builtion list in tree-ssa-dce
[official-gcc.git] / gcc / testsuite / c-c++-common / analyzer / symbolic-gt-1.c
blob140abce6961a4bd5f976ca415c23776cd7b8f852
1 #include <string.h>
2 #include "analyzer-decls.h"
4 /* Test GT_EXPR comparison of symbolic values. */
6 void test1 (size_t size)
8 size_t a = 4 * size + 1;
9 size_t b = 4 * size;
10 __analyzer_eval (a > b); /* { dg-warning "TRUE" } */
13 void test2 (size_t size, size_t offset)
15 size_t a = size + offset;
16 size_t b = size;
17 __analyzer_eval (a > b); /* { dg-warning "TRUE" } */
20 void test3 (size_t size, size_t offset)
22 size_t a = size * offset;
23 size_t b = size;
24 __analyzer_eval (a > b); /* { dg-warning "TRUE" } */
27 void test4 (size_t size)
29 size_t op = -1;
30 size_t a = size + op;
31 size_t b = size;
32 __analyzer_eval (a > b); /* { dg-warning "UNKNOWN" } */
35 void test5 (size_t size)
37 size_t a = size - 1;
38 size_t b = size;
39 __analyzer_eval (a > b); /* { dg-warning "UNKNOWN" } */
42 void test6 (size_t size, int offset)
44 /* OFFSET is a symbolic integer, thus could be negative. */
45 size_t a = size + offset;
46 size_t b = size;
47 __analyzer_eval (a > b); /* { dg-warning "UNKNOWN" } */
50 void test7 (size_t size, size_t mul)
52 size_t a = mul * size + 1;
53 size_t b = mul * size;
54 __analyzer_eval (a > b); /* { dg-warning "TRUE" } */
57 void test8 (size_t size)
59 size_t a = size - 5;
60 size_t b = size - 1;
61 __analyzer_eval (a > b); /* { dg-warning "UNKNOWN" } */
64 void test9 (size_t size)
66 size_t a = size + 1;
67 size_t b = size + 2;
68 __analyzer_eval (a > b); /* { dg-warning "UNKNOWN" } */
71 void test10 (size_t size)
73 size_t a = size + 2;
74 size_t b = size + 1;
75 __analyzer_eval (a > b); /* { dg-warning "TRUE" } */