diff options
Diffstat (limited to 'clang/test/Analysis/initializers-cfg-output.cpp')
-rw-r--r-- | clang/test/Analysis/initializers-cfg-output.cpp | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/clang/test/Analysis/initializers-cfg-output.cpp b/clang/test/Analysis/initializers-cfg-output.cpp index ccf4db519d7..aaa1a5a6d56 100644 --- a/clang/test/Analysis/initializers-cfg-output.cpp +++ b/clang/test/Analysis/initializers-cfg-output.cpp @@ -1,4 +1,14 @@ -// RUN: %clang_analyze_cc1 -std=c++11 -analyzer-checker=debug.DumpCFG %s 2>&1 | FileCheck %s +// RUN: %clang_analyze_cc1 -std=c++11 -analyzer-checker=debug.DumpCFG -analyzer-config cfg-rich-constructors=false %s 2>&1 | FileCheck -check-prefixes=CHECK,WARNINGS %s +// RUN: %clang_analyze_cc1 -std=c++11 -analyzer-checker=debug.DumpCFG -analyzer-config cfg-rich-constructors=true %s 2>&1 | FileCheck -check-prefixes=CHECK,ANALYZER %s + +// This file tests how we construct two different flavors of the Clang CFG - +// the CFG used by the Sema analysis-based warnings and the CFG used by the +// static analyzer. The difference in the behavior is checked via FileCheck +// prefixes (WARNINGS and ANALYZER respectively). When introducing new analyzer +// flags, no new run lines should be added - just these flags would go to the +// respective line depending on where is it turned on and where is it turned +// off. Feel free to add tests that test only one of the CFG flavors if you're +// not sure how the other flavor is supposed to work in your case. class A { public: @@ -66,7 +76,8 @@ class TestDelegating { // CHECK: 11: this // CHECK: 12: [B1.11]->i // CHECK: 13: r([B1.12]) (Member initializer) -// CHECK: 14: (CXXConstructExpr, class A) +// WARNINGS: 14: (CXXConstructExpr, class A) +// ANALYZER: 14: (CXXConstructExpr, [B1.15], class A) // CHECK: 15: A a; // CHECK: Preds (1): B2 // CHECK: Succs (1): B0 |