{
RETURN_VAL_IF_FAIL (type, -1, NULL, NULL, "NULL type");
RETURN_VAL_IF_FAIL
- (type->is_int (), -1, NULL, NULL,
- "only getting the size of an integer type is supported for now");
+ (type->is_int () || type->is_float (), -1, NULL, NULL,
+ "only getting the size of integer or floating-point types is supported for now");
return type->get_size ();
}
CHECK (gcc_jit_compatible_types (
gcc_jit_context_get_type (ctxt, GCC_JIT_TYPE_LONG),
gcc_jit_context_get_type (ctxt, GCC_JIT_TYPE_INT64_T)));
+
+ CHECK_VALUE (gcc_jit_type_get_size (gcc_jit_context_get_type (ctxt, GCC_JIT_TYPE_FLOAT)), sizeof (float));
+ CHECK_VALUE (gcc_jit_type_get_size (gcc_jit_context_get_type (ctxt, GCC_JIT_TYPE_DOUBLE)), sizeof (double));
}