[llvm] 09d2076 - [llvm] Fix update_analyze_test_checks and add a test to prevent further breakage

Roman Lebedev via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 10 01:33:43 PST 2022


Author: Roman Lebedev
Date: 2022-02-10T12:33:33+03:00
New Revision: 09d20761eb74a2f0b82db6112c342f40ba157446

URL: https://github.com/llvm/llvm-project/commit/09d20761eb74a2f0b82db6112c342f40ba157446
DIFF: https://github.com/llvm/llvm-project/commit/09d20761eb74a2f0b82db6112c342f40ba157446.diff

LOG: [llvm] Fix update_analyze_test_checks and add a test to prevent further breakage

Added: 
    llvm/test/tools/UpdateTestChecks/update_analyze_test_checks/Inputs/basic.ll
    llvm/test/tools/UpdateTestChecks/update_analyze_test_checks/Inputs/basic.ll.expected
    llvm/test/tools/UpdateTestChecks/update_analyze_test_checks/basic.test
    llvm/test/tools/UpdateTestChecks/update_analyze_test_checks/lit.local.cfg

Modified: 
    llvm/utils/update_analyze_test_checks.py

Removed: 
    


################################################################################
diff  --git a/llvm/test/tools/UpdateTestChecks/update_analyze_test_checks/Inputs/basic.ll b/llvm/test/tools/UpdateTestChecks/update_analyze_test_checks/Inputs/basic.ll
new file mode 100644
index 0000000000000..734b0e77466b6
--- /dev/null
+++ b/llvm/test/tools/UpdateTestChecks/update_analyze_test_checks/Inputs/basic.ll
@@ -0,0 +1,6 @@
+; RUN: opt -passes='print<scalar-evolution>' < %s -disable-output 2>&1 | FileCheck %s
+
+define i32 @basic(i32 %x, i32 %y) {
+  %r = add i32 %x, %y
+  ret i32 %r
+}

diff  --git a/llvm/test/tools/UpdateTestChecks/update_analyze_test_checks/Inputs/basic.ll.expected b/llvm/test/tools/UpdateTestChecks/update_analyze_test_checks/Inputs/basic.ll.expected
new file mode 100644
index 0000000000000..b018707385e81
--- /dev/null
+++ b/llvm/test/tools/UpdateTestChecks/update_analyze_test_checks/Inputs/basic.ll.expected
@@ -0,0 +1,13 @@
+; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py
+; RUN: opt -passes='print<scalar-evolution>' < %s -disable-output 2>&1 | FileCheck %s
+
+define i32 @basic(i32 %x, i32 %y) {
+; CHECK-LABEL: 'basic'
+; CHECK-NEXT:  Classifying expressions for: @basic
+; CHECK-NEXT:    %r = add i32 %x, %y
+; CHECK-NEXT:    --> (%x + %y) U: full-set S: full-set
+; CHECK-NEXT:  Determining loop execution counts for: @basic
+;
+  %r = add i32 %x, %y
+  ret i32 %r
+}

diff  --git a/llvm/test/tools/UpdateTestChecks/update_analyze_test_checks/basic.test b/llvm/test/tools/UpdateTestChecks/update_analyze_test_checks/basic.test
new file mode 100644
index 0000000000000..78f9646871efb
--- /dev/null
+++ b/llvm/test/tools/UpdateTestChecks/update_analyze_test_checks/basic.test
@@ -0,0 +1,6 @@
+## Basic test checking that update_analyze_test_checks.py works correctly
+# RUN: cp -f %S/Inputs/basic.ll %t.ll && %update_analyze_test_checks %t.ll
+# RUN: 
diff  -u %t.ll %S/Inputs/basic.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/basic.ll.expected

diff  --git a/llvm/test/tools/UpdateTestChecks/update_analyze_test_checks/lit.local.cfg b/llvm/test/tools/UpdateTestChecks/update_analyze_test_checks/lit.local.cfg
new file mode 100644
index 0000000000000..50d9aa9c17180
--- /dev/null
+++ b/llvm/test/tools/UpdateTestChecks/update_analyze_test_checks/lit.local.cfg
@@ -0,0 +1,3 @@
+# These tests require opt.
+if 'opt-binary' not in config.available_features:
+    config.unsupported = True

diff  --git a/llvm/utils/update_analyze_test_checks.py b/llvm/utils/update_analyze_test_checks.py
index ca45cd1eeaf00..730346726a7d2 100755
--- a/llvm/utils/update_analyze_test_checks.py
+++ b/llvm/utils/update_analyze_test_checks.py
@@ -112,6 +112,7 @@ def main():
       run_list = prefix_list,
       flags = type('', (object,), {
             'verbose': args.verbose,
+            'filters': args.filters,
             'function_signature': False,
             'check_attributes': False,
             'replace_value_regex': []}),


        


More information about the llvm-commits mailing list