Skip several analyzer socket tests on hppa*-*-hpux*
[official-gcc.git] / gcc / testsuite / c-c++-common / analyzer / call-summaries-3.c
blobd63eb0cf9a3f805f99eb00edab9d853b4027d9b4
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)
13 if (flag)
14 return x;
15 else
16 return y;
19 void test_two_outcomes (int outer_flag, int a, int b)
21 int r;
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);
25 if (outer_flag)
26 __analyzer_eval (r == a); /* { dg-warning "TRUE" } */
27 else
28 __analyzer_eval (r == b); /* { dg-warning "TRUE" } */