From: Fangrui Song Date: Wed, 30 Dec 2020 19:59:36 +0000 (-0800) Subject: [update_llc_test_checks] Support .Lfunc$local for x86 -relocation-model=pic dsolocal... X-Git-Tag: llvmorg-13-init~2367 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=294a196b0488c737544411bf570f4aa2a23f727e;p=platform%2Fupstream%2Fllvm.git [update_llc_test_checks] Support .Lfunc$local for x86 -relocation-model=pic dsolocal tests --- 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 231aa54..046de36 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 32b05fc..64eaf90 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 839b727..7cfd318 100644 --- a/llvm/utils/UpdateTestChecks/asm.py +++ b/llvm/utils/UpdateTestChecks/asm.py @@ -15,7 +15,9 @@ else: ##### 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))