[clang] [Clang][AST] Fix printing for `atomic_test_and_set` and `atomic_clear` (PR #159712)

Corentin Jabot via cfe-commits cfe-commits at lists.llvm.org
Fri Sep 19 01:25:13 PDT 2025


================
@@ -176,6 +176,17 @@ float test15() {
   return __builtin_asinf(1.0F);
 }
 
+// CHECK: void test16() {
+// CHECK:   char *ptr;
+// CHECK:   __atomic_test_and_set(ptr, 0);
+// CHECK:   __atomic_clear(ptr, 0);
+// CHECK: }
+void test16() {
+  char *ptr;
+  __atomic_test_and_set(ptr, 0);
+  __atomic_clear(ptr, 0);
+}
+
----------------
cor3ntin wrote:

Do we have tests for the other atomic load builtins? It might be worth checking them all

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


More information about the cfe-commits mailing list