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