[PATCH] D105637: [clang][Analyzer] Add symbol uninterestingness to bug report.

Artem Dergachev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jul 9 10:41:17 PDT 2021


NoQ added a comment.

In D105637#2864684 <https://reviews.llvm.org/D105637#2864684>, @balazske wrote:

> Could not make a simple test for the change. This file F17831281: BugReportInterestingnessTest.cpp <https://reviews.llvm.org/F17831281> is what I could do, but it prints the needed text to the console. Is it possible to get the note texts in the program?

You could define your own diagnostic consumer in the unittest and intercept all the notes. But at this point i'd rather turn this into a LIT test by turning your checker mock into a `debug.ExprInspection` item and using `-analyzer-output=text` to test notes:

  void foo(x) {
    clang_analyzer_noteIfInteresting(x); // no-note
    clang_analyzer_markNotInteresting(x);
    clang_analyzer_noteIfInteresting(x); // expected-note{{INTERESTING}}
    clang_analyzer_markInteresting(x);
    clang_analyzer_warnIfReached(); // expected-warning{{TRUE}}
  }                                 // expected-note at -1{{TRUE}}


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D105637/new/

https://reviews.llvm.org/D105637



More information about the cfe-commits mailing list