Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / compiler-rt / lib / builtins / arm / aeabi_div0.c
blob7e8862321d825d3e655ed477989c5be0863568c3
1 //===-- aeabi_div0.c - ARM Runtime ABI support routines for compiler-rt ---===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file implements the division by zero helper routines as specified by the
10 // Run-time ABI for the ARM Architecture.
12 //===----------------------------------------------------------------------===//
14 // RTABI 4.3.2 - Division by zero
16 // The *div0 functions:
17 // - Return the value passed to them as a parameter
18 // - Or, return a fixed value defined by the execution environment (such as 0)
19 // - Or, raise a signal (often SIGFPE) or throw an exception, and do not return
21 // An application may provide its own implementations of the *div0 functions to
22 // for a particular behaviour from the *div and *divmod functions called out of
23 // line.
25 #include "../int_lib.h"
27 // provide an unused declaration to pacify pendantic compilation
28 extern unsigned char declaration;
30 #if defined(__ARM_EABI__)
31 AEABI_RTABI int __attribute__((weak)) __attribute__((visibility("hidden")))
32 __aeabi_idiv0(int return_value) {
33 return return_value;
36 AEABI_RTABI long long __attribute__((weak))
37 __attribute__((visibility("hidden"))) __aeabi_ldiv0(long long return_value) {
38 return return_value;
40 #endif