[clang] [NFC][analyzer] Add regression tests from bisection commits to the CSA's test suite (PR #241058)

Benedek Kaibas via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 11 12:13:37 PST 2026


================
@@ -120,3 +120,30 @@ void test_constant_p(void *ptr) {
   clang_analyzer_eval(__builtin_constant_p(k - 3) == 1); // expected-warning {{TRUE}}
   clang_analyzer_eval(__builtin_constant_p(ptr == 0)); // expected-warning {{FALSE}}
 }
+
+#ifdef _WIN32
+namespace GH39448 {
+struct A { int someApi(); };
+
+int testAssert(A* a) {
+  __assume(a != nullptr);
+  return a->someApi();
+}
+
+int testAssert2(int* a) {
+  __assume(a != nullptr);
+  return *a;
+}
+
+int testAssert3(A* a) {
+  __assume(a);
+  return a->someApi();
+}
+
+int testAssert4(int* a) {
+  __assume(a);
+  return *a;
----------------
benedekaibas wrote:

Applied changes here: [756496a](https://github.com/llvm/llvm-project/pull/241058/commits/756496a6acfb8d5f0c267067569178fff6d79503)

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


More information about the cfe-commits mailing list