;; 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
define dso_local i32 @dsolocal() {
entry:
+ call void @ext()
ret i32 2
}
+
+declare void @ext()
;; 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
; 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
}
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()
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))