[llvm] [llubi] Add support for exposed provenance (PR #200596)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Sat Jun 13 09:14:35 PDT 2026
================
@@ -0,0 +1,34 @@
+; NOTE: Assertions have been autogenerated by utils/update_llubi_test_checks.py UTC_ARGS: --version 6
+; RUN: not llubi --verbose < %s 2>&1 | FileCheck %s
+
+target datalayout = "e-p:64:64:64"
+
+define void @main() {
+ ; Assume the pointer address is 8.
+ %alloc = alloca i32
+ %ptr1 = inttoptr i64 8 to ptr
+ %int = ptrtoint ptr %alloc to i64
+ %ptr2 = inttoptr i64 %int to ptr
+ %ptr3 = inttoptr i64 8 to ptr
+
+ ; We can access the wildcard pointer through exposed provenances.
+ store i32 0, ptr %ptr2
+ ; We can access the wildcard pointer through exposed provenances, even if there are no dependencies.
+ store i32 0, ptr %ptr3
+ ; We cannot access the pointer created before any provenance is exposed.
+ store i32 0, ptr %ptr1
+
+ ret void
+}
+; CHECK: Entering function: main
+; CHECK-NEXT: %alloc = alloca i32, align 4 => ptr 0x8 [alloc]
+; CHECK-NEXT: %ptr1 = inttoptr i64 8 to ptr => ptr 0x8 [nullary]
----------------
nikic wrote:
We should test this also for the case where we don't hit the "nothing exposed yet" edge case.
https://github.com/llvm/llvm-project/pull/200596
More information about the llvm-commits
mailing list