1 ; Diff file with itself, assert no difference by return code
4 ; Replace %newvar1 with %newvar2 in the phi node. This can only
5 ; be detected to be different once BB1 has been processed.
7 ; RUN: cat %s | sed -e 's/ %newvar1, %BB1 / %newvar2, %BB1 /' > %t.ll
8 ; RUN: not llvm-diff %s %t.ll 2>&1 | FileCheck --check-prefix DIFFERENT-VAR %s
10 ; DIFFERENT-VAR: in function func:
11 ; DIFFERENT-VAR-NEXT: in block %BB0:
12 ; DIFFERENT-VAR-NEXT: > %var = phi i32 [ 0, %ENTRY ], [ %newvar2, %BB1 ]
13 ; DIFFERENT-VAR-NEXT: < %var = phi i32 [ 0, %ENTRY ], [ %newvar1, %BB1 ]
19 ; When diffing this phi node, we need to detect whether
20 ; %newvar1 is equivalent, which is not known until BB1 has been processed.
21 %var = phi i32 [ 0, %ENTRY ], [ %newvar1, %BB1 ]
22 %cnd = icmp eq i32 %var, 0
23 br i1 %cnd, label %BB1, label %END
26 %newvar1 = add i32 %var, 1
27 %newvar2 = add i32 %var, 2
31 ; Equivalence of the ret depends on equivalence of %var.
32 ; Even if %var differs, we do not report a diff here, because
33 ; this is an indirect diff caused by another diff.