Skip to content

Commit

Permalink
Checking bpf2c generated files using Clang 18.1.8 (#4038)
Browse files Browse the repository at this point in the history
Signed-off-by: Alan Jowett <[email protected]>
Co-authored-by: Alan Jowett <[email protected]>
  • Loading branch information
Alan-Jowett and Alan Jowett authored Nov 23, 2024
1 parent 06f9b48 commit c514000
Show file tree
Hide file tree
Showing 45 changed files with 3,819 additions and 3,906 deletions.
222 changes: 105 additions & 117 deletions tests/bpf2c_tests/expected/bindmonitor_dll.c

Large diffs are not rendered by default.

222 changes: 105 additions & 117 deletions tests/bpf2c_tests/expected/bindmonitor_raw.c

Large diffs are not rendered by default.

222 changes: 105 additions & 117 deletions tests/bpf2c_tests/expected/bindmonitor_sys.c

Large diffs are not rendered by default.

206 changes: 99 additions & 107 deletions tests/bpf2c_tests/expected/bindmonitor_tailcall_dll.c

Large diffs are not rendered by default.

206 changes: 99 additions & 107 deletions tests/bpf2c_tests/expected/bindmonitor_tailcall_raw.c

Large diffs are not rendered by default.

206 changes: 99 additions & 107 deletions tests/bpf2c_tests/expected/bindmonitor_tailcall_sys.c

Large diffs are not rendered by default.

47 changes: 20 additions & 27 deletions tests/bpf2c_tests/expected/cgroup_count_connect4_dll.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,6 @@ count_tcp_connect4(void* context)
register uint64_t r4 = 0;
#line 31 "sample/cgroup_count_connect4.c"
register uint64_t r5 = 0;
#line 31 "sample/cgroup_count_connect4.c"
register uint64_t r6 = 0;
#line 31 "sample/cgroup_count_connect4.c"
register uint64_t r10 = 0;

Expand All @@ -107,27 +105,27 @@ count_tcp_connect4(void* context)
#line 31 "sample/cgroup_count_connect4.c"
r10 = (uintptr_t)((uint8_t*)stack + sizeof(stack));

// EBPF_OP_MOV64_IMM pc=0 dst=r6 src=r0 offset=0 imm=1
// EBPF_OP_MOV64_IMM pc=0 dst=r0 src=r0 offset=0 imm=1
#line 31 "sample/cgroup_count_connect4.c"
r6 = IMMEDIATE(1);
r0 = IMMEDIATE(1);
// EBPF_OP_LDXW pc=1 dst=r2 src=r1 offset=44 imm=0
#line 34 "sample/cgroup_count_connect4.c"
r2 = *(uint32_t*)(uintptr_t)(r1 + OFFSET(44));
// EBPF_OP_JNE_IMM pc=2 dst=r2 src=r0 offset=26 imm=6
// EBPF_OP_JNE_IMM pc=2 dst=r2 src=r0 offset=25 imm=6
#line 34 "sample/cgroup_count_connect4.c"
if (r2 != IMMEDIATE(6)) {
#line 34 "sample/cgroup_count_connect4.c"
goto label_2;
goto label_3;
#line 34 "sample/cgroup_count_connect4.c"
}
// EBPF_OP_LDXH pc=3 dst=r1 src=r1 offset=40 imm=0
#line 40 "sample/cgroup_count_connect4.c"
r1 = *(uint16_t*)(uintptr_t)(r1 + OFFSET(40));
// EBPF_OP_JNE_IMM pc=4 dst=r1 src=r0 offset=24 imm=7459
// EBPF_OP_JNE_IMM pc=4 dst=r1 src=r0 offset=23 imm=7459
#line 40 "sample/cgroup_count_connect4.c"
if (r1 != IMMEDIATE(7459)) {
#line 40 "sample/cgroup_count_connect4.c"
goto label_2;
goto label_3;
#line 40 "sample/cgroup_count_connect4.c"
}
// EBPF_OP_MOV64_IMM pc=5 dst=r1 src=r0 offset=0 imm=8989
Expand All @@ -154,7 +152,7 @@ count_tcp_connect4(void* context)
return 0;
#line 48 "sample/cgroup_count_connect4.c"
}
// EBPF_OP_JNE_IMM pc=12 dst=r0 src=r0 offset=12 imm=0
// EBPF_OP_JNE_IMM pc=12 dst=r0 src=r0 offset=11 imm=0
#line 49 "sample/cgroup_count_connect4.c"
if (r0 != IMMEDIATE(0)) {
#line 49 "sample/cgroup_count_connect4.c"
Expand All @@ -179,16 +177,13 @@ count_tcp_connect4(void* context)
// EBPF_OP_ADD64_IMM pc=18 dst=r3 src=r0 offset=0 imm=-16
#line 50 "sample/cgroup_count_connect4.c"
r3 += IMMEDIATE(-16);
// EBPF_OP_MOV64_IMM pc=19 dst=r6 src=r0 offset=0 imm=0
#line 50 "sample/cgroup_count_connect4.c"
r6 = IMMEDIATE(0);
// EBPF_OP_LDDW pc=20 dst=r1 src=r1 offset=0 imm=1
// EBPF_OP_LDDW pc=19 dst=r1 src=r1 offset=0 imm=1
#line 51 "sample/cgroup_count_connect4.c"
r1 = POINTER(_maps[0].address);
// EBPF_OP_MOV64_IMM pc=22 dst=r4 src=r0 offset=0 imm=0
// EBPF_OP_MOV64_IMM pc=21 dst=r4 src=r0 offset=0 imm=0
#line 51 "sample/cgroup_count_connect4.c"
r4 = IMMEDIATE(0);
// EBPF_OP_CALL pc=23 dst=r0 src=r0 offset=0 imm=2
// EBPF_OP_CALL pc=22 dst=r0 src=r0 offset=0 imm=2
#line 51 "sample/cgroup_count_connect4.c"
r0 = count_tcp_connect4_helpers[1].address(r1, r2, r3, r4, r5, context);
#line 51 "sample/cgroup_count_connect4.c"
Expand All @@ -197,27 +192,25 @@ count_tcp_connect4(void* context)
return 0;
#line 51 "sample/cgroup_count_connect4.c"
}
// EBPF_OP_JA pc=24 dst=r0 src=r0 offset=4 imm=0
// EBPF_OP_JA pc=23 dst=r0 src=r0 offset=3 imm=0
#line 51 "sample/cgroup_count_connect4.c"
goto label_2;
label_1:
// EBPF_OP_LDXDW pc=25 dst=r1 src=r0 offset=0 imm=0
// EBPF_OP_LDXDW pc=24 dst=r1 src=r0 offset=0 imm=0
#line 53 "sample/cgroup_count_connect4.c"
r1 = *(uint64_t*)(uintptr_t)(r0 + OFFSET(0));
// EBPF_OP_ADD64_IMM pc=26 dst=r1 src=r0 offset=0 imm=1
// EBPF_OP_ADD64_IMM pc=25 dst=r1 src=r0 offset=0 imm=1
#line 53 "sample/cgroup_count_connect4.c"
r1 += IMMEDIATE(1);
// EBPF_OP_STXDW pc=27 dst=r0 src=r1 offset=0 imm=0
// EBPF_OP_STXDW pc=26 dst=r0 src=r1 offset=0 imm=0
#line 53 "sample/cgroup_count_connect4.c"
*(uint64_t*)(uintptr_t)(r0 + OFFSET(0)) = (uint64_t)r1;
// EBPF_OP_MOV64_IMM pc=28 dst=r6 src=r0 offset=0 imm=0
#line 53 "sample/cgroup_count_connect4.c"
r6 = IMMEDIATE(0);
label_2:
// EBPF_OP_MOV64_REG pc=29 dst=r0 src=r6 offset=0 imm=0
#line 62 "sample/cgroup_count_connect4.c"
r0 = r6;
// EBPF_OP_EXIT pc=30 dst=r0 src=r0 offset=0 imm=0
// EBPF_OP_MOV64_IMM pc=27 dst=r0 src=r0 offset=0 imm=0
#line 53 "sample/cgroup_count_connect4.c"
r0 = IMMEDIATE(0);
label_3:
// EBPF_OP_EXIT pc=28 dst=r0 src=r0 offset=0 imm=0
#line 62 "sample/cgroup_count_connect4.c"
return r0;
#line 31 "sample/cgroup_count_connect4.c"
Expand All @@ -237,7 +230,7 @@ static program_entry_t _programs[] = {
1,
count_tcp_connect4_helpers,
2,
31,
29,
&count_tcp_connect4_program_type_guid,
&count_tcp_connect4_attach_type_guid,
},
Expand Down
47 changes: 20 additions & 27 deletions tests/bpf2c_tests/expected/cgroup_count_connect4_raw.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,6 @@ count_tcp_connect4(void* context)
register uint64_t r4 = 0;
#line 31 "sample/cgroup_count_connect4.c"
register uint64_t r5 = 0;
#line 31 "sample/cgroup_count_connect4.c"
register uint64_t r6 = 0;
#line 31 "sample/cgroup_count_connect4.c"
register uint64_t r10 = 0;

