[llvm] caf22ec - [UpdateTestChecks] More support for X86 exception handling
Jay Foad via llvm-commits
llvm-commits at lists.llvm.org
Sat May 6 07:21:46 PDT 2023
Author: Jay Foad
Date: 2023-05-06T15:16:54+01:00
New Revision: caf22ec64a03bb2f02fd2e42756eb7ef83d5ac25
URL: https://github.com/llvm/llvm-project/commit/caf22ec64a03bb2f02fd2e42756eb7ef83d5ac25
DIFF: https://github.com/llvm/llvm-project/commit/caf22ec64a03bb2f02fd2e42756eb7ef83d5ac25.diff
LOG: [UpdateTestChecks] More support for X86 exception handling
Differential Revision: https://reviews.llvm.org/D149971
Added:
Modified:
llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/x86-basic.ll
llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/x86-basic.ll.expected
llvm/utils/UpdateTestChecks/asm.py
Removed:
################################################################################
diff --git a/llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/x86-basic.ll b/llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/x86-basic.ll
index 54d568e0a53c8..bd6ee5fc614a3 100644
--- a/llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/x86-basic.ll
+++ b/llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/x86-basic.ll
@@ -30,3 +30,9 @@ entry:
%c = add i32 %a, %b
ret i32 %c
}
+
+declare i32 @pers(...)
+
+define i32 @eh() personality ptr @pers {
+ ret i32 0
+}
diff --git a/llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/x86-basic.ll.expected b/llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/x86-basic.ll.expected
index 87e1db292408a..e113303f57a37 100644
--- a/llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/x86-basic.ll.expected
+++ b/llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/x86-basic.ll.expected
@@ -94,3 +94,27 @@ entry:
%c = add i32 %a, %b
ret i32 %c
}
+
+declare i32 @pers(...)
+
+define i32 @eh() personality ptr @pers {
+; CHECK-LABEL: eh:
+; CHECK: # %bb.0:
+; CHECK-NEXT: xorl %eax, %eax
+; CHECK-NEXT: retq
+;
+; PIC-LABEL: eh:
+; PIC: # %bb.0:
+; PIC-NEXT: xorl %eax, %eax
+; PIC-NEXT: retq
+;
+; WIN-LABEL: eh:
+; WIN: # %bb.0:
+; WIN-NEXT: xorl %eax, %eax
+; WIN-NEXT: retq
+; WIN-NEXT: .Lfunc_end0:
+; WIN-NEXT: .seh_handlerdata
+; WIN-NEXT: .text
+; WIN-NEXT: .seh_endproc
+ ret i32 0
+}
diff --git a/llvm/utils/UpdateTestChecks/asm.py b/llvm/utils/UpdateTestChecks/asm.py
index 697d3ee17d96f..54719228e1264 100644
--- a/llvm/utils/UpdateTestChecks/asm.py
+++ b/llvm/utils/UpdateTestChecks/asm.py
@@ -18,7 +18,7 @@ class string:
r'^_?(?P<func>[^:]+):[ \t]*#+[ \t]*(@"?(?P=func)"?| -- Begin function (?P=func))\n(?:\s*\.?Lfunc_begin[^:\n]*:\n)?'
r'(?:\.L(?P=func)\$local:\n)?' # drop .L<func>$local:
r'(?:\s*\.type\s+\.L(?P=func)\$local, at function\n)?' # drop .type .L<func>$local
- r'(?:[ \t]+.cfi_startproc\n|.seh_proc[^\n]+\n)?' # drop optional cfi
+ r'(?:[ \t]*(?:\.cfi_startproc|\.cfi_personality|\.cfi_lsda|\.seh_proc|\.seh_handler)\b[^\n]*\n)*' # drop optional cfi
r'(?P<body>^##?[ \t]+[^:]+:.*?)\s*'
r'^\s*(?:[^:\n]+?:\s*\n\s*\.size|\.cfi_endproc|\.globl|\.comm|\.(?:sub)?section|#+ -- End function)',
flags=(re.M | re.S))
More information about the llvm-commits
mailing list