Skip to content

Commit 7950df7

Browse files
kknjhKernel Patches Daemon
authored andcommitted
selftests/bpf: Fix the invalid operand for instruction issue
The following issue occurs when compiling with clang version 17.0.6, but not with version 18.1.8. Add a version restriction to fix this problem. progs/compute_live_registers.c:251:3: error: invalid operand for instruction 251 | "r0 = 1;" | ^ <inline asm>:1:22: note: instantiated into assembly here 1 | r0 = 1;r2 = 2;if r1 & 0x7 goto +1;exit;r0 = r2;exit; | ^ 1 error generated. Fixes: 4a4b84b ("selftests/bpf: verify jset handling in CFG computation") Signed-off-by: Feng Yang <[email protected]>
1 parent 8f9c214 commit 7950df7

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

tools/testing/selftests/bpf/progs/compute_live_registers.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,7 @@ __naked void if2(void)
240240
::: __clobber_all);
241241
}
242242

243+
#if __clang_major__ >= 18
243244
/* Verifier misses that r2 is alive if jset is not handled properly */
244245
SEC("socket")
245246
__log_level(2)
@@ -255,6 +256,7 @@ __naked void if3_jset_bug(void)
255256
"exit;"
256257
::: __clobber_all);
257258
}
259+
#endif
258260

259261
SEC("socket")
260262
__log_level(2)

0 commit comments

Comments
 (0)