Home | History | Annotate | Download | only in PostDominators
      1 ; RUN: opt < %s -postdomtree -analyze | FileCheck %s
      2 ; RUN: opt < %s -passes='print<postdomtree>' 2>&1 | FileCheck %s
      3 
      4 @a = external global i32, align 4
      5 
      6 define void @fn1() {
      7 entry:
      8   store i32 5, i32* @a, align 4
      9   %call = call i32 (...) @foo()
     10   %tobool = icmp ne i32 %call, 0
     11   br i1 %tobool, label %if.then, label %if.end
     12 
     13 if.then:                                          ; preds = %entry
     14   br label %loop
     15 
     16 loop:                                             ; preds = %loop, %if.then
     17   %0 = load i32, i32* @a, align 4
     18   call void @bar(i32 %0)
     19   br label %loop
     20 
     21 if.end:                                           ; preds = %entry
     22   store i32 6, i32* @a, align 4
     23   ret void
     24 }
     25 
     26 declare i32 @foo(...)
     27 declare void @bar(i32)
     28 
     29 
     30 ; CHECK:      Inorder PostDominator Tree:
     31 ; CHECK-NEXT:  [1]  <<exit node>>
     32 ; CHECK:         [2] %loop
     33 ; CHECK-NEXT:      [3] %if.then
     34 ; CHECK: Roots: %if.end %loop
     35