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(%struct.loc_prog* nocapture %prog) local_unnamed_addr {
23 %ip = getelementptr inbounds %struct.loc_prog, %struct.loc_prog* %prog, i64 0, i32 0
24 %0 = load i32, i32* %ip, align 4
25 %len = getelementptr inbounds %struct.loc_prog, %struct.loc_prog* %prog, i64 0, i32 1
26 %1 = load i32, i32* %len, align 4
27 %cmp = icmp ult i32 %0, %1
28 %cmp2 = icmp slt i32 %0, 3
29 %or.cond = and i1 %cmp2, %cmp
30 ; CHECK: r{{[0-9]+}} <<= 32
31 ; CHECK: r{{[0-9]+}} s>>= 32
32 br i1 %or.cond, label %if.then3, label %if.end5
34 if.then3: ; preds = %entry
35 %add = add nsw i32 %0, 2
36 store i32 %add, i32* %ip, align 4
39 if.end5: ; preds = %if.then3, %entry