diff --git a/clang/include/clang/Basic/JsonSupport.h b/clang/include/clang/Basic/JsonSupport.h --- a/clang/include/clang/Basic/JsonSupport.h +++ b/clang/include/clang/Basic/JsonSupport.h @@ -97,9 +97,13 @@ // The macro expansion and spelling pos is identical for file locs. if (AddBraces) Out << "{ "; + std::string filename(PLoc.getFilename()); +#ifdef _WIN32 // Handle windows-specific path delimiters. + std::replace(filename.begin(), filename.end(), '\\', '/'); +#endif Out << "\"line\": " << PLoc.getLine() << ", \"column\": " << PLoc.getColumn() - << ", \"file\": \"" << PLoc.getFilename() << "\""; + << ", \"file\": \"" << filename << "\""; if (AddBraces) Out << " }"; return; diff --git a/clang/test/Analysis/exploded-graph-rewriter/checker_messages.dot b/clang/test/Analysis/exploded-graph-rewriter/checker_messages.dot --- a/clang/test/Analysis/exploded-graph-rewriter/checker_messages.dot +++ b/clang/test/Analysis/exploded-graph-rewriter/checker_messages.dot @@ -1,8 +1,5 @@ // RUN: %exploded_graph_rewriter %s | FileCheck %s -// FIXME: Substitution doesn't seem to work on Windows. -// UNSUPPORTED: system-windows - // CHECK: Checker State: // CHECK-SAME: alpha.core.FooChecker: // CHECK-SAME: Foo stuff: diff --git a/clang/test/Analysis/exploded-graph-rewriter/checker_messages_diff.dot b/clang/test/Analysis/exploded-graph-rewriter/checker_messages_diff.dot --- a/clang/test/Analysis/exploded-graph-rewriter/checker_messages_diff.dot +++ b/clang/test/Analysis/exploded-graph-rewriter/checker_messages_diff.dot @@ -1,8 +1,5 @@ // RUN: %exploded_graph_rewriter -d %s | FileCheck %s -// FIXME: Substitution doesn't seem to work on Windows. -// UNSUPPORTED: system-windows - Node0x1 [shape=record,label= "{ { "state_id": 2, diff --git a/clang/test/Analysis/exploded-graph-rewriter/constraints.dot b/clang/test/Analysis/exploded-graph-rewriter/constraints.dot --- a/clang/test/Analysis/exploded-graph-rewriter/constraints.dot +++ b/clang/test/Analysis/exploded-graph-rewriter/constraints.dot @@ -1,8 +1,5 @@ // RUN: %exploded_graph_rewriter %s | FileCheck %s -// FIXME: Substitution doesn't seem to work on Windows. -// UNSUPPORTED: system-windows - // CHECK: Ranges: // CHECK-SAME: // CHECK-SAME: diff --git a/clang/test/Analysis/exploded-graph-rewriter/constraints_diff.dot b/clang/test/Analysis/exploded-graph-rewriter/constraints_diff.dot --- a/clang/test/Analysis/exploded-graph-rewriter/constraints_diff.dot +++ b/clang/test/Analysis/exploded-graph-rewriter/constraints_diff.dot @@ -1,8 +1,5 @@ // RUN: %exploded_graph_rewriter -d %s | FileCheck %s -// FIXME: Substitution doesn't seem to work on Windows. -// UNSUPPORTED: system-windows - Node0x1 [shape=record,label= "{ { diff --git a/clang/test/Analysis/exploded-graph-rewriter/dynamic_types.cpp b/clang/test/Analysis/exploded-graph-rewriter/dynamic_types.cpp --- a/clang/test/Analysis/exploded-graph-rewriter/dynamic_types.cpp +++ b/clang/test/Analysis/exploded-graph-rewriter/dynamic_types.cpp @@ -5,9 +5,6 @@ // RUN: %exploded_graph_rewriter %t.dot | FileCheck %s // REQUIRES: asserts -// FIXME: Substitution doesn't seem to work on Windows. -// UNSUPPORTED: system-windows - struct S {}; void test() { diff --git a/clang/test/Analysis/exploded-graph-rewriter/edge.dot b/clang/test/Analysis/exploded-graph-rewriter/edge.dot --- a/clang/test/Analysis/exploded-graph-rewriter/edge.dot +++ b/clang/test/Analysis/exploded-graph-rewriter/edge.dot @@ -1,9 +1,6 @@ // RUN: %exploded_graph_rewriter %s | FileCheck %s -check-prefix=LIGHT // RUN: %exploded_graph_rewriter --dark %s | FileCheck %s -check-prefixes=DARK -// FIXME: Substitution doesn't seem to work on Windows. -// UNSUPPORTED: system-windows - Node0x1 [shape=record,label= "{{ "state_id": 0, "program_state": null, "program_points": [ { diff --git a/clang/test/Analysis/exploded-graph-rewriter/empty.dot b/clang/test/Analysis/exploded-graph-rewriter/empty.dot --- a/clang/test/Analysis/exploded-graph-rewriter/empty.dot +++ b/clang/test/Analysis/exploded-graph-rewriter/empty.dot @@ -2,9 +2,6 @@ // RUN: %exploded_graph_rewriter --dark %s | FileCheck %s \ // RUN: -check-prefixes=CHECK,DARK -// FIXME: Substitution doesn't seem to work on Windows. -// UNSUPPORTED: system-windows - digraph "Exploded Graph" { label="Exploded Graph"; } diff --git a/clang/test/Analysis/exploded-graph-rewriter/environment.dot b/clang/test/Analysis/exploded-graph-rewriter/environment.dot --- a/clang/test/Analysis/exploded-graph-rewriter/environment.dot +++ b/clang/test/Analysis/exploded-graph-rewriter/environment.dot @@ -1,8 +1,5 @@ // RUN: %exploded_graph_rewriter %s | FileCheck %s -// FIXME: Substitution doesn't seem to work on Windows. -// UNSUPPORTED: system-windows - // CHECK: Expressions: // CHECK-SAME:
// CHECK-SAME: diff --git a/clang/test/Analysis/exploded-graph-rewriter/environment_diff.dot b/clang/test/Analysis/exploded-graph-rewriter/environment_diff.dot --- a/clang/test/Analysis/exploded-graph-rewriter/environment_diff.dot +++ b/clang/test/Analysis/exploded-graph-rewriter/environment_diff.dot @@ -1,8 +1,5 @@ // RUN: %exploded_graph_rewriter -d %s | FileCheck %s -// FIXME: Substitution doesn't seem to work on Windows. -// UNSUPPORTED: system-windows - // No diffs on the first node, nothing to check. Node0x1 [shape=record,label= "{ diff --git a/clang/test/Analysis/exploded-graph-rewriter/escapes.c b/clang/test/Analysis/exploded-graph-rewriter/escapes.c --- a/clang/test/Analysis/exploded-graph-rewriter/escapes.c +++ b/clang/test/Analysis/exploded-graph-rewriter/escapes.c @@ -5,9 +5,6 @@ // RUN: %exploded_graph_rewriter %t.dot | FileCheck %s // REQUIRES: asserts -// FIXME: Substitution doesn't seem to work on Windows. -// UNSUPPORTED: system-windows - void escapes() { // CHECK: // CHECK-SAME: diff --git a/clang/test/Analysis/exploded-graph-rewriter/initializers_under_construction.cpp b/clang/test/Analysis/exploded-graph-rewriter/initializers_under_construction.cpp --- a/clang/test/Analysis/exploded-graph-rewriter/initializers_under_construction.cpp +++ b/clang/test/Analysis/exploded-graph-rewriter/initializers_under_construction.cpp @@ -5,9 +5,6 @@ // RUN: %exploded_graph_rewriter %t.dot | FileCheck %s // REQUIRES: asserts -// FIXME: Substitution doesn't seem to work on Windows. -// UNSUPPORTED: system-windows - struct A { A() {} }; diff --git a/clang/test/Analysis/exploded-graph-rewriter/lit.local.cfg b/clang/test/Analysis/exploded-graph-rewriter/lit.local.cfg --- a/clang/test/Analysis/exploded-graph-rewriter/lit.local.cfg +++ b/clang/test/Analysis/exploded-graph-rewriter/lit.local.cfg @@ -9,10 +9,9 @@ config.substitutions.append(('%exploded_graph_rewriter', '\'%s\' %s --dump-dot-only' % ( - config.python_executable, - lit.util.which('exploded-graph-rewriter.py', - os.path.join( - config.clang_src_dir, - 'utils', 'analyzer'))))) + config.python_executable, + os.path.join( + config.clang_src_dir, + 'utils', 'analyzer', 'exploded-graph-rewriter.py')))) config.suffixes.add('.dot') diff --git a/clang/test/Analysis/exploded-graph-rewriter/macros.c b/clang/test/Analysis/exploded-graph-rewriter/macros.c --- a/clang/test/Analysis/exploded-graph-rewriter/macros.c +++ b/clang/test/Analysis/exploded-graph-rewriter/macros.c @@ -1,3 +1,11 @@ +#define NULL 0 +void *foo() { + return NULL; +} + +// The code above shall go first, because check tags below are sensetive to the line numbers on which the code is placed. +// You can change lines below in the way you need. + // 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 \ @@ -5,14 +13,7 @@ // RUN: %exploded_graph_rewriter %t.dot | FileCheck %s // REQUIRES: asserts -// FIXME: Substitution doesn't seem to work on Windows. -// UNSUPPORTED: system-windows - -// CHECK: macros.c:17:10 +// CHECK: macros.c:3:10 // CHECK-SAME: -// CHECK-SAME: (spelling at macros.c:15:14) +// CHECK-SAME: (spelling at macros.c:1:14) // CHECK-SAME: -#define NULL 0 -void *foo() { - return NULL; -} diff --git a/clang/test/Analysis/exploded-graph-rewriter/node_labels.dot b/clang/test/Analysis/exploded-graph-rewriter/node_labels.dot --- a/clang/test/Analysis/exploded-graph-rewriter/node_labels.dot +++ b/clang/test/Analysis/exploded-graph-rewriter/node_labels.dot @@ -7,9 +7,6 @@ // RUN: %exploded_graph_rewriter %s --gray --dark \ // RUN: | FileCheck %s -check-prefixes CHECK,DARK,GRAY -// FIXME: Substitution doesn't seem to work on Windows. -// UNSUPPORTED: system-windows - // LIGHT: Node0x1 [shape=record,label=< // DARK: Node0x1 [shape=record,color="white",fontcolor="gray80",label=< // CHECK-SAME: diff --git a/clang/test/Analysis/exploded-graph-rewriter/objects_under_construction.cpp b/clang/test/Analysis/exploded-graph-rewriter/objects_under_construction.cpp --- a/clang/test/Analysis/exploded-graph-rewriter/objects_under_construction.cpp +++ b/clang/test/Analysis/exploded-graph-rewriter/objects_under_construction.cpp @@ -6,9 +6,6 @@ // RUN: %exploded_graph_rewriter %t.dot | FileCheck %s // REQUIRES: asserts -// FIXME: Substitution doesn't seem to work on Windows. -// UNSUPPORTED: system-windows - struct S { S() {} }; diff --git a/clang/test/Analysis/exploded-graph-rewriter/program_points.dot b/clang/test/Analysis/exploded-graph-rewriter/program_points.dot --- a/clang/test/Analysis/exploded-graph-rewriter/program_points.dot +++ b/clang/test/Analysis/exploded-graph-rewriter/program_points.dot @@ -1,8 +1,5 @@ // RUN: %exploded_graph_rewriter %s | FileCheck %s -// FIXME: Substitution doesn't seem to work on Windows. -// UNSUPPORTED: system-windows - // CHECK: Program points: // CHECK-SAME:
Store: (0x{{[0-9a-f]*}})foo0
// CHECK-SAME: diff --git a/clang/test/Analysis/exploded-graph-rewriter/store.dot b/clang/test/Analysis/exploded-graph-rewriter/store.dot --- a/clang/test/Analysis/exploded-graph-rewriter/store.dot +++ b/clang/test/Analysis/exploded-graph-rewriter/store.dot @@ -1,8 +1,5 @@ // RUN: %exploded_graph_rewriter %s | FileCheck %s -// FIXME: Substitution doesn't seem to work on Windows. -// UNSUPPORTED: system-windows - // CHECK: Store: // CHECK-SAME: (0x2) // CHECK-SAME:
diff --git a/clang/test/Analysis/exploded-graph-rewriter/store_diff.dot b/clang/test/Analysis/exploded-graph-rewriter/store_diff.dot --- a/clang/test/Analysis/exploded-graph-rewriter/store_diff.dot +++ b/clang/test/Analysis/exploded-graph-rewriter/store_diff.dot @@ -1,8 +1,5 @@ // RUN: %exploded_graph_rewriter -d %s | FileCheck %s -// FIXME: Substitution doesn't seem to work on Windows. -// UNSUPPORTED: system-windows - Node0x1 [shape=record,label= "{ { "node_id": 1, diff --git a/clang/test/Analysis/exploded-graph-rewriter/topology.dot b/clang/test/Analysis/exploded-graph-rewriter/topology.dot --- a/clang/test/Analysis/exploded-graph-rewriter/topology.dot +++ b/clang/test/Analysis/exploded-graph-rewriter/topology.dot @@ -3,9 +3,6 @@ // RUN: %exploded_graph_rewriter -t %s \ // RUN: | FileCheck -check-prefixes=TOPOLOGY %s -// FIXME: Substitution doesn't seem to work on Windows. -// UNSUPPORTED: system-windows - // NORMAL: Program point // TOPOLOGY-NOT: Program point // NORMAL: Checker State diff --git a/clang/test/Analysis/exploded-graph-rewriter/trimmers.dot b/clang/test/Analysis/exploded-graph-rewriter/trimmers.dot --- a/clang/test/Analysis/exploded-graph-rewriter/trimmers.dot +++ b/clang/test/Analysis/exploded-graph-rewriter/trimmers.dot @@ -13,9 +13,6 @@ // RUN: %exploded_graph_rewriter --to 4 -s %s \ // RUN: | FileCheck %s -check-prefixes=ONE,TWO,NOTHREE,FOUR -// FIXME: Substitution doesn't seem to work on Windows. -// UNSUPPORTED: system-windows - Node0x1 [shape=record,label= "{{ "state_id": 0, "program_state": null, "program_points": [ { diff --git a/clang/test/Analysis/scan-build/exclude_directories.test b/clang/test/Analysis/scan-build/exclude_directories.test --- a/clang/test/Analysis/scan-build/exclude_directories.test +++ b/clang/test/Analysis/scan-build/exclude_directories.test @@ -1,9 +1,6 @@ // FIXME: Actually, "perl". REQUIRES: shell -// FIXME: Should ideally work on Windows. -UNSUPPORTED: system-windows - RUN: rm -rf %t.output_dir && mkdir %t.output_dir RUN: %scan-build -o %t.output_dir %clang -S \ RUN: %S/Inputs/multidirectory_project/directory1/file1.c \ diff --git a/clang/test/Analysis/scan-build/help.test b/clang/test/Analysis/scan-build/help.test --- a/clang/test/Analysis/scan-build/help.test +++ b/clang/test/Analysis/scan-build/help.test @@ -1,9 +1,6 @@ // FIXME: Actually, "perl". REQUIRES: shell -// FIXME: Should ideally work on Windows. -UNSUPPORTED: system-windows - RUN: %scan-build -h | FileCheck %s RUN: %scan-build --help | FileCheck %s diff --git a/clang/test/Analysis/scan-build/html_output.test b/clang/test/Analysis/scan-build/html_output.test --- a/clang/test/Analysis/scan-build/html_output.test +++ b/clang/test/Analysis/scan-build/html_output.test @@ -1,9 +1,6 @@ // FIXME: Actually, "perl". REQUIRES: shell -// FIXME: Should ideally work on Windows. -UNSUPPORTED: system-windows - RUN: rm -rf %t.output_dir && mkdir %t.output_dir RUN: %scan-build -o %t.output_dir %clang -S %S/Inputs/single_null_dereference.c \ RUN: | FileCheck %s -check-prefix CHECK-STDOUT diff --git a/clang/test/Analysis/scan-build/plist_html_output.test b/clang/test/Analysis/scan-build/plist_html_output.test --- a/clang/test/Analysis/scan-build/plist_html_output.test +++ b/clang/test/Analysis/scan-build/plist_html_output.test @@ -1,9 +1,6 @@ // FIXME: Actually, "perl". REQUIRES: shell -// FIXME: Should ideally work on Windows. -UNSUPPORTED: system-windows - RUN: rm -rf %t.output_dir && mkdir %t.output_dir RUN: %scan-build -plist-html -o %t.output_dir %clang -S %S/Inputs/single_null_dereference.c \ RUN: | FileCheck %s -check-prefix CHECK-STDOUT diff --git a/clang/test/Analysis/scan-build/plist_output.test b/clang/test/Analysis/scan-build/plist_output.test --- a/clang/test/Analysis/scan-build/plist_output.test +++ b/clang/test/Analysis/scan-build/plist_output.test @@ -1,9 +1,6 @@ // FIXME: Actually, "perl". REQUIRES: shell -// FIXME: Should ideally work on Windows. -UNSUPPORTED: system-windows - RUN: rm -rf %t.output_dir && mkdir %t.output_dir RUN: %scan-build -plist -o %t.output_dir %clang -S %S/Inputs/single_null_dereference.c \ RUN: | FileCheck %s -check-prefix CHECK-STDOUT