diff --git a/llvm/test/tools/UpdateTestChecks/update_test_checks/Inputs/stable_ir_values2.ll b/llvm/test/tools/UpdateTestChecks/update_test_checks/Inputs/stable_ir_values2.ll index d05c26241f87c1..c6ccaa4f450762 100644 --- a/llvm/test/tools/UpdateTestChecks/update_test_checks/Inputs/stable_ir_values2.ll +++ b/llvm/test/tools/UpdateTestChecks/update_test_checks/Inputs/stable_ir_values2.ll @@ -1,10 +1,9 @@ -; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 3 +; NOTE: Assertions have been autogenerated by utils/update_test_checks.py ; RUN: opt < %s -S | FileCheck %s define i32 @func(i32 %x) { -; CHECK-LABEL: define i32 @func( -; CHECK-SAME: i32 [[X:%.*]]) { -; CHECK-NEXT: [[TMP1:%.*]] = icmp eq i32 [[X]], 0 +; CHECK-LABEL: @func( +; CHECK-NEXT: [[TMP1:%.*]] = icmp eq i32 [[X:.*]], 0 ; CHECK-NEXT: [[TMP2:%.*]] = call i32 @foo(i1 [[TMP1]]) ; CHECK-NEXT: [[TMP3:%.*]] = icmp eq i32 [[X]], 1 ; CHECK-NEXT: [[TMP4:%.*]] = call i32 @foo(i1 [[TMP3]]) diff --git a/llvm/test/tools/UpdateTestChecks/update_test_checks/Inputs/stable_ir_values2.ll.expected b/llvm/test/tools/UpdateTestChecks/update_test_checks/Inputs/stable_ir_values2.ll.expected index 6311a55a1f9de1..d5d2eb71ac5656 100644 --- a/llvm/test/tools/UpdateTestChecks/update_test_checks/Inputs/stable_ir_values2.ll.expected +++ b/llvm/test/tools/UpdateTestChecks/update_test_checks/Inputs/stable_ir_values2.ll.expected @@ -1,10 +1,9 @@ -; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 3 +; NOTE: Assertions have been autogenerated by utils/update_test_checks.py ; RUN: opt < %s -S | FileCheck %s define i32 @func(i32 %x) { -; CHECK-LABEL: define i32 @func( -; CHECK-SAME: i32 [[X:%.*]]) { -; CHECK-NEXT: [[TMP1:%.*]] = icmp eq i32 [[X]], 0 +; CHECK-LABEL: @func( +; CHECK-NEXT: [[TMP1:%.*]] = icmp eq i32 [[X:%.*]], 0 ; CHECK-NEXT: [[TMP6:%.*]] = call i32 @foo(i1 [[TMP1]]) ; CHECK-NEXT: [[TMP7:%.*]] = icmp eq i32 [[X]], 2 ; CHECK-NEXT: [[TMP8:%.*]] = call i32 @foo(i1 [[TMP7]]) diff --git a/llvm/utils/UpdateTestChecks/common.py b/llvm/utils/UpdateTestChecks/common.py index 759fc5d7a43aa2..8ed600e5629e96 100644 --- a/llvm/utils/UpdateTestChecks/common.py +++ b/llvm/utils/UpdateTestChecks/common.py @@ -454,7 +454,7 @@ def collect_original_check_lines(ti: TestInfo, prefix_set: set): continue if check_kind == "LABEL": - m = IR_FUNCTION_RE.match(line) + m = IR_FUNCTION_LABEL_RE.match(line) if m is not None: func_name = m.group(1) if ( @@ -572,6 +572,9 @@ def invoke_tool(exe, cmd_args, ir, preprocess_cmd=None, verbose=False): ) IR_FUNCTION_RE = re.compile(r'^\s*define\s+(?:internal\s+)?[^@]*@"?([\w.$-]+)"?\s*\(') +IR_FUNCTION_LABEL_RE = re.compile( + r'^\s*(?:define\s+(?:internal\s+)?[^@]*)?@"?([\w.$-]+)"?\s*\(' +) TRIPLE_IR_RE = re.compile(r'^\s*target\s+triple\s*=\s*"([^"]+)"$') TRIPLE_ARG_RE = re.compile(r"-m?triple[= ]([^ ]+)") MARCH_ARG_RE = re.compile(r"-march[= ]([^ ]+)")