Allow binding nullability of decls to SAT variables, to support inference.

The idea is that instead of nullable/nonnull/unspecified, the nullability of a
decl (typically parameter) can be a variable.
The analysis will determine how that variable interacts with e.g. the
nullability of expressions that are dereferenced, and we can then add SAT
assertions that the function body is safe, and solve for the param nullability.

For now, we only support top-level nullability of pointer-valued params, and
only apply constraints when directly loading pointer values from the param.
This info is stored ad-hoc and doesn't interact with nullability vectors.
A more general solution would store a full nullability-vector of variables
for the decl, and allow nullability-vectors for exprs to contain variables.
However this upgrade will be quite intrusive, so start small.

PiperOrigin-RevId: 540942832
diff --git a/nullability/BUILD b/nullability/BUILD
index 17696cb..3c2eb9f 100644
--- a/nullability/BUILD
+++ b/nullability/BUILD
@@ -11,6 +11,7 @@
         "@absl//absl/container:flat_hash_map",
         "@absl//absl/log:check",
         "@llvm-project//clang:analysis",
+        "@llvm-project//clang:ast",
     ],
 )
 
@@ -42,6 +43,24 @@
     ],
 )
 
+cc_test(
+    name = "pointer_nullability_analysis_test",
+    srcs = ["pointer_nullability_analysis_test.cc"],
+    deps = [
+        ":pointer_nullability",
+        ":pointer_nullability_analysis",
+        ":pointer_nullability_lattice",
+        "@llvm-project//clang:analysis",
+        "@llvm-project//clang:ast",
+        "@llvm-project//clang:basic",
+        "@llvm-project//clang:testing",
+        "@llvm-project//llvm:Support",
+        "@llvm-project//third-party/unittest:gmock",
+        "@llvm-project//third-party/unittest:gtest",
+        "@llvm-project//third-party/unittest:gtest_main",
+    ],
+)
+
 cc_library(
     name = "pointer_nullability_diagnosis",
     srcs = ["pointer_nullability_diagnosis.cc"],