diff --git a/llvm/test/tools/UpdateTestChecks/update_mir_test_checks/Inputs/x86-simplify-mir.ll b/llvm/test/tools/UpdateTestChecks/update_mir_test_checks/Inputs/x86-simplify-mir.ll new file mode 100644 --- /dev/null +++ b/llvm/test/tools/UpdateTestChecks/update_mir_test_checks/Inputs/x86-simplify-mir.ll @@ -0,0 +1,5 @@ +; RUN: llc < %s -mtriple=x86_64 -stop-after=finalize-isel -simplify-mir | FileCheck %s + +define void @f() { + ret void +} diff --git a/llvm/test/tools/UpdateTestChecks/update_mir_test_checks/Inputs/x86-simplify-mir.ll.expected b/llvm/test/tools/UpdateTestChecks/update_mir_test_checks/Inputs/x86-simplify-mir.ll.expected new file mode 100644 --- /dev/null +++ b/llvm/test/tools/UpdateTestChecks/update_mir_test_checks/Inputs/x86-simplify-mir.ll.expected @@ -0,0 +1,9 @@ +; NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py +; RUN: llc < %s -mtriple=x86_64 -stop-after=finalize-isel -simplify-mir | FileCheck %s + +define void @f() { + ; CHECK-LABEL: name: f + ; CHECK: bb.0 (%ir-block.0): + ; CHECK-NEXT: RET 0 + ret void +} diff --git a/llvm/test/tools/UpdateTestChecks/update_mir_test_checks/x86-simplify-mir.test b/llvm/test/tools/UpdateTestChecks/update_mir_test_checks/x86-simplify-mir.test new file mode 100644 --- /dev/null +++ b/llvm/test/tools/UpdateTestChecks/update_mir_test_checks/x86-simplify-mir.test @@ -0,0 +1,5 @@ +# REQUIRES: x86-registered-target +## Check that update_mir_test_checks handles -simplify-mir + +# RUN: cp -f %S/Inputs/x86-simplify-mir.ll %t.ll && %update_mir_test_checks %t.ll +# RUN: diff -u %S/Inputs/x86-simplify-mir.ll.expected %t.ll diff --git a/llvm/utils/update_mir_test_checks.py b/llvm/utils/update_mir_test_checks.py --- a/llvm/utils/update_mir_test_checks.py +++ b/llvm/utils/update_mir_test_checks.py @@ -57,10 +57,10 @@ r"\n" r"^ *name: *(?P[A-Za-z0-9_.-]+)$" r".*?" - r"^ *fixedStack: *(\[\])? *\n" + r"(?:^ *fixedStack: *(\[\])? *\n" r"(?P.*?)\n?" r"^ *stack:" - r".*?" + r".*?)?" r"^ *body: *\|\n" r"(?P.*?)\n" r"^\.\.\.$",