Files
clang-p2996/clang/test/Analysis/exploded-graph-rewriter/win_path_forbidden_chars.cpp
Denys Petrov be9c581835 [analyzer] Remove forbidden characters from a filename for a graph dump on Windows
Summary:
Windows forbidden file path characters are used in a field `file`, while creating a dump `dot` file using an argument -analyzer-dump-egraph. It specifically relates to angle brackets when using `<scratch space>`, `<built-in>`, `<command line>` values in filenames. It causes that script exploded-graph-rewriter.py incorrectly parses the dump.

Fix:
Remove forbidden characters from filename for Windows platform, when creating graph dump file.

Differential Revision: https://reviews.llvm.org/D82103
2020-06-22 17:27:20 +03:00

21 lines
798 B
C++

// FIXME: Figure out how to use %clang_analyze_cc1 with our lit.local.cfg.
// RUN: %clang_cc1 -analyze -triple x86_64-unknown-linux-gnu \
// RUN: -analyzer-checker=core \
// RUN: -analyzer-dump-egraph=%t.dot %s
// RUN: %exploded_graph_rewriter --verbose %t.dot 2>&1 | FileCheck %s
// REQUIRES: asserts
// UNSUPPORTED: !windows
// Angle brackets shall not be presented in the field `file`,
// because exploded_graph_rewriter handles it as a file path
// and such symbols are forbidden on Windows platform.
void test() {
// This produces angle brackets.
char text[] = __FILE__;
}
// This test is passed if exploded_graph_rewriter handles dot file without errors.
// CHECK: DEBUG:root:Line: digraph "Exploded Graph"
// CHECK: \"file\": \"scratch space\"