Lines Matching +full:check +full:- +full:clang +full:- +full:python
1 #!/usr/bin/env python
3 # ===- check-analyzer-fixit.py - Static Analyzer test helper ---*- python -*-===#
7 # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
9 # ===------------------------------------------------------------------------===#
11 # This file copy-pasted mostly from the Clang-Tidy's 'check_clang_tidy.py'.
13 # ===------------------------------------------------------------------------===#
16 Clang Static Analyzer test helper
19 This script runs the Analyzer in fix-it mode and verify fixes, warnings, notes.
22 check-analyzer-fixit.py <source-file> <temp-file> [analyzer arguments]
25 // RUN: %check-analyzer-fixit %s %t -analyzer-checker=core
54 # Remove the contents of the CHECK lines to avoid CHECKs matching on
56 # avoiding empty lines which could potentially trigger formatting-related
58 cleaned_test = re.sub("// *CHECK-[A-Z0-9\-]*:[^\r\n]*", "//", input_text)
66 ["clang", "-print-file-name=include"], stderr=subprocess.STDOUT
69 print("Cannot print Clang include directory: " + e.output.decode())
75 "clang",
76 "-cc1",
77 "-internal-isystem",
79 "-nostdsysteminc",
80 "-analyze",
81 "-analyzer-constraints=range",
82 "-analyzer-config",
83 "apply-fixits=true",
86 + ["-verify", temp_file_name]
96 print("Clang Static Analyzer test failed:\n" + e.output.decode())
100 "----------------- Clang Static Analyzer output -----------------\n"
102 + "\n--------------------------------------------------------------"
107 ["diff", "-u", original_file_name, temp_file_name], stderr=subprocess.STDOUT
113 "----------------------------- Fixes ----------------------------\n"
115 + "\n--------------------------------------------------------------"
122 "-input-file=" + temp_file_name,
124 "-check-prefixes=CHECK-FIXES",
125 "-strict-whitespace",