Home | History | Annotate | Download | only in Verifier
      1 ; RUN: not opt -verify < %s 2>&1 | FileCheck %s
      2 
      3 declare i8 @llvm.experimental.deoptimize.i8(...)
      4 declare void @llvm.experimental.deoptimize.isVoid(...)
      5 declare cc40 void @llvm.experimental.deoptimize.double(...)
      6 
      7 declare void @unknown()
      8 
      9 define void @f_notail() {
     10 entry:
     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 
     17 define void @f_nodeopt() {
     18 entry:
     19   call void(...) @llvm.experimental.deoptimize.isVoid()
     20 ; CHECK: experimental_deoptimize must have exactly one "deopt" operand bundle
     21   ret void
     22 }
     23 
     24 define void @f_invoke() personality i8 3 {
     25 entry:
     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 
     29 ok:
     30   ret void
     31 
     32 not_ok:
     33   %0 = landingpad { i8*, i32 }
     34           filter [0 x i8*] zeroinitializer
     35   ret void
     36 }
     37 
     38 define i8 @f_incorrect_return() {
     39 entry:
     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