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