[clang] [lldb] [llvm] [clang] crash fix bodyfarm osatomic cmpswap #197211 (PR #197489)

Nagesh Nazare via cfe-commits cfe-commits at lists.llvm.org
Fri May 15 06:24:15 PDT 2026


================
@@ -18,3 +18,23 @@ int rdar9339920_test() {
   return 0;
 }
 
+// Regression test for issue #197211
+// When the user-declared OSAtomicCompareAndSwap* prototype has mismatched
+// oldValue/ newValue/ *theValue types, BodyFarm previously asserted while
+// synthesizing the body. It should bail out gracefully and let the analyzer
+// fall back to generic call semantics.
+bool OSAtomicCompareAndSwap(char32_t __oldValue, int __newValue,
+                            volatile int *_theValue);
+int gh197211_flag;
+void gh197211_test() {
+  if (OSAtomicCompareAndSwap(0, 0, &gh197211_flag))
+    ;
----------------
nageshnnazare wrote:

@NagyDonat Just wanted to keep it similar to the test that was reported in the original issue, hence the 'if' block. 


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


More information about the cfe-commits mailing list