@@ -24,11 +24,52 @@ verify_code (gcc_jit_context *ctxt, gcc_jit_result *result)
24
24
gcc_jit_context_get_type (ctxt , GCC_JIT_TYPE_DOUBLE );
25
25
CHECK_VALUE (gcc_jit_function_get_return_type (builtin_sin ), double_type );
26
26
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
+ }
27
67
28
68
gcc_jit_type * bool_type =
29
69
gcc_jit_context_get_type (ctxt , GCC_JIT_TYPE_BOOL );
30
70
CHECK (gcc_jit_type_is_bool (bool_type ));
31
71
CHECK (!gcc_jit_type_is_integral (bool_type ));
72
+ CHECK (!gcc_jit_type_is_floating_point (bool_type ));
32
73
33
74
gcc_jit_type * aligned_bool_type =
34
75
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)
42
83
gcc_jit_type * int64 =
43
84
gcc_jit_context_get_int_type (ctxt , 8 , 1 );
44
85
CHECK (gcc_jit_type_is_integral (int64 ));
86
+ CHECK (!gcc_jit_type_is_floating_point (int64 ));
45
87
gcc_jit_type * uint64 =
46
88
gcc_jit_context_get_int_type (ctxt , 8 , 0 );
47
89
CHECK (gcc_jit_type_is_integral (uint64 ));
90
+ CHECK (!gcc_jit_type_is_floating_point (uint64 ));
48
91
gcc_jit_type * int8 =
49
92
gcc_jit_context_get_int_type (ctxt , 1 , 1 );
50
93
CHECK (gcc_jit_type_is_integral (int8 ));
94
+ CHECK (!gcc_jit_type_is_floating_point (int8 ));
51
95
gcc_jit_type * uint8 =
52
96
gcc_jit_context_get_int_type (ctxt , 1 , 0 );
53
97
CHECK (gcc_jit_type_is_integral (uint8 ));
98
+ CHECK (!gcc_jit_type_is_floating_point (uint8 ));
54
99
55
100
CHECK (!gcc_jit_type_dyncast_vector (double_type ));
56
101
gcc_jit_type * vec_type = gcc_jit_type_get_vector (double_type , 4 );
0 commit comments