aboutsummaryrefslogtreecommitdiff
path: root/test/builtins/Unit/arm/call_apsr.S
diff options
context:
space:
mode:
Diffstat (limited to 'test/builtins/Unit/arm/call_apsr.S')
-rw-r--r--test/builtins/Unit/arm/call_apsr.S43
1 files changed, 43 insertions, 0 deletions
diff --git a/test/builtins/Unit/arm/call_apsr.S b/test/builtins/Unit/arm/call_apsr.S
new file mode 100644
index 000000000000..b5e154cff31f
--- /dev/null
+++ b/test/builtins/Unit/arm/call_apsr.S
@@ -0,0 +1,43 @@
+//===-- call_apsr.S - Helpers for ARM EABI floating point tests -----------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This file implements helpers for ARM EABI floating point tests for the
+// compiler_rt library.
+//
+//===----------------------------------------------------------------------===//
+
+#include "../../../../lib/builtins/assembly.h"
+
+.syntax unified
+// __attribute__((pcs("aapcs")))
+// int32_t call_apsr_d(double a, double b, void(*fn)(double, double)) {
+// fn(a, b);
+// return apsr;
+// }
+
+DEFINE_COMPILERRT_PRIVATE_FUNCTION(call_apsr_d)
+ push {lr}
+ ldr ip, [sp, #4]
+ blx ip
+ mrs r0, apsr
+ pop {pc}
+END_COMPILERRT_FUNCTION(call_apsr_d)
+
+// __attribute__((pcs("aapcs")))
+// int32_t call_apsr_f(float a, float b, void(*fn)(float, float)) {
+// fn(a, b);
+// return apsr;
+// }
+
+DEFINE_COMPILERRT_PRIVATE_FUNCTION(call_apsr_f)
+ push {lr}
+ blx r2
+ mrs r0, apsr
+ pop {pc}
+END_COMPILERRT_FUNCTION(call_apsr_f)