[clang] [Clang][ARM][Sema] Check validity of ldrexd/strexd builtin calls (PR #164919)

Simon Tatham via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 24 07:31:09 PDT 2025


================
@@ -24,3 +24,27 @@ int test_strex(char *addr) {
   res |= __builtin_arm_strex(42, (long long *)addr); // expected-error {{address argument to load or store exclusive builtin must be a pointer to 1,2 or 4 byte type}}
   return res;
 }
+
+int test_ldrexd(char *addr) {
+  int sum = 0;
+  sum += __builtin_arm_ldrexd(addr); // expected-error {{load and store exclusive builtins are not available on this architecture}}
----------------
statham-arm wrote:

It's a shame that this case reuses the error message that claims _no_ load/store exclusives are available. I think it might be better to make a separate error message that adds "8-byte" to the wording, and use that when your reduced `Mask` is zero but the original `getARMLDREXMask()` was not.

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


More information about the cfe-commits mailing list