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 231aa54d6978e1..046de36137b0ff 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 @@ -1,8 +1,15 @@ -; 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 +} 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 32b05fccf62bfd..64eaf90ed33ba3 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 @@ -1,13 +1,34 @@ ; 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 } diff --git a/llvm/utils/UpdateTestChecks/asm.py b/llvm/utils/UpdateTestChecks/asm.py index 839b727304592a..7cfd31865a342f 100644 --- a/llvm/utils/UpdateTestChecks/asm.py +++ b/llvm/utils/UpdateTestChecks/asm.py @@ -15,7 +15,9 @@ class string: ##### Assembly parser ASM_FUNCTION_X86_RE = re.compile( - r'^_?(?P[^:]+):[ \t]*#+[ \t]*(@"?(?P=func)"?| -- Begin function (?P=func))\n(?:\s*\.?Lfunc_begin[^:\n]*:\n)?[^:]*?' + r'^_?(?P[^:]+):[ \t]*#+[ \t]*(@"?(?P=func)"?| -- Begin function (?P=func))\n(?:\s*\.?Lfunc_begin[^:\n]*:\n)?' + r'(?:\.L[^$]+\$local:\n)?' # drop .L$local: + r'(?:[ \t]+.cfi_startproc\n)?' # drop optional cfi noise r'(?P^##?[ \t]+[^:]+:.*?)\s*' r'^\s*(?:[^:\n]+?:\s*\n\s*\.size|\.cfi_endproc|\.globl|\.comm|\.(?:sub)?section|#+ -- End function)', flags=(re.M | re.S))