1 /* Verify that we handle unknown values passed to __attribute__ ((const))
2 (by imposing a complexity limit). */
3
4 /* { dg-additional-options "--param analyzer-max-svalue-depth=4" } */
5
6 #include "analyzer-decls.h"
7
8 extern int const_fn_1 (int) __attribute__ ((const));
9
10 void test_const_fn_1 (int x, int y)
11 {
12 int x_1 = const_fn_1 (x);
13 int x_2 = const_fn_1 (x);
14 int y_1 = const_fn_1 (y);
15 int y_2 = const_fn_1 (y);
16 __analyzer_eval (x_1 == x_2); /* { dg-warning "UNKNOWN" } */
17 __analyzer_eval (y_1 == y_2); /* { dg-warning "UNKNOWN" } */
18 __analyzer_eval (x_1 == y_1); /* { dg-warning "UNKNOWN" } */
19 }
20
21 void test_2 (int x)
22 {
23 int once = const_fn_1 (x);
24 int again = const_fn_1 (once);
25 __analyzer_eval (once == again); /* { dg-warning "UNKNOWN" } */
26 }