1; RUN: llc < %s -march=bpfel | FileCheck -check-prefixes=CHECK %s 2 3; Source code: 4; struct test_t { 5; int a; 6; char b; 7; int c; 8; char d; 9; }; 10; void foo(void *); 11; void test() { 12; struct test_t t = {.a = 5}; 13; foo(&t); 14; } 15 16%struct.test_t = type { i32, i8, i32, i8 } 17 18@test.t = private unnamed_addr constant %struct.test_t { i32 5, i8 0, i32 0, i8 0 }, align 4 19 20; Function Attrs: nounwind 21define dso_local void @test() local_unnamed_addr #0 { 22; CHECK-LABEL: test: 23 %1 = alloca %struct.test_t, align 4 24 %2 = bitcast %struct.test_t* %1 to i8* 25 call void @llvm.lifetime.start.p0i8(i64 16, i8* nonnull %2) #3 26 call void @llvm.memcpy.p0i8.p0i8.i64(i8* nonnull align 4 %2, i8* align 4 bitcast (%struct.test_t* @test.t to i8*), i64 16, i1 false) 27; CHECK: r1 = 0 28; CHECK: r1 <<= 32 29; CHECK: r2 = r1 30; CHECK: r2 |= 0 31; CHECK: *(u64 *)(r10 - 8) = r2 32; CHECK: r1 |= 5 33; CHECK: *(u64 *)(r10 - 16) = r1 34 call void @foo(i8* nonnull %2) #3 35; CHECK: call foo 36 call void @llvm.lifetime.end.p0i8(i64 16, i8* nonnull %2) #3 37 ret void 38} 39 40; Function Attrs: argmemonly nounwind 41declare void @llvm.lifetime.start.p0i8(i64, i8* nocapture) #1 42 43; Function Attrs: argmemonly nounwind 44declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture writeonly, i8* nocapture readonly, i64, i1) #1 45 46declare dso_local void @foo(i8*) local_unnamed_addr 47 48; Function Attrs: argmemonly nounwind 49declare void @llvm.lifetime.end.p0i8(i64, i8* nocapture) #1 50 51attributes #0 = { nounwind } 52attributes #1 = { argmemonly nounwind } 53attributes #3 = { nounwind } 54