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;
10 __analyzer_eval (a
> b
); /* { dg-warning "TRUE" } */
13 void test2 (size_t size
, size_t offset
)
15 size_t a
= size
+ offset
;
17 __analyzer_eval (a
> b
); /* { dg-warning "TRUE" } */
20 void test3 (size_t size
, size_t offset
)
22 size_t a
= size
* offset
;
24 __analyzer_eval (a
> b
); /* { dg-warning "TRUE" } */
27 void test4 (size_t size
)
32 __analyzer_eval (a
> b
); /* { dg-warning "UNKNOWN" } */
35 void test5 (size_t 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
;
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
)
61 __analyzer_eval (a
> b
); /* { dg-warning "UNKNOWN" } */
64 void test9 (size_t size
)
68 __analyzer_eval (a
> b
); /* { dg-warning "UNKNOWN" } */
71 void test10 (size_t size
)
75 __analyzer_eval (a
> b
); /* { dg-warning "TRUE" } */