Files
clang-p2996/llvm/test/CodeGen/AArch64/ubsantrap.ll
Amara Emerson f9d69a0ab0 [GlobalISel] Implement support for the "trap-func-name" attribute.
This attribute calls a function instead of emitting a trap instruction.

Differential Revision: https://reviews.llvm.org/D110098
2021-09-20 14:32:01 -07:00

20 lines
494 B
LLVM

; RUN: llc -mtriple=arm64-apple-ios %s -o - | FileCheck %s
; RUN: llc -mtriple=arm64-apple-ios -global-isel %s -o - | FileCheck %s
define void @test_ubsantrap() {
; CHECK-LABEL: test_ubsantrap
; CHECK: brk #0x550c
call void @llvm.ubsantrap(i8 12)
ret void
}
define void @test_ubsantrap_function() {
; CHECK-LABEL: test_ubsantrap_function:
; CHECK: mov w0, #12
; CHECK: bl _wibble
call void @llvm.ubsantrap(i8 12) "trap-func-name"="wibble"
ret void
}
declare void @llvm.ubsantrap(i8)