Expand All @@ -81,27 +79,27 @@ count_tcp_connect4(void* context)
#line 31 "sample/cgroup_count_connect4.c"
r10 = (uintptr_t)((uint8_t*)stack + sizeof(stack));

// EBPF_OP_MOV64_IMM pc=0 dst=r6 src=r0 offset=0 imm=1
// EBPF_OP_MOV64_IMM pc=0 dst=r0 src=r0 offset=0 imm=1
#line 31 "sample/cgroup_count_connect4.c"
r6 = IMMEDIATE(1);
r0 = IMMEDIATE(1);
// EBPF_OP_LDXW pc=1 dst=r2 src=r1 offset=44 imm=0
#line 34 "sample/cgroup_count_connect4.c"
r2 = *(uint32_t*)(uintptr_t)(r1 + OFFSET(44));
// EBPF_OP_JNE_IMM pc=2 dst=r2 src=r0 offset=26 imm=6
// EBPF_OP_JNE_IMM pc=2 dst=r2 src=r0 offset=25 imm=6
#line 34 "sample/cgroup_count_connect4.c"
if (r2 != IMMEDIATE(6)) {
#line 34 "sample/cgroup_count_connect4.c"
goto label_2;
goto label_3;
#line 34 "sample/cgroup_count_connect4.c"
}
// EBPF_OP_LDXH pc=3 dst=r1 src=r1 offset=40 imm=0
#line 40 "sample/cgroup_count_connect4.c"
r1 = *(uint16_t*)(uintptr_t)(r1 + OFFSET(40));
// EBPF_OP_JNE_IMM pc=4 dst=r1 src=r0 offset=24 imm=7459
// EBPF_OP_JNE_IMM pc=4 dst=r1 src=r0 offset=23 imm=7459
#line 40 "sample/cgroup_count_connect4.c"
if (r1 != IMMEDIATE(7459)) {
#line 40 "sample/cgroup_count_connect4.c"
goto label_2;
goto label_3;
#line 40 "sample/cgroup_count_connect4.c"
}
// EBPF_OP_MOV64_IMM pc=5 dst=r1 src=r0 offset=0 imm=8989
Expand All @@ -128,7 +126,7 @@ count_tcp_connect4(void* context)
return 0;
#line 48 "sample/cgroup_count_connect4.c"
}
// EBPF_OP_JNE_IMM pc=12 dst=r0 src=r0 offset=12 imm=0
// EBPF_OP_JNE_IMM pc=12 dst=r0 src=r0 offset=11 imm=0
#line 49 "sample/cgroup_count_connect4.c"
if (r0 != IMMEDIATE(0)) {
#line 49 "sample/cgroup_count_connect4.c"
Expand All @@ -153,16 +151,13 @@ count_tcp_connect4(void* context)
// EBPF_OP_ADD64_IMM pc=18 dst=r3 src=r0 offset=0 imm=-16
#line 50 "sample/cgroup_count_connect4.c"
r3 += IMMEDIATE(-16);
// EBPF_OP_MOV64_IMM pc=19 dst=r6 src=r0 offset=0 imm=0
#line 50 "sample/cgroup_count_connect4.c"
r6 = IMMEDIATE(0);
// EBPF_OP_LDDW pc=20 dst=r1 src=r1 offset=0 imm=1
// EBPF_OP_LDDW pc=19 dst=r1 src=r1 offset=0 imm=1
#line 51 "sample/cgroup_count_connect4.c"
r1 = POINTER(_maps[0].address);
// EBPF_OP_MOV64_IMM pc=22 dst=r4 src=r0 offset=0 imm=0
// EBPF_OP_MOV64_IMM pc=21 dst=r4 src=r0 offset=0 imm=0
#line 51 "sample/cgroup_count_connect4.c"
r4 = IMMEDIATE(0);
// EBPF_OP_CALL pc=23 dst=r0 src=r0 offset=0 imm=2
// EBPF_OP_CALL pc=22 dst=r0 src=r0 offset=0 imm=2
#line 51 "sample/cgroup_count_connect4.c"
r0 = count_tcp_connect4_helpers[1].address(r1, r2, r3, r4, r5, context);
#line 51 "sample/cgroup_count_connect4.c"
Expand All @@ -171,27 +166,25 @@ count_tcp_connect4(void* context)
return 0;
#line 51 "sample/cgroup_count_connect4.c"
}
// EBPF_OP_JA pc=24 dst=r0 src=r0 offset=4 imm=0
// EBPF_OP_JA pc=23 dst=r0 src=r0 offset=3 imm=0
#line 51 "sample/cgroup_count_connect4.c"
goto label_2;
label_1:
// EBPF_OP_LDXDW pc=25 dst=r1 src=r0 offset=0 imm=0
// EBPF_OP_LDXDW pc=24 dst=r1 src=r0 offset=0 imm=0
#line 53 "sample/cgroup_count_connect4.c"
r1 = *(uint64_t*)(uintptr_t)(r0 + OFFSET(0));
// EBPF_OP_ADD64_IMM pc=26 dst=r1 src=r0 offset=0 imm=1
// EBPF_OP_ADD64_IMM pc=25 dst=r1 src=r0 offset=0 imm=1
#line 53 "sample/cgroup_count_connect4.c"
r1 += IMMEDIATE(1);
// EBPF_OP_STXDW pc=27 dst=r0 src=r1 offset=0 imm=0
// EBPF_OP_STXDW pc=26 dst=r0 src=r1 offset=0 imm=0
#line 53 "sample/cgroup_count_connect4.c"
*(uint64_t*)(uintptr_t)(r0 + OFFSET(0)) = (uint64_t)r1;
// EBPF_OP_MOV64_IMM pc=28 dst=r6 src=r0 offset=0 imm=0
#line 53 "sample/cgroup_count_connect4.c"
r6 = IMMEDIATE(0);
label_2:
// EBPF_OP_MOV64_REG pc=29 dst=r0 src=r6 offset=0 imm=0
#line 62 "sample/cgroup_count_connect4.c"
r0 = r6;
// EBPF_OP_EXIT pc=30 dst=r0 src=r0 offset=0 imm=0
// EBPF_OP_MOV64_IMM pc=27 dst=r0 src=r0 offset=0 imm=0
#line 53 "sample/cgroup_count_connect4.c"
r0 = IMMEDIATE(0);
label_3:
// EBPF_OP_EXIT pc=28 dst=r0 src=r0 offset=0 imm=0
#line 62 "sample/cgroup_count_connect4.c"
return r0;
#line 31 "sample/cgroup_count_connect4.c"
Expand All @@ -211,7 +204,7 @@ static program_entry_t _programs[] = {
1,
count_tcp_connect4_helpers,
2,
31,
29,
&count_tcp_connect4_program_type_guid,
&count_tcp_connect4_attach_type_guid,
},
Expand Down
47 changes: 20 additions & 27 deletions tests/bpf2c_tests/expected/cgroup_count_connect4_sys.c
Original file line number Diff line number Diff line change
Expand Up @@ -232,8 +232,6 @@ count_tcp_connect4(void* context)
register uint64_t r4 = 0;
#line 31 "sample/cgroup_count_connect4.c"
register uint64_t r5 = 0;
#line 31 "sample/cgroup_count_connect4.c"
register uint64_t r6 = 0;
#line 31 "sample/cgroup_count_connect4.c"
register uint64_t r10 = 0;

