1 ; RUN: llc < %s -march=bpf -verify-machineinstrs | FileCheck %s
7 ; int exec_prog(struct loc_prog *prog) {
8 ; if (prog->ip < prog->len) {
16 ; clang -target bpf -O2 -S -emit-llvm t.c
18 %struct.loc_prog = type { i32, i32 }
20 ; Function Attrs: nofree norecurse nounwind willreturn
21 define dso_local i32 @exec_prog(ptr nocapture %prog) local_unnamed_addr {
23 %0 = load i32, ptr %prog, align 4
24 %len = getelementptr inbounds %struct.loc_prog, ptr %prog, i64 0, i32 1
25 %1 = load i32, ptr %len, align 4
26 %cmp = icmp ult i32 %0, %1
27 %cmp2 = icmp slt i32 %0, 3
28 %or.cond = and i1 %cmp2, %cmp
29 ; CHECK: r{{[0-9]+}} <<= 32
30 ; CHECK: r{{[0-9]+}} s>>= 32
31 br i1 %or.cond, label %if.then3, label %if.end5
33 if.then3: ; preds = %entry
34 %add = add nsw i32 %0, 2
35 store i32 %add, ptr %prog, align 4
38 if.end5: ; preds = %if.then3, %entry