• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: not opt -verify < %s 2>&1 | FileCheck %s
2
3declare i8 @llvm.experimental.deoptimize.i8(...)
4declare void @llvm.experimental.deoptimize.isVoid(...)
5declare cc40 void @llvm.experimental.deoptimize.double(...)
6
7declare void @unknown()
8
9define void @f_notail() {
10entry:
11  call void(...) @llvm.experimental.deoptimize.isVoid(i32 0) [ "deopt"() ]
12; CHECK: calls to experimental_deoptimize must be followed by a return
13  call void @unknown()
14  ret void
15}
16
17define void @f_nodeopt() {
18entry:
19  call void(...) @llvm.experimental.deoptimize.isVoid()
20; CHECK: experimental_deoptimize must have exactly one "deopt" operand bundle
21  ret void
22}
23
24define void @f_invoke() personality i8 3 {
25entry:
26  invoke void(...) @llvm.experimental.deoptimize.isVoid(i32 0, float 0.0) to label %ok unwind label %not_ok
27; CHECK: experimental_deoptimize cannot be invoked
28
29ok:
30  ret void
31
32not_ok:
33  %0 = landingpad { i8*, i32 }
34          filter [0 x i8*] zeroinitializer
35  ret void
36}
37
38define i8 @f_incorrect_return() {
39entry:
40  %val = call i8(...) @llvm.experimental.deoptimize.i8() [ "deopt"() ]
41; CHECK: calls to experimental_deoptimize must be followed by a return of the value computed by experimental_deoptimize
42  ret i8 0
43}
44
45; CHECK: All llvm.experimental.deoptimize declarations must have the same calling convention
46