update_analyze_test_checks.py is an invaluable tool in updating tests. Unfortunately, it only supports output from the CostModel, ScalarEvolution, and LoopVectorize analyses. Many LoopAccessAnalysis tests use hand-crafted CHECK lines, and it is moreover tedious to generate these CHECK lines, as the output fom the analysis is not stable, and requires the test-writer to hand-craft FileCheck matches. Alleviate this pain, and support output from: $ opt -passes='print<loop-accesses>' This patch includes several non-trivial changes including: - Preserving whitespace at the beginning of the line, so that the LAA output can be properly indented. - Regexes matching the unstable output, which is basically a pointer address hex. - Separating is_analyze from preserve_names clearly, as the former was formerly used as an overload for the latter. To demonstate the utility of this patch, several tests in LoopAccessAnalysis have been auto-generated by update_analyze_test_checks.py.
7 lines
400 B
Plaintext
7 lines
400 B
Plaintext
## Basic test checking that update_analyze_test_checks.py works correctly
|
|
# RUN: cp -f %S/Inputs/loop-access-analysis.ll %t.ll && %update_analyze_test_checks %t.ll
|
|
# RUN: diff -u %t.ll %S/Inputs/loop-access-analysis.ll.expected
|
|
## Check that running the script again does not change the result:
|
|
# RUN: %update_analyze_test_checks %t.ll
|
|
# RUN: diff -u %t.ll %S/Inputs/loop-access-analysis.ll.expected
|