Home | History | Annotate | Download | only in Inline
      1 ; Test that we can inline a simple function, turning the calls in it into invoke
      2 ; instructions
      3 
      4 ; RUN: opt < %s -inline -S | \
      5 ; RUN:   not grep "call[^e]"
      6 
      7 declare void @might_throw()
      8 
      9 define internal void @callee() {
     10         call void @might_throw( )
     11         ret void
     12 }
     13 
     14 ; caller returns true if might_throw throws an exception...
     15 define i32 @caller() {
     16         invoke void @callee( )
     17                         to label %cont unwind label %exc
     18 
     19 cont:           ; preds = %0
     20         ret i32 0
     21 
     22 exc:            ; preds = %0
     23         %exn = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
     24                  cleanup
     25         ret i32 1
     26 }
     27 
     28 declare i32 @__gxx_personality_v0(...)
     29