Home | History | Annotate | Download | only in SimplifyCFG
      1 ; RUN: opt < %s -simplifycfg -S | FileCheck %s
      2 
      3 ;; Test case for bug 25299, contributed by David Majnemer.
      4 
      5 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
      6 target triple = "x86_64-unknown-linux-gnu"
      7 
      8 define void @f(i1 %B) personality i1 undef {
      9 entry:
     10 ;CHECK: entry
     11 ;CHECK-NEXT: call void @g()
     12   invoke void @g()
     13           to label %continue unwind label %unwind
     14 
     15 unwind:                                           ; preds = %entry
     16   %tmp101 = landingpad { i8*, i32 }
     17           cleanup
     18   br i1 %B, label %resume, label %then
     19 
     20 then:                                             ; preds = %cleanup1
     21   br label %resume
     22 
     23 resume:                                           ; preds = %cleanup2, %then, %cleanup1, %unwind
     24   %tmp104 = phi { i8*, i32 } [ %tmp101, %then ], [ %tmp106, %cleanup2 ], [ %tmp101, %unwind ]
     25 ;CHECK-NOT: resume { i8*, i32 } %tmp104
     26   resume { i8*, i32 } %tmp104
     27 
     28 continue:                                         ; preds = %entry, %continue
     29 ;CHECK: continue:                                         ; preds = %entry, %continue
     30 ;CHECK-NEXT: call void @g()
     31   invoke void @g()
     32           to label %continue unwind label %cleanup2
     33 
     34 cleanup2:                                         ; preds = %continue
     35   %tmp106 = landingpad { i8*, i32 }
     36           cleanup
     37   br label %resume
     38 }
     39 
     40 declare void @g()