[llvm] [BPF] Report an error if comparison imm operand cannot fit in 32bit (PR #142989)

via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 9 14:43:18 PDT 2025


================
@@ -0,0 +1,10 @@
+; RUN: not llc -mtriple=bpfel -filetype=obj < %s 2>&1 >/dev/null | FileCheck %s
+
+; CHECK: error: immediate out of range, shall fit in 32 bits
+
+define dso_local void @test() naked {
+  tail call void asm sideeffect
+    "call 7; r1 = r0; r1 <<= 32; call 7; r1 $|= r0; if r1 == 0x1deadbeef goto +1; r0 = 0; exit;",
----------------
yonghong-song wrote:

Yes, as inline asm, we can do simpler things.

https://github.com/llvm/llvm-project/pull/142989


More information about the llvm-commits mailing list