Warning: This file is not a C or C++ file. It does not have highlighting.
1 | #if 0 /*===-- include/flang/Runtime/magic-numbers.h -----------------------===*/ |
---|---|
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 | #endif |
9 | #if 0 |
10 | This header can be included into both Fortran and C. |
11 | |
12 | This file defines various code values that need to be exported |
13 | to predefined Fortran standard modules as well as to C/C++ |
14 | code in the compiler and runtime library. |
15 | These include: |
16 | - the error/end code values that can be returned |
17 | to an IOSTAT= or STAT= specifier on a Fortran I/O statement |
18 | or coindexed data reference (see Fortran 2018 12.11.5, |
19 | 16.10.2, and 16.10.2.33) |
20 | Codes from <errno.h>, e.g. ENOENT, are assumed to be positive |
21 | and are used "raw" as IOSTAT values. |
22 | |
23 | CFI_ERROR_xxx and CFI_INVALID_xxx macros from ISO_Fortran_binding.h |
24 | have small positive values. The FORTRAN_RUNTIME_STAT_xxx macros here |
25 | start at 100 so as to never conflict with those codes. |
26 | #endif |
27 | #ifndef FORTRAN_RUNTIME_MAGIC_NUMBERS_H_ |
28 | #define FORTRAN_RUNTIME_MAGIC_NUMBERS_H_ |
29 | |
30 | #define FORTRAN_DEFAULT_OUTPUT_UNIT 6 |
31 | #define FORTRAN_DEFAULT_INPUT_UNIT 5 |
32 | #define FORTRAN_ERROR_UNIT 0 |
33 | |
34 | #define FORTRAN_RUNTIME_IOSTAT_END (-1) |
35 | #define FORTRAN_RUNTIME_IOSTAT_EOR (-2) |
36 | #define FORTRAN_RUNTIME_IOSTAT_FLUSH (-3) |
37 | #define FORTRAN_RUNTIME_IOSTAT_INQUIRE_INTERNAL_UNIT 256 |
38 | |
39 | #define FORTRAN_RUNTIME_STAT_FAILED_IMAGE 101 |
40 | #define FORTRAN_RUNTIME_STAT_LOCKED 102 |
41 | #define FORTRAN_RUNTIME_STAT_LOCKED_OTHER_IMAGE 103 |
42 | #define FORTRAN_RUNTIME_STAT_STOPPED_IMAGE 104 |
43 | #define FORTRAN_RUNTIME_STAT_UNLOCKED 105 |
44 | #define FORTRAN_RUNTIME_STAT_UNLOCKED_FAILED_IMAGE 106 |
45 | |
46 | #if 0 |
47 | Status codes for GET_COMMAND_ARGUMENT. The status for 'value too short' needs |
48 | to be -1, the others must be positive. |
49 | #endif |
50 | #define FORTRAN_RUNTIME_STAT_INVALID_ARG_NUMBER 107 |
51 | #define FORTRAN_RUNTIME_STAT_MISSING_ARG 108 |
52 | #define FORTRAN_RUNTIME_STAT_VALUE_TOO_SHORT -1 |
53 | |
54 | #if 0 |
55 | Status codes for GET_ENVIRONMENT_VARIABLE. Values mandated by the standard. |
56 | #endif |
57 | #define FORTRAN_RUNTIME_STAT_MISSING_ENV_VAR 1 |
58 | #define FORTRAN_RUNTIME_STAT_ENV_VARS_UNSUPPORTED 2 |
59 | |
60 | #if 0 |
61 | Processor-defined status code for MOVE_ALLOC where arguments are the |
62 | same allocatable. |
63 | #endif |
64 | #define FORTRAN_RUNTIME_STAT_MOVE_ALLOC_SAME_ALLOCATABLE 109 |
65 | |
66 | #if 0 |
67 | Additional status code for a bad pointer DEALLOCATE. |
68 | #endif |
69 | #define FORTRAN_RUNTIME_STAT_BAD_POINTER_DEALLOCATION 110 |
70 | |
71 | #if 0 |
72 | ieee_class_type values |
73 | The sequence is that of F18 Clause 17.2p3, but nothing depends on that. |
74 | #endif |
75 | #define _FORTRAN_RUNTIME_IEEE_SIGNALING_NAN 1 |
76 | #define _FORTRAN_RUNTIME_IEEE_QUIET_NAN 2 |
77 | #define _FORTRAN_RUNTIME_IEEE_NEGATIVE_INF 3 |
78 | #define _FORTRAN_RUNTIME_IEEE_NEGATIVE_NORMAL 4 |
79 | #define _FORTRAN_RUNTIME_IEEE_NEGATIVE_SUBNORMAL 5 |
80 | #define _FORTRAN_RUNTIME_IEEE_NEGATIVE_ZERO 6 |
81 | #define _FORTRAN_RUNTIME_IEEE_POSITIVE_ZERO 7 |
82 | #define _FORTRAN_RUNTIME_IEEE_POSITIVE_SUBNORMAL 8 |
83 | #define _FORTRAN_RUNTIME_IEEE_POSITIVE_NORMAL 9 |
84 | #define _FORTRAN_RUNTIME_IEEE_POSITIVE_INF 10 |
85 | #define _FORTRAN_RUNTIME_IEEE_OTHER_VALUE 11 |
86 | |
87 | #if 0 |
88 | ieee_flag_type values |
89 | The values are those of a common but not universal fenv.h file. |
90 | The denorm value is a nonstandard extension. |
91 | #endif |
92 | #define _FORTRAN_RUNTIME_IEEE_INVALID 1 |
93 | #define _FORTRAN_RUNTIME_IEEE_DENORM 2 |
94 | #define _FORTRAN_RUNTIME_IEEE_DIVIDE_BY_ZERO 4 |
95 | #define _FORTRAN_RUNTIME_IEEE_OVERFLOW 8 |
96 | #define _FORTRAN_RUNTIME_IEEE_UNDERFLOW 16 |
97 | #define _FORTRAN_RUNTIME_IEEE_INEXACT 32 |
98 | |
99 | #if 0 |
100 | ieee_round_type values |
101 | The values are those of the llvm.get.rounding instrinsic, which is assumed by |
102 | ieee_arithmetic module rounding procedures. |
103 | #endif |
104 | #define _FORTRAN_RUNTIME_IEEE_TO_ZERO 0 |
105 | #define _FORTRAN_RUNTIME_IEEE_NEAREST 1 |
106 | #define _FORTRAN_RUNTIME_IEEE_UP 2 |
107 | #define _FORTRAN_RUNTIME_IEEE_DOWN 3 |
108 | #define _FORTRAN_RUNTIME_IEEE_AWAY 4 |
109 | #define _FORTRAN_RUNTIME_IEEE_OTHER 5 |
110 | |
111 | #if 0 |
112 | The size of derived types ieee_modes_type and ieee_status_type from intrinsic |
113 | module ieee_exceptions must be large enough to hold an fenv.h object of type |
114 | femode_t and fenv_t, respectively. These types have members that are declared |
115 | as int arrays with the following extents to allow build time validation of |
116 | these sizes in cross compilation environments. |
117 | #endif |
118 | #define _FORTRAN_RUNTIME_IEEE_FEMODE_T_EXTENT 2 |
119 | #define _FORTRAN_RUNTIME_IEEE_FENV_T_EXTENT 8 |
120 | |
121 | #endif |
122 |
Warning: This file is not a C or C++ file. It does not have highlighting.