@@ -24,11 +24,52 @@ verify_code (gcc_jit_context *ctxt, gcc_jit_result *result)
2424 gcc_jit_context_get_type (ctxt , GCC_JIT_TYPE_DOUBLE );
2525 CHECK_VALUE (gcc_jit_function_get_return_type (builtin_sin ), double_type );
2626 CHECK (!gcc_jit_type_is_integral (double_type ));
27+ CHECK (gcc_jit_type_is_floating_point (double_type ));
28+
29+ gcc_jit_type * float_type =
30+ gcc_jit_context_get_type (ctxt , GCC_JIT_TYPE_FLOAT );
31+ CHECK (!gcc_jit_type_is_bool (float_type ));
32+ CHECK (!gcc_jit_type_is_integral (float_type ));
33+ CHECK (gcc_jit_type_is_floating_point (float_type ));
34+
35+ gcc_jit_target_info * target_info = gcc_jit_context_get_target_info (ctxt );
36+ if (target_info != NULL && gcc_jit_target_info_supports_target_dependent_type (target_info , GCC_JIT_TYPE_FLOAT16 ))
37+ {
38+ gcc_jit_type * float16_type = gcc_jit_context_get_type (ctxt , GCC_JIT_TYPE_FLOAT16 );
39+ CHECK (!gcc_jit_type_is_bool (float16_type ));
40+ CHECK (!gcc_jit_type_is_integral (float16_type ));
41+ CHECK (gcc_jit_type_is_floating_point (float16_type ));
42+ }
43+
44+ if (target_info != NULL && gcc_jit_target_info_supports_target_dependent_type (target_info , GCC_JIT_TYPE_FLOAT32 ))
45+ {
46+ gcc_jit_type * float32_type = gcc_jit_context_get_type (ctxt , GCC_JIT_TYPE_FLOAT32 );
47+ CHECK (!gcc_jit_type_is_bool (float32_type ));
48+ CHECK (!gcc_jit_type_is_integral (float32_type ));
49+ CHECK (gcc_jit_type_is_floating_point (float32_type ));
50+ }
51+
52+ if (target_info != NULL && gcc_jit_target_info_supports_target_dependent_type (target_info , GCC_JIT_TYPE_FLOAT64 ))
53+ {
54+ gcc_jit_type * float64_type = gcc_jit_context_get_type (ctxt , GCC_JIT_TYPE_FLOAT64 );
55+ CHECK (!gcc_jit_type_is_bool (float64_type ));
56+ CHECK (!gcc_jit_type_is_integral (float64_type ));
57+ CHECK (gcc_jit_type_is_floating_point (float64_type ));
58+ }
59+
60+ if (target_info != NULL && gcc_jit_target_info_supports_target_dependent_type (target_info , GCC_JIT_TYPE_FLOAT128 ))
61+ {
62+ gcc_jit_type * float128_type = gcc_jit_context_get_type (ctxt , GCC_JIT_TYPE_FLOAT128 );
63+ CHECK (!gcc_jit_type_is_bool (float128_type ));
64+ CHECK (!gcc_jit_type_is_integral (float128_type ));
65+ CHECK (gcc_jit_type_is_floating_point (float128_type ));
66+ }
2767
2868 gcc_jit_type * bool_type =
2969 gcc_jit_context_get_type (ctxt , GCC_JIT_TYPE_BOOL );
3070 CHECK (gcc_jit_type_is_bool (bool_type ));
3171 CHECK (!gcc_jit_type_is_integral (bool_type ));
72+ CHECK (!gcc_jit_type_is_floating_point (bool_type ));
3273
3374 gcc_jit_type * aligned_bool_type =
3475 gcc_jit_type_get_aligned (gcc_jit_context_get_type (ctxt , GCC_JIT_TYPE_BOOL ), 8 );
@@ -42,15 +83,19 @@ verify_code (gcc_jit_context *ctxt, gcc_jit_result *result)
4283 gcc_jit_type * int64 =
4384 gcc_jit_context_get_int_type (ctxt , 8 , 1 );
4485 CHECK (gcc_jit_type_is_integral (int64 ));
86+ CHECK (!gcc_jit_type_is_floating_point (int64 ));
4587 gcc_jit_type * uint64 =
4688 gcc_jit_context_get_int_type (ctxt , 8 , 0 );
4789 CHECK (gcc_jit_type_is_integral (uint64 ));
90+ CHECK (!gcc_jit_type_is_floating_point (uint64 ));
4891 gcc_jit_type * int8 =
4992 gcc_jit_context_get_int_type (ctxt , 1 , 1 );
5093 CHECK (gcc_jit_type_is_integral (int8 ));
94+ CHECK (!gcc_jit_type_is_floating_point (int8 ));
5195 gcc_jit_type * uint8 =
5296 gcc_jit_context_get_int_type (ctxt , 1 , 0 );
5397 CHECK (gcc_jit_type_is_integral (uint8 ));
98+ CHECK (!gcc_jit_type_is_floating_point (uint8 ));
5499
55100 CHECK (!gcc_jit_type_dyncast_vector (double_type ));
56101 gcc_jit_type * vec_type = gcc_jit_type_get_vector (double_type , 4 );
0 commit comments