xref: /minix3/external/bsd/llvm/dist/clang/test/Analysis/no-exit-cfg.c (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc // RUN: %clang_cc1 -analyze -analyzer-checker=core,alpha.core -analyzer-store=region -verify %s
2*f4a2713aSLionel Sambuc // expected-no-diagnostics
3*f4a2713aSLionel Sambuc 
4*f4a2713aSLionel Sambuc // This is a test case for the issue reported in PR 2819:
5*f4a2713aSLionel Sambuc //  http://llvm.org/bugs/show_bug.cgi?id=2819
6*f4a2713aSLionel Sambuc // The flow-sensitive dataflow solver should work even when no block in
7*f4a2713aSLionel Sambuc // the CFG reaches the exit block.
8*f4a2713aSLionel Sambuc 
9*f4a2713aSLionel Sambuc int g(int x);
10*f4a2713aSLionel Sambuc void h(int x);
11*f4a2713aSLionel Sambuc 
f(int x)12*f4a2713aSLionel Sambuc int f(int x)
13*f4a2713aSLionel Sambuc {
14*f4a2713aSLionel Sambuc out_err:
15*f4a2713aSLionel Sambuc   if (g(x)) {
16*f4a2713aSLionel Sambuc     h(x);
17*f4a2713aSLionel Sambuc   }
18*f4a2713aSLionel Sambuc   goto out_err;
19*f4a2713aSLionel Sambuc }
20