Expand All @@ -242,27 +240,27 @@ count_tcp_connect4(void* context)
#line 31 "sample/cgroup_count_connect4.c"
r10 = (uintptr_t)((uint8_t*)stack + sizeof(stack));

// EBPF_OP_MOV64_IMM pc=0 dst=r6 src=r0 offset=0 imm=1
// EBPF_OP_MOV64_IMM pc=0 dst=r0 src=r0 offset=0 imm=1
#line 31 "sample/cgroup_count_connect4.c"
r6 = IMMEDIATE(1);
r0 = IMMEDIATE(1);
// EBPF_OP_LDXW pc=1 dst=r2 src=r1 offset=44 imm=0
#line 34 "sample/cgroup_count_connect4.c"
r2 = *(uint32_t*)(uintptr_t)(r1 + OFFSET(44));
// EBPF_OP_JNE_IMM pc=2 dst=r2 src=r0 offset=26 imm=6
// EBPF_OP_JNE_IMM pc=2 dst=r2 src=r0 offset=25 imm=6
#line 34 "sample/cgroup_count_connect4.c"
if (r2 != IMMEDIATE(6)) {
#line 34 "sample/cgroup_count_connect4.c"
goto label_2;
goto label_3;
#line 34 "sample/cgroup_count_connect4.c"
}
// EBPF_OP_LDXH pc=3 dst=r1 src=r1 offset=40 imm=0
#line 40 "sample/cgroup_count_connect4.c"
r1 = *(uint16_t*)(uintptr_t)(r1 + OFFSET(40));
// EBPF_OP_JNE_IMM pc=4 dst=r1 src=r0 offset=24 imm=7459
// EBPF_OP_JNE_IMM pc=4 dst=r1 src=r0 offset=23 imm=7459
#line 40 "sample/cgroup_count_connect4.c"
if (r1 != IMMEDIATE(7459)) {
#line 40 "sample/cgroup_count_connect4.c"
goto label_2;
goto label_3;
#line 40 "sample/cgroup_count_connect4.c"
}
// EBPF_OP_MOV64_IMM pc=5 dst=r1 src=r0 offset=0 imm=8989
Expand All @@ -289,7 +287,7 @@ count_tcp_connect4(void* context)
return 0;
#line 48 "sample/cgroup_count_connect4.c"
}
// EBPF_OP_JNE_IMM pc=12 dst=r0 src=r0 offset=12 imm=0
// EBPF_OP_JNE_IMM pc=12 dst=r0 src=r0 offset=11 imm=0
#line 49 "sample/cgroup_count_connect4.c"
if (r0 != IMMEDIATE(0)) {
#line 49 "sample/cgroup_count_connect4.c"
Expand All @@ -314,16 +312,13 @@ count_tcp_connect4(void* context)
// EBPF_OP_ADD64_IMM pc=18 dst=r3 src=r0 offset=0 imm=-16
#line 50 "sample/cgroup_count_connect4.c"
r3 += IMMEDIATE(-16);
// EBPF_OP_MOV64_IMM pc=19 dst=r6 src=r0 offset=0 imm=0
#line 50 "sample/cgroup_count_connect4.c"
r6 = IMMEDIATE(0);
// EBPF_OP_LDDW pc=20 dst=r1 src=r1 offset=0 imm=1
// EBPF_OP_LDDW pc=19 dst=r1 src=r1 offset=0 imm=1
#line 51 "sample/cgroup_count_connect4.c"
r1 = POINTER(_maps[0].address);
// EBPF_OP_MOV64_IMM pc=22 dst=r4 src=r0 offset=0 imm=0
// EBPF_OP_MOV64_IMM pc=21 dst=r4 src=r0 offset=0 imm=0
#line 51 "sample/cgroup_count_connect4.c"
r4 = IMMEDIATE(0);
// EBPF_OP_CALL pc=23 dst=r0 src=r0 offset=0 imm=2
// EBPF_OP_CALL pc=22 dst=r0 src=r0 offset=0 imm=2
#line 51 "sample/cgroup_count_connect4.c"
r0 = count_tcp_connect4_helpers[1].address(r1, r2, r3, r4, r5, context);
#line 51 "sample/cgroup_count_connect4.c"
Expand All @@ -332,27 +327,25 @@ count_tcp_connect4(void* context)
return 0;
#line 51 "sample/cgroup_count_connect4.c"
}
// EBPF_OP_JA pc=24 dst=r0 src=r0 offset=4 imm=0
// EBPF_OP_JA pc=23 dst=r0 src=r0 offset=3 imm=0
#line 51 "sample/cgroup_count_connect4.c"
goto label_2;
label_1:
// EBPF_OP_LDXDW pc=25 dst=r1 src=r0 offset=0 imm=0
// EBPF_OP_LDXDW pc=24 dst=r1 src=r0 offset=0 imm=0
#line 53 "sample/cgroup_count_connect4.c"
r1 = *(uint64_t*)(uintptr_t)(r0 + OFFSET(0));
// EBPF_OP_ADD64_IMM pc=26 dst=r1 src=r0 offset=0 imm=1
// EBPF_OP_ADD64_IMM pc=25 dst=r1 src=r0 offset=0 imm=1
#line 53 "sample/cgroup_count_connect4.c"
r1 += IMMEDIATE(1);
// EBPF_OP_STXDW pc=27 dst=r0 src=r1 offset=0 imm=0
// EBPF_OP_STXDW pc=26 dst=r0 src=r1 offset=0 imm=0
#line 53 "sample/cgroup_count_connect4.c"
*(uint64_t*)(uintptr_t)(r0 + OFFSET(0)) = (uint64_t)r1;
// EBPF_OP_MOV64_IMM pc=28 dst=r6 src=r0 offset=0 imm=0
#line 53 "sample/cgroup_count_connect4.c"
r6 = IMMEDIATE(0);
label_2:
// EBPF_OP_MOV64_REG pc=29 dst=r0 src=r6 offset=0 imm=0
#line 62 "sample/cgroup_count_connect4.c"
r0 = r6;
// EBPF_OP_EXIT pc=30 dst=r0 src=r0 offset=0 imm=0
// EBPF_OP_MOV64_IMM pc=27 dst=r0 src=r0 offset=0 imm=0
#line 53 "sample/cgroup_count_connect4.c"
r0 = IMMEDIATE(0);
label_3:
// EBPF_OP_EXIT pc=28 dst=r0 src=r0 offset=0 imm=0
#line 62 "sample/cgroup_count_connect4.c"
return r0;
#line 31 "sample/cgroup_count_connect4.c"
Expand All @@ -372,7 +365,7 @@ static program_entry_t _programs[] = {
1,
count_tcp_connect4_helpers,
2,
31,
29,
&count_tcp_connect4_program_type_guid,
&count_tcp_connect4_attach_type_guid,
},
Expand Down
Loading

0 comments on commit c514000

Please sign in to comment.