1; RUN: llc -march=bpf < %s | FileCheck %s
2;
3; Source code:
4;   struct t1 { int a; };
5;   struct t1 data = { .a = 3 };
6;   int foo(void) {
7;     return data.a + 20;
8;   }
9; Compilation flag:
10;   clang -target bpf -O2 -S -emit-llvm test.c
11
12%struct.t1 = type { i32 }
13
14@data = dso_local local_unnamed_addr global %struct.t1 { i32 3 }, align 4
15
16; Function Attrs: norecurse nounwind readonly
17define dso_local i32 @foo() local_unnamed_addr {
18entry:
19  %0 = load i32, i32* getelementptr inbounds (%struct.t1, %struct.t1* @data, i64 0, i32 0), align 4
20  %add = add nsw i32 %0, 20
21; CHECK:   [[REG1:r[0-9]+]] = data ll
22; CHECK:   r0 = *(u32 *)([[REG1]] + 0)
23; CHECK:   r0 += 20
24  ret i32 %add
25}
26