Home | History | Annotate | Download | only in GlobalOpt
      1 ; RUN: opt -S -globalopt < %s | FileCheck %s
      2 ; rdar://11022897
      3 
      4 ; Globalopt should be able to evaluate an invoke.
      5 ; CHECK: @tmp = global i32 1
      6 
      7 @llvm.global_ctors = appending global [1 x { i32, void ()* }] [{ i32, void ()* } { i32 65535, void ()* @_GLOBAL__I_a }]
      8 @tmp = global i32 0
      9 
     10 define i32 @one() {
     11   ret i32 1
     12 }
     13 
     14 define void @_GLOBAL__I_a() {
     15 bb:
     16   %tmp1 = invoke i32 @one()
     17           to label %bb2 unwind label %bb4
     18 
     19 bb2:                                              ; preds = %bb
     20   store i32 %tmp1, i32* @tmp
     21   ret void
     22 
     23 bb4:                                              ; preds = %bb
     24   %tmp5 = landingpad { i8*, i32 } personality i8* undef
     25           filter [0 x i8*] zeroinitializer
     26   unreachable
     27 }
     28