1 ; RUN: llc < %s -march=bpf -verify-machineinstrs | FileCheck %s
10 ; int xdp_dummy(struct xdp_md *xdp)
12 ; char addr = *(char *)(long)xdp->data;
18 ; } else if (addr == 0)
23 %struct.xdp_md = type { i32, i32 }
25 @gbl = common local_unnamed_addr global i32 0, align 4
27 ; Function Attrs: norecurse nounwind readonly
28 define i32 @xdp_dummy(ptr nocapture readonly %xdp) local_unnamed_addr #0 {
30 %0 = load i32, ptr %xdp, align 4
31 %conv = zext i32 %0 to i64
32 %1 = inttoptr i64 %conv to ptr
33 %2 = load i8, ptr %1, align 1
34 ; CHECK: r1 = *(u32 *)(r1 + 0)
35 ; CHECK: r1 = *(u8 *)(r1 + 0)
36 %3 = load i32, ptr @gbl, align 4
37 switch i32 %3, label %if.end [
42 if.end: ; preds = %entry
43 %cmp4 = icmp eq i8 %2, 1
45 ; CHECK-NOT: r1 &= 255
46 ; CHECK: if r1 == 1 goto
47 br i1 %cmp4, label %cleanup, label %if.end13
49 if.else: ; preds = %entry
50 %cmp9 = icmp eq i8 %2, 0
52 ; CHECK-NOT: r1 &= 255
53 ; CHECK: if r1 == 0 goto
54 br i1 %cmp9, label %cleanup, label %if.end13
56 if.end13: ; preds = %if.else, %if.end
59 cleanup: ; preds = %if.else, %if.end, %entry, %if.end13
60 %retval.0 = phi i32 [ 0, %if.end13 ], [ 1, %entry ], [ 3, %if.end ], [ 2, %if.else ]
64 attributes #0 = { norecurse nounwind readonly }