This is still an alpha checker, but we use it in certain tests to make sure
something is not being executed.
This should fix the buildbots.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188682
91177308-0d34-0410-b5e6-
96231b3b80d8
I != E; ++I) {
const ProgramPoint &P = I->getLocation();
LC = P.getLocationContext();
+ if (!LC->inTopFrame())
+ continue;
if (!D)
D = LC->getAnalysisDeclContext()->getDecl();
+
// Save the CFG if we don't have it already
if (!C)
C = LC->getAnalysisDeclContext()->getUnoptimizedCFG();
error(); // expected-warning {{never executed}}
}
}
+
+void inlined(int condition) {
+ if (condition) {
+ foo(5); // no-warning
+ } else {
+ foo(6);
+ }
+}
+
+void testInlined() {
+ extern int coin();
+ int cond = coin();
+ if (!cond) {
+ inlined(0);
+ if (cond) {
+ foo(5); // expected-warning {{never executed}}
+ }
+ }
+}