Skip to content

Commit 01b0ca9

Browse files
committed
Gate the change with a new UTC version
1 parent a9da88c commit 01b0ca9

File tree

5 files changed

+7
-4
lines changed

5 files changed

+7
-4
lines changed

llvm/test/tools/UpdateTestChecks/update_test_checks/Inputs/switch_case.ll

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
21
; RUN: opt < %s -S | FileCheck %s
32

43
; Test whether the UTC format the switch-cases correctly, which requires TWO extra spaces.

llvm/test/tools/UpdateTestChecks/update_test_checks/Inputs/switch_case.ll.expected

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
1+
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 7
22
; RUN: opt < %s -S | FileCheck %s
33

44
; Test whether the UTC format the switch-cases correctly, which requires TWO extra spaces.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
## switch_case test checking that update_test_checks.py works correctly
2-
# RUN: cp -f %S/Inputs/switch_case.ll %t.ll && %update_test_checks %t.ll
2+
# RUN: cp -f %S/Inputs/switch_case.ll %t.ll && %update_test_checks %t.ll --version 7
33
# RUN: diff -u %t.ll %S/Inputs/switch_case.ll.expected

llvm/utils/UpdateTestChecks/common.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
'none' and 'all'. 'smart' is the default.
3030
5: Basic block labels are matched by FileCheck expressions
3131
6: The semantics of TBAA checks has been incorporated in the check lines.
32+
7: Indent switch-cases correctly.
3233
"""
3334
DEFAULT_VERSION = 6
3435

llvm/utils/update_test_checks.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,10 @@ def update_test(ti: common.TestInfo):
265265
" " * 4
266266
if (
267267
common.IS_DEBUG_RECORD_RE.match(input_line)
268-
or common.IS_SWITCH_CASE_RE.match(input_line)
268+
or (
269+
ti.args.version > 6
270+
and common.IS_SWITCH_CASE_RE.match(input_line)
271+
)
269272
)
270273
else " " * 2
271274
)

0 commit comments

Comments
 (0)