================
@@ -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
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to