xref: /llvm-project/llvm/test/CodeGen/X86/ubsantrap.ll (revision ff0122dccea88844bcdb669a4249923c7019046c)
1; RUN: llc -mtriple=x86_64-linux-gnu %s -o - | FileCheck %s
2; RUN: llc -mtriple=x86_64-scei-ps4 %s -o - | FileCheck --check-prefix=PS4 %s
3; RUN: llc -mtriple=x86_64-sie-ps5  %s -o - | FileCheck --check-prefix=PS4 %s
4
5define void @test_ubsantrap() {
6; CHECK-LABEL: test_ubsantrap
7; CHECK: ud1l 12(%eax), %eax
8; PS4-LABEL: test_ubsantrap
9; PS4-NOT:   ud1
10; PS4:       ud2
11  call void @llvm.ubsantrap(i8 12)
12  ret void
13}
14
15define void @test_ubsantrap_function() {
16; CHECK-LABEL: test_ubsantrap_function:
17; CHECK: movl $12, %edi
18; CHECK: callq wibble
19  call void @llvm.ubsantrap(i8 12) "trap-func-name"="wibble"
20  ret void
21}
22
23declare void @llvm.ubsantrap(i8)
24