37 lines · plain
1; RUN: llc -mtriple=bpfel -mcpu=v1 -filetype=obj -o - %s | llvm-objdump --no-print-imm-hex -d - | FileCheck %s2 3; Source Code:4; int test(int a, int b) {5; int s = 0;6; while (a < b) { s++; a += s; b -= s; }7; return s;8; }9 10define i32 @test(i32, i32) local_unnamed_addr #0 {11; CHECK-LABEL: <test>:12 %3 = icmp slt i32 %0, %113 br i1 %3, label %4, label %1314 15; <label>:4: ; preds = %216 br label %517; CHECK: if r4 s>= r3 goto +10 <test+0x90>18 19; <label>:5: ; preds = %4, %520 %6 = phi i32 [ %9, %5 ], [ 0, %4 ]21 %7 = phi i32 [ %11, %5 ], [ %1, %4 ]22 %8 = phi i32 [ %10, %5 ], [ %0, %4 ]23 %9 = add nuw nsw i32 %6, 124 %10 = add nsw i32 %9, %825 %11 = sub nsw i32 %7, %926 %12 = icmp slt i32 %10, %1127 br i1 %12, label %5, label %1328; CHECK: r1 = r329; CHECK: if r2 s> r3 goto -10 <test+0x40>30 31; <label>:13: ; preds = %5, %232 %14 = phi i32 [ 0, %2 ], [ %9, %5 ]33 ret i32 %1434; CHECK: exit35}36attributes #0 = { norecurse nounwind readnone }37