Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / CodeGen / bpf-struct-argument.c
blobd4fcf16af2e2882560d5613ac0a4221a2bb143cd
1 // REQUIRES: bpf-registered-target
2 // RUN: %clang_cc1 -triple bpf -O2 -emit-llvm -disable-llvm-passes %s -o - | FileCheck %s
4 struct t1 {};
5 struct t2 {
6 int a;
7 };
8 struct t3 {
9 int a;
10 long b;
12 struct t4 {
13 long a;
14 long b;
15 long c;
18 int foo1(struct t1 arg1, struct t2 arg2) {
19 // CHECK: define dso_local i32 @foo1(i32 %arg2.coerce)
20 return arg2.a;
23 int foo2(struct t3 arg1, struct t4 arg2) {
24 // CHECK: define dso_local i32 @foo2([2 x i64] %arg1.coerce, ptr noundef byval(%struct.t4) align 8 %arg2)
25 return arg1.a + arg2.a;
28 int foo3(void) {
29 struct t1 tmp1 = {};
30 struct t2 tmp2 = {};
31 struct t3 tmp3 = {};
32 struct t4 tmp4 = {};
33 return foo1(tmp1, tmp2) + foo2(tmp3, tmp4);
34 // CHECK: call i32 @foo1(i32 %{{[a-zA-Z0-9]+}})
35 // CHECK: call i32 @foo2([2 x i64] %{{[a-zA-Z0-9]+}}, ptr noundef byval(%struct.t4) align 8 %tmp4)