Skip to content

[Triple][CodeGen] Fix Triple::isTargetEHABICompatible() for NetBSD #143549

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion llvm/include/llvm/TargetParser/Triple.h
Original file line number Diff line number Diff line change
Expand Up @@ -914,7 +914,7 @@ class Triple {
getEnvironment() == Triple::GNUEABIHFT64 ||
getEnvironment() == Triple::OpenHOS ||
getEnvironment() == Triple::MuslEABIHF || isAndroid()) &&
isOSBinFormatELF();
isOSBinFormatELF() && !isOSNetBSD();
}

// ARM EABI is the bare-metal EABI described in ARM ABI documents and
Expand Down
3 changes: 3 additions & 0 deletions llvm/test/CodeGen/ARM/eh-resume.ll
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
; RUN: llc < %s -mtriple=armv7k-apple-watchos -arm-atomic-cfg-tidy=0 | FileCheck %s -check-prefix=WATCHABI
; RUN: llc < %s -mtriple=armv7-none-gnueabihf -arm-atomic-cfg-tidy=0 | FileCheck %s -check-prefix=EABI
; RUN: llc < %s -mtriple=armv7-none-none -arm-atomic-cfg-tidy=0 | FileCheck %s -check-prefix=ABI
; RUN: llc < %s -mtriple=armv7-netbsd-none -arm-atomic-cfg-tidy=0 | FileCheck %s -check-prefix=NETBSD
; RUN: llc < %s -mtriple=armv7-netbsd-eabihf -arm-atomic-cfg-tidy=0 | FileCheck %s -check-prefix=NETBSD

declare void @func()

Expand All @@ -27,3 +29,4 @@ lpad:
; WATCHABI: __Unwind_Resume
; EABI: __cxa_end_cleanup
; ABI: _Unwind_Resume
; NETBSD: _Unwind_Resume
29 changes: 16 additions & 13 deletions llvm/test/CodeGen/ARM/ehabi.ll
Original file line number Diff line number Diff line change
Expand Up @@ -258,31 +258,34 @@ declare void @_ZSt9terminatev()
; DWARF-V7-FP: .cfi_startproc
; DWARF-V7-FP: .cfi_personality 0, __gxx_personality_v0
; DWARF-V7-FP: .cfi_lsda 0, .Lexception0
; DWARF-V7-FP: push {r11, lr}
; DWARF-V7-FP: .cfi_def_cfa_offset 8
; DWARF-V7-FP: push {r4, r10, r11, lr}
; DWARF-V7-FP: .cfi_def_cfa_offset 16
; DWARF-V7-FP: .cfi_offset lr, -4
; DWARF-V7-FP: .cfi_offset r11, -8
; DWARF-V7-FP: mov r11, sp
; DWARF-V7-FP: .cfi_def_cfa_register r11
; DWARF-V7-FP: .cfi_offset r10, -12
; DWARF-V7-FP: .cfi_offset r4, -16
; DWARF-V7-FP: add r11, sp, #8
; DWARF-V7-FP: .cfi_def_cfa r11, 8
; DWARF-V7-FP: vpush {d8, d9, d10, d11, d12}
; DWARF-V7-FP: .cfi_offset d12, -16
; DWARF-V7-FP: .cfi_offset d11, -24
; DWARF-V7-FP: .cfi_offset d10, -32
; DWARF-V7-FP: .cfi_offset d9, -40
; DWARF-V7-FP: .cfi_offset d12, -24
; DWARF-V7-FP: .cfi_offset d11, -32
; DWARF-V7-FP: .cfi_offset d10, -40
; DWARF-V7-FP: .cfi_offset d9, -48
; DWARF-V7-FP: .cfi_offset d8, -56
; DWARF-V7-FP: sub sp, sp, #24
; DWARF-V7-FP: sub sp, r11, #40
; DWARF-V7-FP: sub sp, r11, #48
; DWARF-V7-FP: vpop {d8, d9, d10, d11, d12}
; DWARF-V7-FP: pop {r11, pc}
; DWARF-V7-FP: pop {r4, r10, r11, pc}
; DWARF-V7-FP: .cfi_endproc

; DWARF-V7-FP-ELIM-LABEL: _Z4testiiiiiddddd:
; DWARF-V7-FP-ELIM: .cfi_startproc
; DWARF-V7-FP-ELIM: .cfi_personality 0, __gxx_personality_v0
; DWARF-V7-FP-ELIM: .cfi_lsda 0, .Lexception0
; DWARF-V7-FP-ELIM: push {r11, lr}
; DWARF-V7-FP-ELIM: push {r4, lr}
; DWARF-V7-FP-ELIM: .cfi_def_cfa_offset 8
; DWARF-V7-FP-ELIM: .cfi_offset lr, -4
; DWARF-V7-FP-ELIM: .cfi_offset r11, -8
; DWARF-V7-FP-ELIM: .cfi_offset r4, -8
; DWARF-V7-FP-ELIM: vpush {d8, d9, d10, d11, d12}
; DWARF-V7-FP-ELIM: .cfi_offset d12, -16
; DWARF-V7-FP-ELIM: .cfi_offset d11, -24
Expand All @@ -292,7 +295,7 @@ declare void @_ZSt9terminatev()
; DWARF-V7-FP-ELIM: .cfi_def_cfa_offset 72
; DWARF-V7-FP-ELIM: add sp, sp, #24
; DWARF-V7-FP-ELIM: vpop {d8, d9, d10, d11, d12}
; DWARF-V7-FP-ELIM: pop {r11, pc}
; DWARF-V7-FP-ELIM: pop {r4, pc}
; DWARF-V7-FP-ELIM: .cfi_endproc

; DWARF-WIN-FP-ELIM-LABEL: _Z4testiiiiiddddd:
Expand Down
Loading