[compiler-rt] [Compiler-rt] Implement AEABI Unaligned Read/Write Helpers in compiler-rt (PR #167913)

Victor Campos via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 17 02:09:02 PST 2025


================
@@ -0,0 +1,88 @@
+// REQUIRES: arm-target-arch || armv6m-target-arch
+// RUN: %clang_builtins %s %librt -o %t && %run %t
+
+#include <stdint.h>
+#include <stdio.h>
+#include <string.h>
+
+extern int __aeabi_uread4(void *);
+extern int __aeabi_uwrite4(int, void *);
+extern long long __aeabi_uread8(void *);
+extern long long __aeabi_uwrite8(long long, void *);
+
+#define lenof(x) (sizeof((x)) / sizeof(*(x)))
+
+int test_unaligned(void) {
+  long long target8;
+  int target4;
+  const char source[] = "abcdefghijklmno";
+  static char dest1[lenof(source)], dest2[lenof(source)];
----------------
vhscampos wrote:

Why `static`?

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


More information about the llvm-commits mailing list