hooks: add a warning to detect unimplemented hooks
[smatch.git] / validation / builtin-fp-unop.c
blobf42c587b7dd42fec3457787bf83a858dcc9a27a7
1 static void test_not_enough_args(void)
3 __builtin_isfinite();
4 __builtin_isinf();
5 __builtin_isinf_sign();
6 __builtin_isnan();
7 __builtin_isnormal();
8 __builtin_signbit();
11 static void test_too_many_args(double v)
13 __builtin_isfinite(v, v);
14 __builtin_isinf(v, v);
15 __builtin_isinf_sign(v, v);
16 __builtin_isnan(v, v);
17 __builtin_isnormal(v, v);
18 __builtin_signbit(v, v);
21 static void test_non_float(int v)
23 __builtin_isfinite(v);
24 __builtin_isinf(v);
25 __builtin_isinf_sign(v);
26 __builtin_isnan(v);
27 __builtin_isnormal(v);
28 __builtin_signbit(v);
31 static void test_float(float v)
33 __builtin_isfinite(v);
34 __builtin_isinf(v);
35 __builtin_isinf_sign(v);
36 __builtin_isnan(v);
37 __builtin_isnormal(v);
38 __builtin_signbit(v);
41 static void test_double(double v)
43 __builtin_isfinite(v);
44 __builtin_isinf(v);
45 __builtin_isinf_sign(v);
46 __builtin_isnan(v);
47 __builtin_isnormal(v);
48 __builtin_signbit(v);
51 static void test_ldouble(long double v)
53 __builtin_isfinite(v);
54 __builtin_isinf(v);
55 __builtin_isinf_sign(v);
56 __builtin_isnan(v);
57 __builtin_isnormal(v);
58 __builtin_signbit(v);
61 static void test_constant(void)
63 __builtin_isfinite(0.0);
64 __builtin_isinf(0.0);
65 __builtin_isinf_sign(0.0);
66 __builtin_isnan(0.0);
67 __builtin_isnormal(0.0);
68 __builtin_signbit(0.0);
72 * check-name: builtin float-point unop
73 * check-command: sparse -Wno-decl $file
75 * check-error-start
76 builtin-fp-unop.c:3:27: error: not enough arguments for __builtin_isfinite
77 builtin-fp-unop.c:4:24: error: not enough arguments for __builtin_isinf
78 builtin-fp-unop.c:5:29: error: not enough arguments for __builtin_isinf_sign
79 builtin-fp-unop.c:6:24: error: not enough arguments for __builtin_isnan
80 builtin-fp-unop.c:7:27: error: not enough arguments for __builtin_isnormal
81 builtin-fp-unop.c:8:26: error: not enough arguments for __builtin_signbit
82 builtin-fp-unop.c:13:27: error: too many arguments for __builtin_isfinite
83 builtin-fp-unop.c:14:24: error: too many arguments for __builtin_isinf
84 builtin-fp-unop.c:15:29: error: too many arguments for __builtin_isinf_sign
85 builtin-fp-unop.c:16:24: error: too many arguments for __builtin_isnan
86 builtin-fp-unop.c:17:27: error: too many arguments for __builtin_isnormal
87 builtin-fp-unop.c:18:26: error: too many arguments for __builtin_signbit
88 builtin-fp-unop.c:23:27: error: non-floating-point argument in call to __builtin_isfinite()
89 builtin-fp-unop.c:24:24: error: non-floating-point argument in call to __builtin_isinf()
90 builtin-fp-unop.c:25:29: error: non-floating-point argument in call to __builtin_isinf_sign()
91 builtin-fp-unop.c:26:24: error: non-floating-point argument in call to __builtin_isnan()
92 builtin-fp-unop.c:27:27: error: non-floating-point argument in call to __builtin_isnormal()
93 builtin-fp-unop.c:28:26: error: non-floating-point argument in call to __builtin_signbit()
94 * check-error-end