[llvm] dd1cf3a - [UTC] Precommit testcase for function definition line-splitting

Jannik Silvanus via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 29 07:40:23 PDT 2023


Author: Jannik Silvanus
Date: 2023-08-29T16:40:06+02:00
New Revision: dd1cf3a9aa070101a92194fc4a3c1210c66817ca

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

LOG: [UTC] Precommit testcase for function definition line-splitting

Review of the actual change: https://reviews.llvm.org/D158497

Added: 
    llvm/test/tools/UpdateTestChecks/update_test_checks/Inputs/named_function_arguments_split.ll
    llvm/test/tools/UpdateTestChecks/update_test_checks/Inputs/named_function_arguments_split.ll.expected
    llvm/test/tools/UpdateTestChecks/update_test_checks/named_function_arguments_split.test

Modified: 
    

Removed: 
    


################################################################################
diff  --git a/llvm/test/tools/UpdateTestChecks/update_test_checks/Inputs/named_function_arguments_split.ll b/llvm/test/tools/UpdateTestChecks/update_test_checks/Inputs/named_function_arguments_split.ll
new file mode 100644
index 00000000000000..00f6c3172a311e
--- /dev/null
+++ b/llvm/test/tools/UpdateTestChecks/update_test_checks/Inputs/named_function_arguments_split.ll
@@ -0,0 +1,11 @@
+; Check that we split named function arguments correctly into a separate CHECK line,
+; ensuring the opening parenthesis is on the label name, avoiding incorrect label
+; matches if function names are not prefix free.
+; Note: This is a precommitted test, the current result is incorrect.
+;
+; RUN: opt < %s -passes=instsimplify -S | FileCheck %s
+;
+define i32 @"foo"(i32 %named) {
+entry:
+  ret i32 %named
+}

diff  --git a/llvm/test/tools/UpdateTestChecks/update_test_checks/Inputs/named_function_arguments_split.ll.expected b/llvm/test/tools/UpdateTestChecks/update_test_checks/Inputs/named_function_arguments_split.ll.expected
new file mode 100644
index 00000000000000..188d311707b194
--- /dev/null
+++ b/llvm/test/tools/UpdateTestChecks/update_test_checks/Inputs/named_function_arguments_split.ll.expected
@@ -0,0 +1,17 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 2
+; Check that we split named function arguments correctly into a separate CHECK line,
+; ensuring the opening parenthesis is on the label name, avoiding incorrect label
+; matches if function names are not prefix free.
+; Note: This is a precommitted test, the current result is incorrect.
+;
+; RUN: opt < %s -passes=instsimplify -S | FileCheck %s
+;
+define i32 @"foo"(i32 %named) {
+; CHECK-LABEL: define i32 @foo
+; CHECK-SAME: (i32 [[NAMED:%.*]]) {
+; CHECK-NEXT:  entry:
+; CHECK-NEXT:    ret i32 [[NAMED]]
+;
+entry:
+  ret i32 %named
+}

diff  --git a/llvm/test/tools/UpdateTestChecks/update_test_checks/named_function_arguments_split.test b/llvm/test/tools/UpdateTestChecks/update_test_checks/named_function_arguments_split.test
new file mode 100644
index 00000000000000..fac7a34f3253de
--- /dev/null
+++ b/llvm/test/tools/UpdateTestChecks/update_test_checks/named_function_arguments_split.test
@@ -0,0 +1,7 @@
+# REQUIRES: x86-registered-target
+## Basic test checking that update_test_checks.py works correctly
+# RUN: cp -f %S/Inputs/named_function_arguments_split.ll %t.ll && %update_test_checks %t.ll --version=2
+# RUN: 
diff  -u %t.ll %S/Inputs/named_function_arguments_split.ll.expected
+## Check that running the script again does not change the result:
+# RUN: %update_test_checks %t.ll --version=2
+# RUN: 
diff  -u %t.ll %S/Inputs/named_function_arguments_split.ll.expected


        


More information about the llvm-commits mailing list