test_not_enough_args(void)1static void test_not_enough_args(void) 2 { 3 __builtin_isfinite(); 4 __builtin_isinf(); 5 __builtin_isinf_sign(); 6 __builtin_isnan(); 7 __builtin_isnormal(); 8 __builtin_signbit(); 9 } 10 test_too_many_args(double v)11static void test_too_many_args(double v) 12 { 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); 19 } 20 test_non_float(int v)21static void test_non_float(int v) 22 { 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); 29 } 30 test_float(float v)31static void test_float(float v) 32 { 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); 39 } 40 test_double(double v)41static void test_double(double v) 42 { 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); 49 } 50 test_ldouble(long double v)51static void test_ldouble(long double v) 52 { 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); 59 } 60 test_constant(void)61static void test_constant(void) 62 { 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); 69 } 70 71 /* 72 * check-name: builtin float-point unop 73 * check-command: sparse -Wno-decl $file 74 * 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 95 */ 96