1 /* { dg-additional-options "-fanalyzer-call-summaries --param analyzer-min-snodes-for-call-summary=0 -fno-analyzer-state-merge" } */
3 /* There need to be at least two calls to a function for the
4 call-summarization code to be used.
5 TODO: add some kind of test that summarization *was* used. */
7 #include "analyzer-decls.h"
9 /* With state merging disabled, we get two summaries here. */
11 int two_outcomes (int flag
, int x
, int y
)
19 void test_two_outcomes (int outer_flag
, int a
, int b
)
22 __analyzer_eval (two_outcomes (1, a
, b
) == a
); /* { dg-warning "TRUE" } */
23 __analyzer_eval (two_outcomes (0, a
, b
) == b
); /* { dg-warning "TRUE" } */
24 r
= two_outcomes (outer_flag
, a
, b
);
26 __analyzer_eval (r
== a
); /* { dg-warning "TRUE" } */
28 __analyzer_eval (r
== b
); /* { dg-warning "TRUE" } */