From ce0eb81c72749d1e96cfc6fb68af3c24b63753cc Mon Sep 17 00:00:00 2001 From: David Greene Date: Thu, 23 Jan 2020 14:30:32 -0600 Subject: [PATCH] [UpdateTestChecks] Allow $ in function names Some compilers generation functions with '$' in their names, so recognize those functions. This also requires recognizing function names inside quotes in some contexts in order to escape certain characters. Differential Revision: https://reviews.llvm.org/D82995 --- .../Inputs/aarch64_function_name.ll | 9 +++++++ .../Inputs/aarch64_function_name.ll.expected | 19 +++++++++++++++ .../Inputs/amdgpu_function_name.ll | 8 +++++++ .../Inputs/amdgpu_function_name.ll.expected | 14 +++++++++++ .../Inputs/arm_function_name.ll | 10 ++++++++ .../Inputs/arm_function_name.ll.expected | 15 ++++++++++++ .../Inputs/hexagon_function_name.ll | 8 +++++++ .../Inputs/hexagon_function_name.ll.expected | 16 +++++++++++++ .../Inputs/lanai_function_name.ll | 8 +++++++ .../Inputs/lanai_function_name.ll.expected | 18 ++++++++++++++ .../Inputs/mips_function_name.ll | 8 +++++++ .../Inputs/mips_function_name.ll.expected | 13 ++++++++++ .../Inputs/msp430_function_name.ll | 8 +++++++ .../Inputs/msp430_function_name.ll.expected | 14 +++++++++++ .../Inputs/ppc_function_name.ll | 8 +++++++ .../Inputs/ppc_function_name.ll.expected | 13 ++++++++++ .../Inputs/riscv_function_name.ll | 8 +++++++ .../Inputs/riscv_function_name.ll.expected | 13 ++++++++++ .../Inputs/sparc_function_name.ll | 8 +++++++ .../Inputs/sparc_function_name.ll.expected | 14 +++++++++++ .../Inputs/systemz_function_name.ll | 8 +++++++ .../Inputs/systemz_function_name.ll.expected | 13 ++++++++++ .../Inputs/wasm_function_name.ll | 8 +++++++ .../Inputs/wasm_function_name.ll.expected | 14 +++++++++++ .../Inputs/x86_function_name.ll | 8 +++++++ .../Inputs/x86_function_name.ll.expected | 13 ++++++++++ .../aarch64-function-name.test | 5 ++++ .../amdgpu-function-name.test | 5 ++++ .../update_llc_test_checks/arm-function-name.test | 5 ++++ .../hexagon-function-name.test | 5 ++++ .../lanai-function-name.test | 5 ++++ .../update_llc_test_checks/mips-function-name.test | 5 ++++ .../msp430-function-name.test | 5 ++++ .../update_llc_test_checks/ppc-function-name.test | 5 ++++ .../riscv-function-name.test | 5 ++++ .../sparc-function-name.test | 5 ++++ .../systemz-function-name.test | 5 ++++ .../update_llc_test_checks/wasm-function-name.test | 5 ++++ .../update_llc_test_checks/x86-function-name.test | 5 ++++ .../update_test_checks/Inputs/function_name.ll | 8 +++++++ .../Inputs/function_name.ll.expected | 9 +++++++ .../update_test_checks/function-name.test | 7 ++++++ llvm/utils/UpdateTestChecks/asm.py | 28 +++++++++++----------- llvm/utils/UpdateTestChecks/common.py | 6 ++--- 44 files changed, 402 insertions(+), 17 deletions(-) create mode 100644 llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/aarch64_function_name.ll create mode 100644 llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/aarch64_function_name.ll.expected create mode 100644 llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/amdgpu_function_name.ll create mode 100644 llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/amdgpu_function_name.ll.expected create mode 100644 llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/arm_function_name.ll create mode 100644 llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/arm_function_name.ll.expected create mode 100644 llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/hexagon_function_name.ll create mode 100644 llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/hexagon_function_name.ll.expected create mode 100644 llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/lanai_function_name.ll create mode 100644 llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/lanai_function_name.ll.expected create mode 100644 llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/mips_function_name.ll create mode 100644 llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/mips_function_name.ll.expected create mode 100644 llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/msp430_function_name.ll create mode 100644 llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/msp430_function_name.ll.expected create mode 100644 llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/ppc_function_name.ll create mode 100644 llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/ppc_function_name.ll.expected create mode 100644 llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/riscv_function_name.ll create mode 100644 llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/riscv_function_name.ll.expected create mode 100644 llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/sparc_function_name.ll create mode 100644 llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/sparc_function_name.ll.expected create mode 100644 llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/systemz_function_name.ll create mode 100644 llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/systemz_function_name.ll.expected create mode 100644 llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/wasm_function_name.ll create mode 100644 llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/wasm_function_name.ll.expected create mode 100644 llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/x86_function_name.ll create mode 100644 llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/x86_function_name.ll.expected create mode 100644 llvm/test/tools/UpdateTestChecks/update_llc_test_checks/aarch64-function-name.test create mode 100644 llvm/test/tools/UpdateTestChecks/update_llc_test_checks/amdgpu-function-name.test create mode 100644 llvm/test/tools/UpdateTestChecks/update_llc_test_checks/arm-function-name.test create mode 100644 llvm/test/tools/UpdateTestChecks/update_llc_test_checks/hexagon-function-name.test create mode 100644 llvm/test/tools/UpdateTestChecks/update_llc_test_checks/lanai-function-name.test create mode 100644 llvm/test/tools/UpdateTestChecks/update_llc_test_checks/mips-function-name.test create mode 100644 llvm/test/tools/UpdateTestChecks/update_llc_test_checks/msp430-function-name.test create mode 100644 llvm/test/tools/UpdateTestChecks/update_llc_test_checks/ppc-function-name.test create mode 100644 llvm/test/tools/UpdateTestChecks/update_llc_test_checks/riscv-function-name.test create mode 100644 llvm/test/tools/UpdateTestChecks/update_llc_test_checks/sparc-function-name.test create mode 100644 llvm/test/tools/UpdateTestChecks/update_llc_test_checks/systemz-function-name.test create mode 100644 llvm/test/tools/UpdateTestChecks/update_llc_test_checks/wasm-function-name.test create mode 100644 llvm/test/tools/UpdateTestChecks/update_llc_test_checks/x86-function-name.test create mode 100644 llvm/test/tools/UpdateTestChecks/update_test_checks/Inputs/function_name.ll create mode 100644 llvm/test/tools/UpdateTestChecks/update_test_checks/Inputs/function_name.ll.expected create mode 100644 llvm/test/tools/UpdateTestChecks/update_test_checks/function-name.test diff --git a/llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/aarch64_function_name.ll b/llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/aarch64_function_name.ll new file mode 100644 index 0000000..1ea9d20 --- /dev/null +++ b/llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/aarch64_function_name.ll @@ -0,0 +1,9 @@ +; Check that we accept functions with '$' in the name. +; +; RUN: llc -mtriple=aarch64-unknown-linux < %s | FileCheck --check-prefix=LINUX %s +; RUN: llc -mtriple=aarch64-apple-darwin < %s | FileCheck --check-prefix=DARWIN %s +; +define hidden i32 @"_Z54bar$ompvariant$bar"() { +entry: + ret i32 2 +} diff --git a/llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/aarch64_function_name.ll.expected b/llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/aarch64_function_name.ll.expected new file mode 100644 index 0000000..fbe1cae --- /dev/null +++ b/llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/aarch64_function_name.ll.expected @@ -0,0 +1,19 @@ +; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py +; Check that we accept functions with '$' in the name. +; +; RUN: llc -mtriple=aarch64-unknown-linux < %s | FileCheck --check-prefix=LINUX %s +; RUN: llc -mtriple=aarch64-apple-darwin < %s | FileCheck --check-prefix=DARWIN %s +; +define hidden i32 @"_Z54bar$ompvariant$bar"() { +; LINUX-LABEL: _Z54bar$ompvariant$bar: +; LINUX: // %bb.0: // %entry +; LINUX-NEXT: mov w0, #2 +; LINUX-NEXT: ret +; +; DARWIN-LABEL: _Z54bar$ompvariant$bar: +; DARWIN: ; %bb.0: ; %entry +; DARWIN-NEXT: mov w0, #2 +; DARWIN-NEXT: ret +entry: + ret i32 2 +} diff --git a/llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/amdgpu_function_name.ll b/llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/amdgpu_function_name.ll new file mode 100644 index 0000000..b48607d --- /dev/null +++ b/llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/amdgpu_function_name.ll @@ -0,0 +1,8 @@ +; Check that we accept functions with '$' in the name. +; +; RUN: llc -mtriple=amdgcn-amd-amdhsa < %s | FileCheck %s +; +define hidden i32 @"_Z54bar$ompvariant$bar"() { +entry: + ret i32 2 +} diff --git a/llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/amdgpu_function_name.ll.expected b/llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/amdgpu_function_name.ll.expected new file mode 100644 index 0000000..e13058f --- /dev/null +++ b/llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/amdgpu_function_name.ll.expected @@ -0,0 +1,14 @@ +; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py +; Check that we accept functions with '$' in the name. +; +; RUN: llc -mtriple=amdgcn-amd-amdhsa < %s | FileCheck %s +; +define hidden i32 @"_Z54bar$ompvariant$bar"() { +; CHECK-LABEL: _Z54bar$ompvariant$bar: +; CHECK: ; %bb.0: ; %entry +; CHECK-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) +; CHECK-NEXT: v_mov_b32_e32 v0, 2 +; CHECK-NEXT: s_setpc_b64 s[30:31] +entry: + ret i32 2 +} diff --git a/llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/arm_function_name.ll b/llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/arm_function_name.ll new file mode 100644 index 0000000..6c0f9e9 --- /dev/null +++ b/llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/arm_function_name.ll @@ -0,0 +1,10 @@ +; Check that we accept functions with '$' in the name. +; +; RUN: llc -mtriple=arm64-unknown-linux < %s | FileCheck --prefi=LINUX %s +; RUN: llc -mtriple=armv7-apple-darwin < %s | FileCheck --prefix=DARWIN %s +; RUN: llc -mtriple=armv7-apple-ios < %s | FileCheck --prefix=IOS %s +; +define hidden i32 @"_Z54bar$ompvariant$bar"() { +entry: + ret i32 2 +} diff --git a/llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/arm_function_name.ll.expected b/llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/arm_function_name.ll.expected new file mode 100644 index 0000000..e191b04 --- /dev/null +++ b/llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/arm_function_name.ll.expected @@ -0,0 +1,15 @@ +; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py +; Check that we accept functions with '$' in the name. +; +; RUN: llc -mtriple=arm64-unknown-linux < %s | FileCheck --prefi=LINUX %s +; RUN: llc -mtriple=armv7-apple-darwin < %s | FileCheck --prefix=DARWIN %s +; RUN: llc -mtriple=armv7-apple-ios < %s | FileCheck --prefix=IOS %s +; +define hidden i32 @"_Z54bar$ompvariant$bar"() { +; CHECK-LABEL: _Z54bar$ompvariant$bar: +; CHECK: // %bb.0: // %entry +; CHECK-NEXT: mov w0, #2 +; CHECK-NEXT: ret +entry: + ret i32 2 +} diff --git a/llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/hexagon_function_name.ll b/llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/hexagon_function_name.ll new file mode 100644 index 0000000..526f6bd --- /dev/null +++ b/llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/hexagon_function_name.ll @@ -0,0 +1,8 @@ +; Check that we accept functions with '$' in the name. +; +; RUN: llc -mtriple=hexagon-unknown-linux < %s | FileCheck %s +; +define hidden i32 @"_Z54bar$ompvariant$bar"() { +entry: + ret i32 2 +} diff --git a/llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/hexagon_function_name.ll.expected b/llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/hexagon_function_name.ll.expected new file mode 100644 index 0000000..9033be4 --- /dev/null +++ b/llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/hexagon_function_name.ll.expected @@ -0,0 +1,16 @@ +; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py +; Check that we accept functions with '$' in the name. +; +; RUN: llc -mtriple=hexagon-unknown-linux < %s | FileCheck %s +; +define hidden i32 @"_Z54bar$ompvariant$bar"() { +; CHECK-LABEL: _Z54bar$ompvariant$bar: +; CHECK: .cfi_startproc +; CHECK-NEXT: // %bb.0: // %entry +; CHECK-NEXT: { +; CHECK-NEXT: r0 = #2 +; CHECK-NEXT: jumpr r31 +; CHECK-NEXT: } +entry: + ret i32 2 +} diff --git a/llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/lanai_function_name.ll b/llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/lanai_function_name.ll new file mode 100644 index 0000000..c1c7d4f --- /dev/null +++ b/llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/lanai_function_name.ll @@ -0,0 +1,8 @@ +; Check that we accept functions with '$' in the name. +; +; RUN: llc -mtriple=lanai-unknown-linux < %s | FileCheck %s +; +define hidden i32 @"_Z54bar$ompvariant$bar"() { +entry: + ret i32 2 +} diff --git a/llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/lanai_function_name.ll.expected b/llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/lanai_function_name.ll.expected new file mode 100644 index 0000000..4f30c23 --- /dev/null +++ b/llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/lanai_function_name.ll.expected @@ -0,0 +1,18 @@ +; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py +; Check that we accept functions with '$' in the name. +; +; RUN: llc -mtriple=lanai-unknown-linux < %s | FileCheck %s +; +define hidden i32 @"_Z54bar$ompvariant$bar"() { +; CHECK-LABEL: _Z54bar$ompvariant$bar: +; CHECK: ! %bb.0: ! %entry +; CHECK-NEXT: st %fp, [--%sp] +; CHECK-NEXT: add %sp, 0x8, %fp +; CHECK-NEXT: sub %sp, 0x8, %sp +; CHECK-NEXT: mov 0x2, %rv +; CHECK-NEXT: ld -4[%fp], %pc ! return +; CHECK-NEXT: add %fp, 0x0, %sp +; CHECK-NEXT: ld -8[%fp], %fp +entry: + ret i32 2 +} diff --git a/llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/mips_function_name.ll b/llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/mips_function_name.ll new file mode 100644 index 0000000..1cf2e3c --- /dev/null +++ b/llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/mips_function_name.ll @@ -0,0 +1,8 @@ +; Check that we accept functions with '$' in the name. +; +; RUN: llc -mtriple=mips-unknown-linux < %s | FileCheck %s +; +define hidden i32 @"_Z54bar$ompvariant$bar"() { +entry: + ret i32 2 +} diff --git a/llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/mips_function_name.ll.expected b/llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/mips_function_name.ll.expected new file mode 100644 index 0000000..c1c4577 --- /dev/null +++ b/llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/mips_function_name.ll.expected @@ -0,0 +1,13 @@ +; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py +; Check that we accept functions with '$' in the name. +; +; RUN: llc -mtriple=mips-unknown-linux < %s | FileCheck %s +; +define hidden i32 @"_Z54bar$ompvariant$bar"() { +; CHECK-LABEL: _Z54bar$ompvariant$bar: +; CHECK: # %bb.0: # %entry +; CHECK-NEXT: jr $ra +; CHECK-NEXT: addiu $2, $zero, 2 +entry: + ret i32 2 +} diff --git a/llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/msp430_function_name.ll b/llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/msp430_function_name.ll new file mode 100644 index 0000000..1bf6ea9 --- /dev/null +++ b/llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/msp430_function_name.ll @@ -0,0 +1,8 @@ +; Check that we accept functions with '$' in the name. +; +; RUN: llc -mtriple=msp430-unknown-linux < %s | FileCheck %s +; +define hidden i32 @"_Z54bar$ompvariant$bar"() { +entry: + ret i32 2 +} diff --git a/llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/msp430_function_name.ll.expected b/llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/msp430_function_name.ll.expected new file mode 100644 index 0000000..2cb55cd --- /dev/null +++ b/llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/msp430_function_name.ll.expected @@ -0,0 +1,14 @@ +; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py +; Check that we accept functions with '$' in the name. +; +; RUN: llc -mtriple=msp430-unknown-linux < %s | FileCheck %s +; +define hidden i32 @"_Z54bar$ompvariant$bar"() { +; CHECK-LABEL: _Z54bar$ompvariant$bar: +; CHECK: ; %bb.0: ; %entry +; CHECK-NEXT: mov #2, r12 +; CHECK-NEXT: clr r13 +; CHECK-NEXT: ret +entry: + ret i32 2 +} diff --git a/llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/ppc_function_name.ll b/llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/ppc_function_name.ll new file mode 100644 index 0000000..d4d1c68 --- /dev/null +++ b/llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/ppc_function_name.ll @@ -0,0 +1,8 @@ +; Check that we accept functions with '$' in the name. +; +; RUN: llc -mtriple=ppc32-unknown-linux < %s | FileCheck %s +; +define hidden i32 @"_Z54bar$ompvariant$bar"() { +entry: + ret i32 2 +} diff --git a/llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/ppc_function_name.ll.expected b/llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/ppc_function_name.ll.expected new file mode 100644 index 0000000..72edada --- /dev/null +++ b/llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/ppc_function_name.ll.expected @@ -0,0 +1,13 @@ +; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py +; Check that we accept functions with '$' in the name. +; +; RUN: llc -mtriple=ppc32-unknown-linux < %s | FileCheck %s +; +define hidden i32 @"_Z54bar$ompvariant$bar"() { +; CHECK-LABEL: _Z54bar$ompvariant$bar: +; CHECK: # %bb.0: # %entry +; CHECK-NEXT: li 3, 2 +; CHECK-NEXT: blr +entry: + ret i32 2 +} diff --git a/llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/riscv_function_name.ll b/llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/riscv_function_name.ll new file mode 100644 index 0000000..db4a198 --- /dev/null +++ b/llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/riscv_function_name.ll @@ -0,0 +1,8 @@ +; Check that we accept functions with '$' in the name. +; +; RUN: llc -mtriple=riscv32-unknown-linux < %s | FileCheck %s +; +define hidden i32 @"_Z54bar$ompvariant$bar"() { +entry: + ret i32 2 +} diff --git a/llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/riscv_function_name.ll.expected b/llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/riscv_function_name.ll.expected new file mode 100644 index 0000000..d2ec3e0 --- /dev/null +++ b/llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/riscv_function_name.ll.expected @@ -0,0 +1,13 @@ +; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py +; Check that we accept functions with '$' in the name. +; +; RUN: llc -mtriple=riscv32-unknown-linux < %s | FileCheck %s +; +define hidden i32 @"_Z54bar$ompvariant$bar"() { +; CHECK-LABEL: _Z54bar$ompvariant$bar: +; CHECK: # %bb.0: # %entry +; CHECK-NEXT: addi a0, zero, 2 +; CHECK-NEXT: ret +entry: + ret i32 2 +} diff --git a/llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/sparc_function_name.ll b/llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/sparc_function_name.ll new file mode 100644 index 0000000..8b4ae66 --- /dev/null +++ b/llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/sparc_function_name.ll @@ -0,0 +1,8 @@ +; Check that we accept functions with '$' in the name. +; +; RUN: llc -mtriple=sparc-unknown-linux < %s | FileCheck %s +; +define hidden i32 @"_Z54bar$ompvariant$bar"() { +entry: + ret i32 2 +} diff --git a/llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/sparc_function_name.ll.expected b/llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/sparc_function_name.ll.expected new file mode 100644 index 0000000..72307c7 --- /dev/null +++ b/llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/sparc_function_name.ll.expected @@ -0,0 +1,14 @@ +; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py +; Check that we accept functions with '$' in the name. +; +; RUN: llc -mtriple=sparc-unknown-linux < %s | FileCheck %s +; +define hidden i32 @"_Z54bar$ompvariant$bar"() { +; CHECK-LABEL: _Z54bar$ompvariant$bar: +; CHECK: .cfi_startproc +; CHECK-NEXT: ! %bb.0: ! %entry +; CHECK-NEXT: retl +; CHECK-NEXT: mov 2, %o0 +entry: + ret i32 2 +} diff --git a/llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/systemz_function_name.ll b/llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/systemz_function_name.ll new file mode 100644 index 0000000..101bec2 --- /dev/null +++ b/llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/systemz_function_name.ll @@ -0,0 +1,8 @@ +; Check that we accept functions with '$' in the name. +; +; RUN: llc -mtriple=s390x-unknown-linux < %s | FileCheck %s +; +define hidden i32 @"_Z54bar$ompvariant$bar"() { +entry: + ret i32 2 +} diff --git a/llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/systemz_function_name.ll.expected b/llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/systemz_function_name.ll.expected new file mode 100644 index 0000000..c5dade1 --- /dev/null +++ b/llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/systemz_function_name.ll.expected @@ -0,0 +1,13 @@ +; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py +; Check that we accept functions with '$' in the name. +; +; RUN: llc -mtriple=s390x-unknown-linux < %s | FileCheck %s +; +define hidden i32 @"_Z54bar$ompvariant$bar"() { +; CHECK-LABEL: _Z54bar$ompvariant$bar: +; CHECK: # %bb.0: # %entry +; CHECK-NEXT: lhi %r2, 2 +; CHECK-NEXT: br %r14 +entry: + ret i32 2 +} diff --git a/llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/wasm_function_name.ll b/llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/wasm_function_name.ll new file mode 100644 index 0000000..a55cd8e --- /dev/null +++ b/llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/wasm_function_name.ll @@ -0,0 +1,8 @@ +; Check that we accept functions with '$' in the name. +; +; RUN: llc -mtriple=wasm32-unknown-linux < %s | FileCheck %s +; +define hidden i32 @"_Z54bar$ompvariant$bar"() { +entry: + ret i32 2 +} diff --git a/llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/wasm_function_name.ll.expected b/llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/wasm_function_name.ll.expected new file mode 100644 index 0000000..e5a10a3 --- /dev/null +++ b/llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/wasm_function_name.ll.expected @@ -0,0 +1,14 @@ +; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py +; Check that we accept functions with '$' in the name. +; +; RUN: llc -mtriple=wasm32-unknown-linux < %s | FileCheck %s +; +define hidden i32 @"_Z54bar$ompvariant$bar"() { +; CHECK-LABEL: _Z54bar$ompvariant$bar: +; CHECK: .functype _Z54bar$ompvariant$bar () -> (i32) +; CHECK-NEXT: # %bb.0: # %entry +; CHECK-NEXT: i32.const 2 +; CHECK-NEXT: # fallthrough-return +entry: + ret i32 2 +} 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 new file mode 100644 index 0000000..231aa54 --- /dev/null +++ b/llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/x86_function_name.ll @@ -0,0 +1,8 @@ +; Check that we accept functions with '$' in the name. +; +; RUN: llc -mtriple=x86_64-unknown-unknown < %s | FileCheck %s +; +define hidden i32 @"_Z54bar$ompvariant$bar"() { +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 new file mode 100644 index 0000000..32b05fc --- /dev/null +++ b/llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/x86_function_name.ll.expected @@ -0,0 +1,13 @@ +; 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 +; +define hidden i32 @"_Z54bar$ompvariant$bar"() { +; CHECK-LABEL: _Z54bar$ompvariant$bar: +; CHECK: # %bb.0: # %entry +; CHECK-NEXT: movl $2, %eax +; CHECK-NEXT: retq +entry: + ret i32 2 +} diff --git a/llvm/test/tools/UpdateTestChecks/update_llc_test_checks/aarch64-function-name.test b/llvm/test/tools/UpdateTestChecks/update_llc_test_checks/aarch64-function-name.test new file mode 100644 index 0000000..36c96cc --- /dev/null +++ b/llvm/test/tools/UpdateTestChecks/update_llc_test_checks/aarch64-function-name.test @@ -0,0 +1,5 @@ +# REQUIRES: aarch64-registered-target +## Check that functions names with '$' are processed correctly + +# RUN: cp -f %S/Inputs/aarch64_function_name.ll %t.ll && %update_llc_test_checks %t.ll +# RUN: diff -u %S/Inputs/aarch64_function_name.ll.expected %t.ll diff --git a/llvm/test/tools/UpdateTestChecks/update_llc_test_checks/amdgpu-function-name.test b/llvm/test/tools/UpdateTestChecks/update_llc_test_checks/amdgpu-function-name.test new file mode 100644 index 0000000..eb4092d --- /dev/null +++ b/llvm/test/tools/UpdateTestChecks/update_llc_test_checks/amdgpu-function-name.test @@ -0,0 +1,5 @@ +# REQUIRES: amdgpu-registered-target +## Check that functions names with '$' are processed correctly + +# RUN: cp -f %S/Inputs/amdgpu_function_name.ll %t.ll && %update_llc_test_checks %t.ll +# RUN: diff -u %S/Inputs/amdgpu_function_name.ll.expected %t.ll diff --git a/llvm/test/tools/UpdateTestChecks/update_llc_test_checks/arm-function-name.test b/llvm/test/tools/UpdateTestChecks/update_llc_test_checks/arm-function-name.test new file mode 100644 index 0000000..07455cb --- /dev/null +++ b/llvm/test/tools/UpdateTestChecks/update_llc_test_checks/arm-function-name.test @@ -0,0 +1,5 @@ +# REQUIRES: arm-registered-target +## Check that functions names with '$' are processed correctly + +# RUN: cp -f %S/Inputs/arm_function_name.ll %t.ll && %update_llc_test_checks %t.ll +# RUN: diff -u %S/Inputs/arm_function_name.ll.expected %t.ll diff --git a/llvm/test/tools/UpdateTestChecks/update_llc_test_checks/hexagon-function-name.test b/llvm/test/tools/UpdateTestChecks/update_llc_test_checks/hexagon-function-name.test new file mode 100644 index 0000000..1e34074 --- /dev/null +++ b/llvm/test/tools/UpdateTestChecks/update_llc_test_checks/hexagon-function-name.test @@ -0,0 +1,5 @@ +# REQUIRES: hexagon-registered-target +## Check that functions names with '$' are processed correctly + +# RUN: cp -f %S/Inputs/hexagon_function_name.ll %t.ll && %update_llc_test_checks %t.ll +# RUN: diff -u %S/Inputs/hexagon_function_name.ll.expected %t.ll diff --git a/llvm/test/tools/UpdateTestChecks/update_llc_test_checks/lanai-function-name.test b/llvm/test/tools/UpdateTestChecks/update_llc_test_checks/lanai-function-name.test new file mode 100644 index 0000000..cb5aa4e --- /dev/null +++ b/llvm/test/tools/UpdateTestChecks/update_llc_test_checks/lanai-function-name.test @@ -0,0 +1,5 @@ +# REQUIRES: lanai-registered-target +## Check that functions names with '$' are processed correctly + +# RUN: cp -f %S/Inputs/lanai_function_name.ll %t.ll && %update_llc_test_checks %t.ll +# RUN: diff -u %S/Inputs/lanai_function_name.ll.expected %t.ll diff --git a/llvm/test/tools/UpdateTestChecks/update_llc_test_checks/mips-function-name.test b/llvm/test/tools/UpdateTestChecks/update_llc_test_checks/mips-function-name.test new file mode 100644 index 0000000..03f9149 --- /dev/null +++ b/llvm/test/tools/UpdateTestChecks/update_llc_test_checks/mips-function-name.test @@ -0,0 +1,5 @@ +# REQUIRES: mips-registered-target +## Check that functions names with '$' are processed correctly + +# RUN: cp -f %S/Inputs/mips_function_name.ll %t.ll && %update_llc_test_checks %t.ll +# RUN: diff -u %S/Inputs/mips_function_name.ll.expected %t.ll diff --git a/llvm/test/tools/UpdateTestChecks/update_llc_test_checks/msp430-function-name.test b/llvm/test/tools/UpdateTestChecks/update_llc_test_checks/msp430-function-name.test new file mode 100644 index 0000000..8f67622 --- /dev/null +++ b/llvm/test/tools/UpdateTestChecks/update_llc_test_checks/msp430-function-name.test @@ -0,0 +1,5 @@ +# REQUIRES: msp430-registered-target +## Check that functions names with '$' are processed correctly + +# RUN: cp -f %S/Inputs/msp430_function_name.ll %t.ll && %update_llc_test_checks %t.ll +# RUN: diff -u %S/Inputs/msp430_function_name.ll.expected %t.ll diff --git a/llvm/test/tools/UpdateTestChecks/update_llc_test_checks/ppc-function-name.test b/llvm/test/tools/UpdateTestChecks/update_llc_test_checks/ppc-function-name.test new file mode 100644 index 0000000..824740c --- /dev/null +++ b/llvm/test/tools/UpdateTestChecks/update_llc_test_checks/ppc-function-name.test @@ -0,0 +1,5 @@ +# REQUIRES: powerpc-registered-target +## Check that functions names with '$' are processed correctly + +# RUN: cp -f %S/Inputs/ppc_function_name.ll %t.ll && %update_llc_test_checks %t.ll +# RUN: diff -u %S/Inputs/ppc_function_name.ll.expected %t.ll diff --git a/llvm/test/tools/UpdateTestChecks/update_llc_test_checks/riscv-function-name.test b/llvm/test/tools/UpdateTestChecks/update_llc_test_checks/riscv-function-name.test new file mode 100644 index 0000000..2e1e05d --- /dev/null +++ b/llvm/test/tools/UpdateTestChecks/update_llc_test_checks/riscv-function-name.test @@ -0,0 +1,5 @@ +# REQUIRES: riscv-registered-target +## Check that functions names with '$' are processed correctly + +# RUN: cp -f %S/Inputs/riscv_function_name.ll %t.ll && %update_llc_test_checks %t.ll +# RUN: diff -u %S/Inputs/riscv_function_name.ll.expected %t.ll diff --git a/llvm/test/tools/UpdateTestChecks/update_llc_test_checks/sparc-function-name.test b/llvm/test/tools/UpdateTestChecks/update_llc_test_checks/sparc-function-name.test new file mode 100644 index 0000000..a223ee2 --- /dev/null +++ b/llvm/test/tools/UpdateTestChecks/update_llc_test_checks/sparc-function-name.test @@ -0,0 +1,5 @@ +# REQUIRES: sparc-registered-target +## Check that functions names with '$' are processed correctly + +# RUN: cp -f %S/Inputs/sparc_function_name.ll %t.ll && %update_llc_test_checks %t.ll +# RUN: diff -u %S/Inputs/sparc_function_name.ll.expected %t.ll diff --git a/llvm/test/tools/UpdateTestChecks/update_llc_test_checks/systemz-function-name.test b/llvm/test/tools/UpdateTestChecks/update_llc_test_checks/systemz-function-name.test new file mode 100644 index 0000000..e6c4725 --- /dev/null +++ b/llvm/test/tools/UpdateTestChecks/update_llc_test_checks/systemz-function-name.test @@ -0,0 +1,5 @@ +# REQUIRES: systemz-registered-target +## Check that functions names with '$' are processed correctly + +# RUN: cp -f %S/Inputs/systemz_function_name.ll %t.ll && %update_llc_test_checks %t.ll +# RUN: diff -u %S/Inputs/systemz_function_name.ll.expected %t.ll diff --git a/llvm/test/tools/UpdateTestChecks/update_llc_test_checks/wasm-function-name.test b/llvm/test/tools/UpdateTestChecks/update_llc_test_checks/wasm-function-name.test new file mode 100644 index 0000000..fc45e28 --- /dev/null +++ b/llvm/test/tools/UpdateTestChecks/update_llc_test_checks/wasm-function-name.test @@ -0,0 +1,5 @@ +# REQUIRES: webassembly-registered-target +## Check that functions names with '$' are processed correctly + +# RUN: cp -f %S/Inputs/wasm_function_name.ll %t.ll && %update_llc_test_checks %t.ll +# RUN: diff -u %S/Inputs/wasm_function_name.ll.expected %t.ll diff --git a/llvm/test/tools/UpdateTestChecks/update_llc_test_checks/x86-function-name.test b/llvm/test/tools/UpdateTestChecks/update_llc_test_checks/x86-function-name.test new file mode 100644 index 0000000..d395afb --- /dev/null +++ b/llvm/test/tools/UpdateTestChecks/update_llc_test_checks/x86-function-name.test @@ -0,0 +1,5 @@ +# REQUIRES: x86-registered-target +## Check that functions names with '$' are processed correctly + +# RUN: cp -f %S/Inputs/x86_function_name.ll %t.ll && %update_llc_test_checks %t.ll +# RUN: diff -u %S/Inputs/x86_function_name.ll.expected %t.ll diff --git a/llvm/test/tools/UpdateTestChecks/update_test_checks/Inputs/function_name.ll b/llvm/test/tools/UpdateTestChecks/update_test_checks/Inputs/function_name.ll new file mode 100644 index 0000000..173e721 --- /dev/null +++ b/llvm/test/tools/UpdateTestChecks/update_test_checks/Inputs/function_name.ll @@ -0,0 +1,8 @@ +; Check that we accept functions with '$' in the name. +; +; RUN: opt < %s -instsimplify -S | FileCheck %s +; +define hidden i32 @"_Z54bar$ompvariant$bar"() { +entry: + ret i32 2 +} diff --git a/llvm/test/tools/UpdateTestChecks/update_test_checks/Inputs/function_name.ll.expected b/llvm/test/tools/UpdateTestChecks/update_test_checks/Inputs/function_name.ll.expected new file mode 100644 index 0000000..75e4235 --- /dev/null +++ b/llvm/test/tools/UpdateTestChecks/update_test_checks/Inputs/function_name.ll.expected @@ -0,0 +1,9 @@ +; NOTE: Assertions have been autogenerated by utils/update_test_checks.py +; Check that we accept functions with '$' in the name. +; +; RUN: opt < %s -instsimplify -S | FileCheck %s +; +define hidden i32 @"_Z54bar$ompvariant$bar"() { +entry: + ret i32 2 +} diff --git a/llvm/test/tools/UpdateTestChecks/update_test_checks/function-name.test b/llvm/test/tools/UpdateTestChecks/update_test_checks/function-name.test new file mode 100644 index 0000000..3d1a158 --- /dev/null +++ b/llvm/test/tools/UpdateTestChecks/update_test_checks/function-name.test @@ -0,0 +1,7 @@ +# REQUIRES: x86-registered-target +## Basic test checking that update_test_checks.py works correctly +# RUN: cp -f %S/Inputs/function_name.ll %t.ll && %update_test_checks %t.ll +# RUN: diff -u %t.ll %S/Inputs/function_name.ll.expected +## Check that running the script again does not change the result: +# RUN: %update_test_checks %t.ll +# RUN: diff -u %t.ll %S/Inputs/function_name.ll.expected diff --git a/llvm/utils/UpdateTestChecks/asm.py b/llvm/utils/UpdateTestChecks/asm.py index 588a287..dc35859 100644 --- a/llvm/utils/UpdateTestChecks/asm.py +++ b/llvm/utils/UpdateTestChecks/asm.py @@ -15,7 +15,7 @@ else: ##### Assembly parser ASM_FUNCTION_X86_RE = re.compile( - r'^_?(?P[^:]+):[ \t]*#+[ \t]*@(?P=func)\n(?:\s*\.?Lfunc_begin[^:\n]*:\n)?[^:]*?' + r'^_?(?P[^:]+):[ \t]*#+[ \t]*@"?(?P=func)"?\n(?:\s*\.?Lfunc_begin[^:\n]*:\n)?[^:]*?' r'(?P^##?[ \t]+[^:]+:.*?)\s*' r'^\s*(?:[^:\n]+?:\s*\n\s*\.size|\.cfi_endproc|\.globl|\.comm|\.(?:sub)?section|#+ -- End function)', flags=(re.M | re.S)) @@ -28,7 +28,7 @@ ASM_FUNCTION_ARM_RE = re.compile( flags=(re.M | re.S)) ASM_FUNCTION_AARCH64_RE = re.compile( - r'^_?(?P[^:]+):[ \t]*\/\/[ \t]*@(?P=func)\n' + r'^_?(?P[^:]+):[ \t]*\/\/[ \t]*@"?(?P=func)"?\n' r'(?:[ \t]+.cfi_startproc\n)?' # drop optional cfi noise r'(?P.*?)\n' # This list is incomplete @@ -36,21 +36,21 @@ ASM_FUNCTION_AARCH64_RE = re.compile( flags=(re.M | re.S)) ASM_FUNCTION_AMDGPU_RE = re.compile( - r'^_?(?P[^:]+):[ \t]*;+[ \t]*@(?P=func)\n[^:]*?' + r'^_?(?P[^:]+):[ \t]*;+[ \t]*@"?(?P=func)"?\n[^:]*?' r'(?P.*?)\n' # (body of the function) # This list is incomplete r'^\s*(\.Lfunc_end[0-9]+:\n|\.section)', flags=(re.M | re.S)) ASM_FUNCTION_HEXAGON_RE = re.compile( - r'^_?(?P[^:]+):[ \t]*//[ \t]*@(?P=func)\n[^:]*?' + r'^_?(?P[^:]+):[ \t]*//[ \t]*@"?(?P=func)"?\n[^:]*?' r'(?P.*?)\n' # (body of the function) # This list is incomplete r'.Lfunc_end[0-9]+:\n', flags=(re.M | re.S)) ASM_FUNCTION_MIPS_RE = re.compile( - r'^_?(?P[^:]+):[ \t]*#+[ \t]*@(?P=func)\n[^:]*?' # f: (name of func) + r'^_?(?P[^:]+):[ \t]*#+[ \t]*@"?(?P=func)"?\n[^:]*?' # f: (name of func) r'(?:^[ \t]+\.(frame|f?mask|set).*?\n)+' # Mips+LLVM standard asm prologue r'(?P.*?)\n' # (body of the function) # Mips+LLVM standard asm epilogue @@ -60,13 +60,13 @@ ASM_FUNCTION_MIPS_RE = re.compile( flags=(re.M | re.S)) ASM_FUNCTION_MSP430_RE = re.compile( - r'^_?(?P[^:]+):[ \t]*;+[ \t]*@(?P=func)\n[^:]*?' + r'^_?(?P[^:]+):[ \t]*;+[ \t]*@"?(?P=func)"?\n[^:]*?' r'(?P.*?)\n' r'(\$|\.L)func_end[0-9]+:\n', # $func_end0: flags=(re.M | re.S)) ASM_FUNCTION_PPC_RE = re.compile( - r'^_?(?P[^:]+):[ \t]*#+[ \t]*@(?P=func)\n' + r'^_?(?P[^:]+):[ \t]*#+[ \t]*@"?(?P=func)"?\n' r'.*?' r'\.Lfunc_begin[0-9]+:\n' r'(?:[ \t]+.cfi_startproc\n)?' @@ -78,7 +78,7 @@ ASM_FUNCTION_PPC_RE = re.compile( flags=(re.M | re.S)) ASM_FUNCTION_RISCV_RE = re.compile( - r'^_?(?P[^:]+):[ \t]*#+[ \t]*@(?P=func)\n' + r'^_?(?P[^:]+):[ \t]*#+[ \t]*@"?(?P=func)"?\n' r'(?:\s*\.?L(?P=func)\$local:\n)?' # optional .L$local: due to -fno-semantic-interposition r'(?:\s*\.?Lfunc_begin[^:\n]*:\n)?[^:]*?' r'(?P^##?[ \t]+[^:]+:.*?)\s*' @@ -86,27 +86,27 @@ ASM_FUNCTION_RISCV_RE = re.compile( flags=(re.M | re.S)) ASM_FUNCTION_LANAI_RE = re.compile( - r'^_?(?P[^:]+):[ \t]*!+[ \t]*@(?P=func)\n' + r'^_?(?P[^:]+):[ \t]*!+[ \t]*@"?(?P=func)"?\n' r'(?:[ \t]+.cfi_startproc\n)?' # drop optional cfi noise r'(?P.*?)\s*' r'.Lfunc_end[0-9]+:\n', flags=(re.M | re.S)) ASM_FUNCTION_SPARC_RE = re.compile( - r'^_?(?P[^:]+):[ \t]*!+[ \t]*@(?P=func)\n' + r'^_?(?P[^:]+):[ \t]*!+[ \t]*@"?(?P=func)"?\n' r'(?P.*?)\s*' r'.Lfunc_end[0-9]+:\n', flags=(re.M | re.S)) ASM_FUNCTION_SYSTEMZ_RE = re.compile( - r'^_?(?P[^:]+):[ \t]*#+[ \t]*@(?P=func)\n' + r'^_?(?P[^:]+):[ \t]*#+[ \t]*@"?(?P=func)"?\n' r'[ \t]+.cfi_startproc\n' r'(?P.*?)\n' r'.Lfunc_end[0-9]+:\n', flags=(re.M | re.S)) ASM_FUNCTION_AARCH64_DARWIN_RE = re.compile( - r'^_(?P[^:]+):[ \t]*;[ \t]@(?P=func)\n' + r'^_(?P[^:]+):[ \t]*;[ \t]@"?(?P=func)"?\n' r'([ \t]*.cfi_startproc\n[\s]*)?' r'(?P.*?)' r'([ \t]*.cfi_endproc\n[\s]*)?' @@ -114,7 +114,7 @@ ASM_FUNCTION_AARCH64_DARWIN_RE = re.compile( flags=(re.M | re.S)) ASM_FUNCTION_ARM_DARWIN_RE = re.compile( - r'^[ \t]*\.globl[ \t]*_(?P[^ \t])[ \t]*@[ \t]--[ \t]Begin[ \t]function[ \t](?P=func)' + r'^[ \t]*\.globl[ \t]*_(?P[^ \t])[ \t]*@[ \t]--[ \t]Begin[ \t]function[ \t]"?(?P=func)"?' r'(?P.*?)' r'^_(?P=func):\n[ \t]*' r'(?P.*?)' @@ -137,7 +137,7 @@ ASM_FUNCTION_ARM_IOS_RE = re.compile( flags=(re.M | re.S)) ASM_FUNCTION_WASM32_RE = re.compile( - r'^_?(?P[^:]+):[ \t]*#+[ \t]*@(?P=func)\n' + r'^_?(?P[^:]+):[ \t]*#+[ \t]*@"?(?P=func)"?\n' r'(?P.*?)\n' r'^\s*(\.Lfunc_end[0-9]+:\n|end_function)', flags=(re.M | re.S)) diff --git a/llvm/utils/UpdateTestChecks/common.py b/llvm/utils/UpdateTestChecks/common.py index a1759b4..d49fe50 100644 --- a/llvm/utils/UpdateTestChecks/common.py +++ b/llvm/utils/UpdateTestChecks/common.py @@ -145,16 +145,16 @@ UTC_ARGS_CMD = re.compile(r'.*' + UTC_ARGS_KEY + '\s*(?P.*)\s*$') UTC_ADVERT = 'NOTE: Assertions have been autogenerated by ' OPT_FUNCTION_RE = re.compile( - r'^(\s*;\s*Function\sAttrs:\s(?P[\w\s]+?))?\s*define\s+(?:internal\s+)?[^@]*@(?P[\w.-]+?)\s*' + r'^(\s*;\s*Function\sAttrs:\s(?P[\w\s]+?))?\s*define\s+(?:internal\s+)?[^@]*@(?P[\w.$-]+?)\s*' r'(?P\((\)|(.*?[\w.-]+?)\))[^{]*\{)\n(?P.*?)^\}$', flags=(re.M | re.S)) ANALYZE_FUNCTION_RE = re.compile( - r'^\s*\'(?P[\w\s-]+?)\'\s+for\s+function\s+\'(?P[\w.-]+?)\':' + r'^\s*\'(?P[\w\s-]+?)\'\s+for\s+function\s+\'(?P[\w.$-]+?)\':' r'\s*\n(?P.*)$', flags=(re.X | re.S)) -IR_FUNCTION_RE = re.compile(r'^\s*define\s+(?:internal\s+)?[^@]*@([\w.-]+)\s*\(') +IR_FUNCTION_RE = re.compile(r'^\s*define\s+(?:internal\s+)?[^@]*@"?([\w.$-]+)"?\s*\(') TRIPLE_IR_RE = re.compile(r'^\s*target\s+triple\s*=\s*"([^"]+)"$') TRIPLE_ARG_RE = re.compile(r'-mtriple[= ]([^ ]+)') MARCH_ARG_RE = re.compile(r'-march[= ]([^ ]+)') -- 2.7.4