function_hooks: update comment explaining various function hooks
[smatch.git] / validation / preprocessor / has-builtin.c
blob03272fc95c4917d7f0aee27228dc0adb644424a9
1 #ifndef __has_builtin
2 __has_builtin()??? Quesako?
3 #define __has_builtin(x) 0
4 #else
5 "has __has_builtin(), yeah!"
6 #endif
8 #if __has_builtin(nothing)
9 #error "not a builtin!"
10 #endif
12 #if __has_builtin(__builtin_offsetof) \
13 || __has_builtin(__builtin_types_compatible_p)
14 #error "builtin ops are not builtin functions!"
15 #endif
17 #if __has_builtin(__builtin_va_list) \
18 || __has_builtin(__builtin_ms_va_list)
19 #error "builtin types are not builtin functions!"
20 #endif
22 #if __has_builtin(__builtin_abs)
23 abs
24 #endif
26 #if __has_builtin(__builtin_constant_p)
27 constant_p
28 #endif
30 123 __has_builtin(abc) def
33 * check-name: has-builtin
34 * check-command: sparse -E $file
36 * check-output-start
38 "has __has_builtin(), yeah!"
39 abs
40 constant_p
41 123 0 def
42 * check-output-end