[clang] [analyzer] Fix _Atomic crashes for Z3 symbolic execution (PR #212050)

Balázs Benics via cfe-commits cfe-commits at lists.llvm.org
Sun Jul 26 03:33:21 PDT 2026


================
@@ -0,0 +1,20 @@
+// RUN: %clang_analyze_cc1 -analyzer-checker=core \
+// RUN:   -analyzer-checker=core,debug.ExprInspection \
+// RUN:   -analyzer-constraints=unsupported-z3 -verify %s
+// REQUIRES: z3
+// expected-no-diagnostics
+
+void atomic_bool(_Bool input) {
+  _Atomic(_Bool) value = input;
+  if (value) {
+  }
+}
+
+typedef _Bool B1;
+typedef _Bool B2;
+
+void atomic_bool_typedef(B1 input) {
+  _Atomic(B2) value = input;
+  if (value) {
+  }
+}
----------------
steakhal wrote:

These are two test cases. Which did crash? (Put a `no-crash` comment at the relevant line)
What is important in these test cases?

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


More information about the cfe-commits mailing list