Skip to content

Commit dd1cf3a

Browse files
committed
[UTC] Precommit testcase for function definition line-splitting
Review of the actual change: https://reviews.llvm.org/D158497
1 parent 4737f91 commit dd1cf3a

File tree

3 files changed

+35
-0
lines changed

3 files changed

+35
-0
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
; Check that we split named function arguments correctly into a separate CHECK line,
2+
; ensuring the opening parenthesis is on the label name, avoiding incorrect label
3+
; matches if function names are not prefix free.
4+
; Note: This is a precommitted test, the current result is incorrect.
5+
;
6+
; RUN: opt < %s -passes=instsimplify -S | FileCheck %s
7+
;
8+
define i32 @"foo"(i32 %named) {
9+
entry:
10+
ret i32 %named
11+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 2
2+
; Check that we split named function arguments correctly into a separate CHECK line,
3+
; ensuring the opening parenthesis is on the label name, avoiding incorrect label
4+
; matches if function names are not prefix free.
5+
; Note: This is a precommitted test, the current result is incorrect.
6+
;
7+
; RUN: opt < %s -passes=instsimplify -S | FileCheck %s
8+
;
9+
define i32 @"foo"(i32 %named) {
10+
; CHECK-LABEL: define i32 @foo
11+
; CHECK-SAME: (i32 [[NAMED:%.*]]) {
12+
; CHECK-NEXT: entry:
13+
; CHECK-NEXT: ret i32 [[NAMED]]
14+
;
15+
entry:
16+
ret i32 %named
17+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# REQUIRES: x86-registered-target
2+
## Basic test checking that update_test_checks.py works correctly
3+
# RUN: cp -f %S/Inputs/named_function_arguments_split.ll %t.ll && %update_test_checks %t.ll --version=2
4+
# RUN: diff -u %t.ll %S/Inputs/named_function_arguments_split.ll.expected
5+
## Check that running the script again does not change the result:
6+
# RUN: %update_test_checks %t.ll --version=2
7+
# RUN: diff -u %t.ll %S/Inputs/named_function_arguments_split.ll.expected

0 commit comments

Comments
 (0)