xref: /llvm-project/llvm/test/CodeGen/X86/allow-check.ll (revision 20f56e1f8e51d672425ec0c8f2ec243b131e8296)
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 4
2; RUN: llc < %s -mtriple=x86_64 -global-isel=0 -fast-isel=0 | FileCheck %s
3; RUN: llc < %s -mtriple=x86_64 -global-isel=1 -fast-isel=0 | FileCheck %s
4; RUN: llc < %s -mtriple=x86_64 -global-isel=0 -fast-isel=1 | FileCheck %s
5
6define i1 @test_runtime() local_unnamed_addr {
7; CHECK-LABEL: test_runtime:
8; CHECK:       # %bb.0: # %entry
9; CHECK-NEXT:    movb $1, %al
10; CHECK-NEXT:    retq
11entry:
12  %allow = call i1 @llvm.allow.runtime.check(metadata !"test_check")
13  ret i1 %allow
14}
15
16declare i1 @llvm.allow.runtime.check(metadata) nounwind
17
18define i1 @test_ubsan() local_unnamed_addr {
19; CHECK-LABEL: test_ubsan:
20; CHECK:       # %bb.0: # %entry
21; CHECK-NEXT:    movb $1, %al
22; CHECK-NEXT:    retq
23entry:
24  %allow = call i1 @llvm.allow.ubsan.check(i8 7)
25  ret i1 %allow
26}
27
28declare i1 @llvm.allow.ubsan.check(i8) nounwind
29