1 ; RUN: opt < %s -indvars -S | FileCheck %s
2 target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
13 ; CHECK: %[[INDVAR:.*]] = phi i64
14 ; CHECK: %[[TRUNC:.*]] = trunc i64 %[[INDVAR]] to i32
16 %i = phi i32 [ 0, %L1_header ], [ %i_next, %L2_latch ]
17 %i_prom = sext i32 %i to i64
21 br i1 undef, label %L3_latch, label %L2_exiting_1
24 br i1 undef, label %L3_header, label %L2_exiting_2
27 br i1 undef, label %L2_latch, label %L1_latch
30 br i1 undef, label %L2_latch, label %L1_latch
33 %i_next = add nsw i32 %i, 1
38 ; CHECK: %i_lcssa = phi i32 [ %[[TRUNC]], %L2_exiting_1 ], [ %[[TRUNC]], %L2_exiting_2 ]
40 %i_lcssa = phi i32 [ %i, %L2_exiting_1 ], [ %i, %L2_exiting_2 ]
41 br i1 undef, label %exit, label %L1_header