aboutsummaryrefslogtreecommitdiff
path: root/llvm
diff options
context:
space:
mode:
Diffstat (limited to 'llvm')
-rw-r--r--llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/x86_function_name.ll6
-rw-r--r--llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/x86_function_name.ll.expected32
-rw-r--r--llvm/utils/UpdateTestChecks/asm.py2
3 files changed, 39 insertions, 1 deletions
diff --git a/llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/x86_function_name.ll b/llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/x86_function_name.ll
index 046de361..1488c9f 100644
--- a/llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/x86_function_name.ll
+++ b/llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/x86_function_name.ll
@@ -4,6 +4,9 @@
;; Check that we accept .Ldsolocal$local: below the function label.
; RUN: llc -mtriple=x86_64 -relocation-model=pic < %s | FileCheck %s --check-prefix=PIC
+;; Check that we accept .seh_proc below the function label.
+; RUN: llc -mtriple=x86_64-windows -relocation-model=pic < %s | FileCheck %s --check-prefix=WIN
+
define hidden i32 @"_Z54bar$ompvariant$bar"() {
entry:
ret i32 2
@@ -11,5 +14,8 @@ entry:
define dso_local i32 @dsolocal() {
entry:
+ call void @ext()
ret i32 2
}
+
+declare void @ext()
diff --git a/llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/x86_function_name.ll.expected b/llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/x86_function_name.ll.expected
index 64eaf90..000e780 100644
--- a/llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/x86_function_name.ll.expected
+++ b/llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/x86_function_name.ll.expected
@@ -5,6 +5,9 @@
;; Check that we accept .Ldsolocal$local: below the function label.
; RUN: llc -mtriple=x86_64 -relocation-model=pic < %s | FileCheck %s --check-prefix=PIC
+;; Check that we accept .seh_proc below the function label.
+; RUN: llc -mtriple=x86_64-windows -relocation-model=pic < %s | FileCheck %s --check-prefix=WIN
+
define hidden i32 @"_Z54bar$ompvariant$bar"() {
; CHECK-LABEL: _Z54bar$ompvariant$bar:
; CHECK: # %bb.0: # %entry
@@ -15,6 +18,11 @@ define hidden i32 @"_Z54bar$ompvariant$bar"() {
; PIC: # %bb.0: # %entry
; PIC-NEXT: movl $2, %eax
; PIC-NEXT: retq
+;
+; WIN-LABEL: _Z54bar$ompvariant$bar:
+; WIN: # %bb.0: # %entry
+; WIN-NEXT: movl $2, %eax
+; WIN-NEXT: retq
entry:
ret i32 2
}
@@ -22,13 +30,37 @@ entry:
define dso_local i32 @dsolocal() {
; CHECK-LABEL: dsolocal:
; CHECK: # %bb.0: # %entry
+; CHECK-NEXT: pushq %rax
+; CHECK-NEXT: .cfi_def_cfa_offset 16
+; CHECK-NEXT: callq ext@PLT
; CHECK-NEXT: movl $2, %eax
+; CHECK-NEXT: popq %rcx
+; CHECK-NEXT: .cfi_def_cfa_offset 8
; CHECK-NEXT: retq
;
; PIC-LABEL: dsolocal:
; PIC: # %bb.0: # %entry
+; PIC-NEXT: pushq %rax
+; PIC-NEXT: .cfi_def_cfa_offset 16
+; PIC-NEXT: callq ext@PLT
; PIC-NEXT: movl $2, %eax
+; PIC-NEXT: popq %rcx
+; PIC-NEXT: .cfi_def_cfa_offset 8
; PIC-NEXT: retq
+;
+; WIN-LABEL: dsolocal:
+; WIN: # %bb.0: # %entry
+; WIN-NEXT: subq $40, %rsp
+; WIN-NEXT: .seh_stackalloc 40
+; WIN-NEXT: .seh_endprologue
+; WIN-NEXT: callq ext
+; WIN-NEXT: movl $2, %eax
+; WIN-NEXT: addq $40, %rsp
+; WIN-NEXT: retq
+; WIN-NEXT: .seh_endproc
entry:
+ call void @ext()
ret i32 2
}
+
+declare void @ext()
diff --git a/llvm/utils/UpdateTestChecks/asm.py b/llvm/utils/UpdateTestChecks/asm.py
index 7cfd318..a42a75e 100644
--- a/llvm/utils/UpdateTestChecks/asm.py
+++ b/llvm/utils/UpdateTestChecks/asm.py
@@ -17,7 +17,7 @@ else:
ASM_FUNCTION_X86_RE = re.compile(
r'^_?(?P<func>[^:]+):[ \t]*#+[ \t]*(@"?(?P=func)"?| -- Begin function (?P=func))\n(?:\s*\.?Lfunc_begin[^:\n]*:\n)?'
r'(?:\.L[^$]+\$local:\n)?' # drop .L<func>$local:
- r'(?:[ \t]+.cfi_startproc\n)?' # drop optional cfi noise
+ r'(?:[ \t]+.cfi_startproc\n|.seh_proc[^\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))