-; Check that we accept functions with '$' in the name.
-;
-; RUN: llc -mtriple=x86_64-unknown-unknown < %s | FileCheck %s
-;
+;; Check that we accept functions with '$' in the name.
+; RUN: llc -mtriple=x86_64 < %s | FileCheck %s
+
+;; Check that we accept .Ldsolocal$local: below the function label.
+; RUN: llc -mtriple=x86_64 -relocation-model=pic < %s | FileCheck %s --check-prefix=PIC
+
define hidden i32 @"_Z54bar$ompvariant$bar"() {
entry:
ret i32 2
}
+
+define dso_local i32 @dsolocal() {
+entry:
+ ret i32 2
+}
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
-; Check that we accept functions with '$' in the name.
-;
-; RUN: llc -mtriple=x86_64-unknown-unknown < %s | FileCheck %s
-;
+;; Check that we accept functions with '$' in the name.
+; RUN: llc -mtriple=x86_64 < %s | FileCheck %s
+
+;; Check that we accept .Ldsolocal$local: below the function label.
+; RUN: llc -mtriple=x86_64 -relocation-model=pic < %s | FileCheck %s --check-prefix=PIC
+
define hidden i32 @"_Z54bar$ompvariant$bar"() {
; CHECK-LABEL: _Z54bar$ompvariant$bar:
; CHECK: # %bb.0: # %entry
; CHECK-NEXT: movl $2, %eax
; CHECK-NEXT: retq
+;
+; PIC-LABEL: _Z54bar$ompvariant$bar:
+; PIC: # %bb.0: # %entry
+; PIC-NEXT: movl $2, %eax
+; PIC-NEXT: retq
+entry:
+ ret i32 2
+}
+
+define dso_local i32 @dsolocal() {
+; CHECK-LABEL: dsolocal:
+; CHECK: # %bb.0: # %entry
+; CHECK-NEXT: movl $2, %eax
+; CHECK-NEXT: retq
+;
+; PIC-LABEL: dsolocal:
+; PIC: # %bb.0: # %entry
+; PIC-NEXT: movl $2, %eax
+; PIC-NEXT: retq
entry:
ret i32 2
}
##### Assembly parser
ASM_FUNCTION_X86_RE = re.compile(
- r'^_?(?P<func>[^:]+):[ \t]*#+[ \t]*(@"?(?P=func)"?| -- Begin function (?P=func))\n(?:\s*\.?Lfunc_begin[^:\n]*:\n)?[^:]*?'
+ 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'(?P<body>^##?[ \t]+[^:]+:.*?)\s*'
r'^\s*(?:[^:\n]+?:\s*\n\s*\.size|\.cfi_endproc|\.globl|\.comm|\.(?:sub)?section|#+ -- End function)',
flags=(re.M | re.S))