aboutsummaryrefslogtreecommitdiff
path: root/auto/clang
blob: 27fe03b5a60c11d0a7d0817f4475c1e09a3f8de1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
# Copyright (C) Igor Sysoev
# Copyright (C) NGINX, Inc.

# C language features.

njs_feature="GCC unsigned __int128"
njs_feature_name=NJS_HAVE_UNSIGNED_INT128
njs_feature_run=no
njs_feature_incs=
njs_feature_libs=
njs_feature_test="int main(void) {
                      unsigned __int128 p = 0;
                      return (int) p;
                  }"
. auto/feature


njs_feature="GCC __builtin_expect()"
njs_feature_name=NJS_HAVE_BUILTIN_EXPECT
njs_feature_run=no
njs_feature_incs=
njs_feature_libs=
njs_feature_test="int main(int argc, char *const *argv) {
                      if ((__typeof__(argc == 0))
                                   __builtin_expect((argc == 0), 0))
                          return 0;
                      return 1;
                  }"
. auto/feature


njs_feature="GCC __builtin_unreachable()"
njs_feature_name=NJS_HAVE_BUILTIN_UNREACHABLE
njs_feature_run=no
njs_feature_incs=
njs_feature_libs=
njs_feature_test="int main(void) {
                      __builtin_unreachable();
                  }"
. auto/feature


njs_feature="GCC __builtin_prefetch()"
njs_feature_name=NJS_HAVE_BUILTIN_PREFETCH
njs_feature_run=no
njs_feature_incs=
njs_feature_libs=
njs_feature_test="int main(void) {
                      __builtin_prefetch(0);
                      return 0;
                  }"
. auto/feature


njs_feature="GCC __builtin_clz()"
njs_feature_name=NJS_HAVE_BUILTIN_CLZ
njs_feature_run=no
njs_feature_incs=
njs_feature_libs=
njs_feature_test="int main(void) {
                      if (__builtin_clz(1) != 31) {
                          return 1;
                      }
                      return 0;
                  }"
. auto/feature


njs_feature="GCC __builtin_clzll()"
njs_feature_name=NJS_HAVE_BUILTIN_CLZLL
njs_feature_run=no
njs_feature_incs=
njs_feature_libs=
njs_feature_test="int main(void) {
                      if (__builtin_clzll(1ULL) != 63) {
                          return 1;
                      }
                      return 0;
                  }"
. auto/feature


njs_feature="GCC __attribute__ visibility"
njs_feature_name=NJS_HAVE_GCC_ATTRIBUTE_VISIBILITY
njs_feature_run=no
njs_feature_path=
njs_feature_libs=
njs_feature_test="int n __attribute__ ((visibility(\"default\")));

                  int main(void) {
                      return 0;
                  }"
. auto/feature


njs_feature="GCC __attribute__ malloc"
njs_feature_name=NJS_HAVE_GCC_ATTRIBUTE_MALLOC
njs_feature_run=no
njs_feature_path=
njs_feature_libs=
njs_feature_test="#include <stdlib.h>

                  void *f(void) __attribute__ ((__malloc__));

                  void *f(void) {
                      return malloc(1);
                  }

                  int main(void) {
                      if (f() != NULL) {
                          return 1;
                      }
                      return 0;
                  }"
. auto/feature


njs_feature="GCC __attribute__ aligned"
njs_feature_name=NJS_HAVE_GCC_ATTRIBUTE_ALIGNED
njs_feature_run=no
njs_feature_path=
njs_feature_libs=
njs_feature_test="int n __attribute__ ((aligned(64)));

                  int main(void) {
                    return 0;
                  }"
. auto/feature


njs_feature="GCC __attribute__ packed"
njs_feature_name=NJS_HAVE_GCC_ATTRIBUTE_PACKED
njs_feature_run=no
njs_feature_path=
njs_feature_libs=
njs_feature_test="struct __attribute__((packed)) s { char v; };

                  int main(void) {
                    return 0;
                  }"
. auto/feature


njs_feature="GCC __attribute__ fallthrough"
njs_feature_name=NJS_HAVE_GCC_ATTRIBUTE_FALLTHROUGH
njs_feature_run=no
njs_feature_path=
njs_feature_libs=
njs_feature_test="int main(int argc, char *argv[]) {
                    switch (argc) {
                    case 0:
                      argc++;
                      __attribute__((fallthrough));
                    default:
                      argc++;
                    }

                    return argc;
                  }"
. auto/feature


njs_feature="GCC __attribute__ no_sanitize"
njs_feature_name=NJS_HAVE_GCC_ATTRIBUTE_NO_SANITIZE
njs_feature_run=no
njs_feature_path=
njs_feature_libs=
njs_feature_test="__attribute__((no_sanitize(\"undefined\"))) int main(void) {
                    return 0;
                  }"
. auto/feature


njs_feature="Address sanitizer"
njs_feature_name=NJS_HAVE_ADDRESS_SANITIZER
njs_feature_run=no
njs_feature_path=
njs_feature_libs=
njs_feature_test="int main(void) {
                      return
                  #ifdef __SANITIZE_ADDRESS__
                          0;
                  #else
                      #if defined(__has_feature)
                          #if __has_feature(address_sanitizer)
                          0;
                          #endif
                      #endif
                  #endif
                  }"
. auto/feature


njs_feature="Memory sanitizer"
njs_feature_name=NJS_HAVE_MEMORY_SANITIZER
njs_feature_run=yes
njs_feature_incs=
njs_feature_libs=
njs_feature_test="#include <sanitizer/msan_interface.h>
                  int main(int argc, char *argv[]) {
                      __msan_unpoison(argv, sizeof(char *));
                      return 0;
                  }"
. auto/feature


njs_feature="_mm_setcsr()"
njs_feature_name=NJS_HAVE_DENORMALS_CONTROL
njs_feature_run=no
njs_feature_incs=
njs_feature_libs=
njs_feature_test="#include <xmmintrin.h>
                  int main(void) {
                      _mm_setcsr(_mm_getcsr());
                      return 0;
                  }"
. auto/feature