================
@@ -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))
+ ;
----------------
NagyDonat wrote:
```suggestion
OSAtomicCompareAndSwap(0, 0, &gh197211_flag);
```
Why do you include the `if` in this testcase? I see that in real-world code
this function call would usually appear as the condition of an `if`, but it
doesn't seem to be relevant for the reproduction of this bug.
https://github.com/llvm/llvm-project/pull/197489
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits